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
git config --global merge.tool p4merge | |
git config --global mergetool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe' |
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
// modified version of http://www.guffa.com/Programming_archive.aspx?id=16 | |
var getQuerystring = function (key, from){ | |
var re = new RegExp('(?:\\?|&)'+key+'=(.*?)(?=&|$)','gi') | |
, r = [] | |
, m | |
; | |
while ((m=re.exec(from)) != null) r.push(m[1]); | |
return (r.join(',') || '').replace('/',''); |
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
// output a warning or message to the console | |
// depending on how the test passed | |
function assert(test, description){ | |
console[!!test ? 'log' : 'warn']('Test %s: returned %s', description, test); | |
} |
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, '')); |
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
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://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
// 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
// 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
# katacoda Makefile example for managing Docker images | |
NAME = benhall/docker-make-demo | |
default: build | |
build: | |
docker build -t $(NAME) . | |
push: | |
docker push $(NAME) |