Skip to content

Instantly share code, notes, and snippets.

View thiago-amm's full-sized avatar

Thiago Alexandre thiago-amm

View GitHub Profile
@thiago-amm
thiago-amm / INSTALLATION.md
Last active July 6, 2022 22:42
b23a94e4ea6977aa40f601be58ed56a5
@thiago-amm
thiago-amm / bash-path-vars
Created June 16, 2022 12:19 — forked from caruccio/bash-path-vars
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts
@thiago-amm
thiago-amm / create_migration.sh
Created December 7, 2019 15:07 — forked from MarkyMarkMcDonald/create_migration.sh
Create Flyway migration versioned by timestamp: ./bin/create_migration.sh "Add_Unique_Constraint_To_User_Email"
#!/bin/bash
echo "-- New Migration" > "`dirname $0`/../src/main/resources/db/migrations/V`date +%s`__$1.sql"
@thiago-amm
thiago-amm / ultimate-ut-cheat-sheet.md
Created November 7, 2019 09:31 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@thiago-amm
thiago-amm / what-forces-layout.md
Created October 13, 2019 15:29 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@thiago-amm
thiago-amm / README.md
Created October 13, 2019 15:27 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@thiago-amm
thiago-amm / vanilla-js-cheatsheet.md
Created October 13, 2019 15:02 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@thiago-amm
thiago-amm / CURL-cheatsheet.md
Created September 14, 2019 17:13 — forked from Kartones/CURL-cheatsheet.md
CURL Cheatsheet
  • XML GET
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "http://hostname/resource"
  • JSON GET
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "http://hostname/resource"
  • JSON PUT
@thiago-amm
thiago-amm / README.md
Created August 17, 2019 21:01 — forked from greyscaled/README.md
Sequelize + Express + Migrations + Seed Starter
@thiago-amm
thiago-amm / daemon.json
Created June 30, 2019 18:20
Example Docker daemon.json
{
"api-cors-header": "",
"authorization-plugins": [],
"bip": "",
"bridge": "",
"cgroup-parent": "",
"cluster-store": "",
"cluster-store-opts": {},
"cluster-advertise": "",
"debug": true,