Skip to content

Instantly share code, notes, and snippets.

View Wigny's full-sized avatar

Wígny Almeida Wigny

View GitHub Profile
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active June 7, 2026 21:17
Conventional Commits Cheatsheet
@tzmartin
tzmartin / embedded-file-viewer.md
Last active June 1, 2026 14:53
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@josevalim
josevalim / watcher.sh
Last active May 22, 2024 10:06
A 1LOC bash script for re-running tests whenever a lib/ or test/ file changes keeping the same VM instance
# You will need fswatch installed (available in homebrew and friends)
# The command below will run tests and wait until fswatch writes something.
# The --stale flag will only run stale entries, it requires Elixir v1.3.
fswatch lib/ test/ | mix test --stale --listen-on-stdin
@felipecwb
felipecwb / cnhValidation.js
Last active July 7, 2025 01:08
CNH (Carteira Nacional de Habilitação) validation in JS
function validateCNH(cnh) {
var char1 = cnh.charAt(0);
if (cnh.replace(/[^\d]/g, '').length !== 11 || char1.repeat(11) === cnh) {
return false;
}
for (var i = 0, j = 9, v = 0; i < 9; ++i, --j) {
v += +(cnh.charAt(i) * j);
}
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();