Skip to content

Instantly share code, notes, and snippets.

Pedro Canterini pcanterini

Block or report user

Report or block pcanterini

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

pcanterini /
Created Mar 23, 2017
Social browser User Agents (Twitter and Facebook UA)



Mozilla/5.0 (Linux; Android 4.4.4; One Build/KTU84L.H4) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/ Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/;]


Mozilla/5.0 (Linux; Android 4.4.4; One Build/KTU84L.H4) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/ Mobile Safari/537.36

# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi -f $(docker images -q)
pcanterini / track
Last active Oct 19, 2016
Example of track with bad embed_code data
View track
"updated_at": "2016-10-19T20:16:55Z",
"type": "ts",
"tracks": [{
"url_hash": "fc88ab7623ceb58a7ee77a7ea2f077462ab39d725645881e02a4308566d52719",
"url": "",
"updated_at": "2016-10-19T15:42:01Z",
"tag": {
"unique_name": "nba",
"tag_id": 19,
pcanterini /
Created Aug 11, 2016 — forked from learncodeacademy/
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
pcanterini / composition.js
Last active Jan 28, 2016
Composition over Inheritance in JS
View composition.js
// Prototypal OO with ES6
// Eric Elliott's example
let animal = {
animalType: 'animal',
describe () {
return `An ${this.animalType}, with ${this.furColor} fur,
${this.legs} legs, and a ${this.tail} tail.`;
pcanterini /
Created Nov 15, 2015 — forked from paulirish/
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.


Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
pcanterini / tape.js
Created Nov 10, 2015
tape example test
View tape.js
import test from 'tape';
// For each unit test you write,
// answer these questions:
test('What component aspect are you testing?', assert => {
const actual = 'What is the actual output?';
const expected = 'What is the expected output?';
assert.equal(actual, expected,
'What should the feature do?');
pcanterini / DNSimpleUpdater
Last active Aug 29, 2015 — forked from digitaljhelms/DNSimpleUpdater
DNSimple DNS Updater for OS X Yosemite
View DNSimpleUpdater
AUTH_EMAIL='your@email' # dnsimple account email address
AUTH_TOKEN='your-api-token' # dnsimple api token
DOMAIN_ID='' # domain name or id
RECORD_ID='12345' # record id to update
curl -H "X-DNSimple-Token: $AUTH_EMAIL:$AUTH_TOKEN" \
-H "Accept: application/json" \
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document)
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn)
NodeList.prototype.__proto__ = Array.prototype
You can’t perform that action at this time.