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
{ | |
"prettier": { | |
"arrowParens": "always", | |
"bracketSpacing": true, | |
"jsxBracketSameLine": true, | |
"printWidth": 90, | |
"semi": true, | |
"singleQuote": true, | |
"tabWidth": 2, | |
"trailingComma": "es5", |
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
# The following packages are needed during `make` on Ubuntu | |
sudo apt-get install libssl-dev libtool autoconf automake build-essential python-dev | |
# The rest is just instructions from | |
# https://codeyarns.com/2015/02/10/how-to-install-and-use-watchman/ | |
git clone https://github.com/facebook/watchman.git | |
cd watchman | |
git checkout v4.9.0 # latest version | |
./autogen.sh | |
./configure |
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
var isDivisibleBy13 = function(test) { | |
if (Math.abs(test) === 13 || test % 13 === 0) { | |
return true; | |
} | |
var lastDigit = +String(number).slice(-1), | |
remainingDigits = +String(test).slice(0, -1); | |
if (test >= 13 && (remainingDigits - (lastDigit * 9)) % 13 === 0) { | |
return isDivisibleBy13(remainingDigits); | |
} |
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
# katacoda Makefile example for managing Docker images | |
NAME = benhall/docker-make-demo | |
default: build | |
build: | |
docker build -t $(NAME) . | |
push: | |
docker push $(NAME) |
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
// FROM https://blog.hyper.sh/hyper_vs_digitalocean_round_1_wordpress_mysql_phpmyadmin.html | |
//run mysql container | |
$ hyper run --name mysqldb -e MYSQL_ROOT_PASSWORD=12345678 -d mysql | |
dedd5369d311ea2de163a04c71961104569e953d90b2424df3e3debaf1ca3d0e | |
//run phpmyadmin container | |
$ hyper run --name myadmin -d --link mysqldb:db -p 8888:80 phpmyadmin/phpmyadmin | |
475e215b02fef05da0eca243b708c578e19372d5efcf7551c2c4a32350633e34 |
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
// Front-end package.json for | |
// - compiling sass | |
// - hot relaod | |
{ | |
"name": "", | |
"version": "1.0.0", | |
"description": "", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 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
# https://superuser.com/questions/318186/how-do-i-uninstall-google-chrome-completely-from-my-mac | |
rm -rf ~/Applications/Chrome\ Apps | |
rm -r /Applications/Google\ Chrome.app/ | |
rm -r ~/Library/Application\ Support/Google/Chrome/ | |
rm ~/Library/Application\ Support/CrashReporter/Google\ Chrome* | |
rm ~/Library/Preferences/com.google.Chrome* | |
rm ~/Library/Preferences/Google\ Chrome* | |
rm -r ~/Library/Caches/com.google.Chrome* | |
rm -r ~/Library/Saved\ Application\ State/com.google.Chrome.savedState/ |
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
application: you-app-name-here | |
version: 1 | |
runtime: python | |
api_version: 1 | |
default_expiration: "30d" | |
handlers: | |
- url: /(.*\.(appcache|manifest)) | |
mime_type: text/cache-manifest |
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://stackoverflow.com/questions/31077319/regex-get-query-string-without-hash | |
var parseUri = function (uri){ | |
var anchor = document.createElement('a') | |
; | |
anchor.href = uri; | |
return { | |
protocol: anchor.protocol | |
, host: anchor.host | |
, hostname: anchor.hostname | |
, port: anchor.port |
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
// i can't remember where I found this | |
// deep link to modal items | |
function deepLinkIntoModals() { | |
// queryStrip | |
function queryStrip(string) { | |
string = string.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); | |
var regex = new RegExp('[\\?&]' + string + '=([^&#]*)'), | |
results = regex.exec(location.search); | |
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, '')); |