This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Current browser support for native promises: http://kangax.github.io/compat-table/es6/#Promise | |
// Article: http://www.html5rocks.com/en/tutorials/es6/promises/ | |
// Polyfills: | |
// https://github.com/getify/native-promise-only | |
// https://github.com/jakearchibald/es6-promise | |
/*------------------------------ GET PROMISE ------------------------------*/ | |
// N.B.: Promises pass only first argument to resolve/reject callbacks, others are ignored | |
function doSomething(){ | |
return new Promise(function(resolve, reject) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# HOW TO USE | |
# Save code to file | |
# Run as "SCRIPT_FILE_NAME SASS_DIRECTORY" | |
# e.g "./find_unused_variables.sh ./sass" | |
VAR_NAME_CHARS='A-Za-z0-9_-' | |
find "$1" -type f -name "*.scss" -exec grep -o "\$[$VAR_NAME_CHARS]*" {} ';' | sort | uniq -u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function terminate { | |
echo ':'$1 | |
lsof -P | grep ':'$1 | awk '{print $2}' | xargs kill -9 | |
} | |
terminate $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git branch | grep -v (git rev-parse --abbrev-ref HEAD) | xargs git branch -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/** | |
* Script takes the port as a param and tries to find and kill a process | |
* which is listening the port | |
* | |
* Example of the script usage: | |
* node SCRIPT %PORT_NUMBER% | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://help.github.com/articles/changing-a-remote-s-url/ | |
$ vim .git/config | |
change: | |
https://github.com/USERNAME/OTHERREPOSITORY.git | |
to: | |
[email protected]:USERNAME/OTHERREPOSITORY.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN GZIP | |
# http://httpd.apache.org/docs/2.2/mod/mod_deflate.html | |
<IfModule mod_deflate.c> | |
# Enabling Compression | |
SetOutputFilter DEFLATE | |
# Insert filters | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# based on https://gist.github.com/schacon/942899 | |
# list | |
git branch -r --merged | grep origin | grep -v '>' | grep -v master\* | grep -v release-\* | xargs -L1 | |
# delete | |
git branch -r --merged | grep origin | grep -v '>' | grep -v master\* | grep -v release-\* | xargs -L1 | awk '{sub(/origin\//,"");print}' | xargs git push origin --delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
// Adjustments particular to this page to ensure we hit desktop breakpoint. | |
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1}); | |
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'}); |