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
data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///////wAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw== |
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
#!/bin/sh | |
# Examples: | |
# ./image64.sh myImage.png | |
# outputs: data:image/png;base64,xxxxx | |
# ./image64.sh myImage.png -img | |
# outputs: <img src="data:image/png;base64,xxxxx"> | |
filename=$(basename $1) | |
xtype=${filename##*.} | |
append="" |
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
#!/bin/sh | |
# pre-commit git hook to make sure developers don't accidentally commit code they didn't mean to commit :) | |
REMOVEME_STRING="REMOVEME" | |
ALLOW_COMMITTING_REMOVEME=`git config hooks.allowcommittingremoveme` | |
# redirect stdout to stderr | |
exec 1>&2 | |
if [ "$ALLOW_COMMITTING_REMOVEME" != "true" ] && |
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
# run iOS simulator | |
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app | |
# run Google Chrome with web security disabled | |
open -a Google\ Chrome\ Canary --args --disable-web-security |
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 resource = "http://my-service/data.json"; | |
var xhr = new XMLHttpRequest(); | |
xhr.onprogress = updateProgress; | |
xhr.onreadystatechange = updateReadyState; | |
xhr.open('GET', resource, true); | |
xhr.send(); | |
function updateProgress (e) { |
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
Show hidden characters
{ | |
"settings": { | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true | |
}, | |
"folders": [{ | |
"follow_symlinks": true, | |
"path": "apps/homescreen" | |
}, { |
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
# checkout a branch by partial name | |
go = "!sh -c \"if [ $(git branch | grep $1 | wc -l) -gt 1 ]; then git branch | grep $1; else git checkout $(git branch | grep $1); fi\"" | |
# open conflicted files in editor | |
revise = !sh -c \"git diff --name-only | uniq | xargs subl\" |
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
cd gaia | |
npm install | |
export GAIATEST_ACKNOWLEDGED_RISKS=true | |
export GAIATEST_SKIP_WARNING=true | |
./node_modules/.bin/travisaction gaia_ui_tests install | |
# run all tests | |
./node_modules/.bin/travisaction gaia_ui_tests script | |
# or just one |
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
now = new Date() | |
// Sat Nov 02 2013 08:56:45 GMT+0200 (IST) | |
start = new Date() | |
start.setMonth(start.getMonth()-1) | |
start | |
// Wed Oct 02 2013 08:57:26 GMT+0300 (IDT) | |
end = new Date() | |
end.setDate(end.getDate()-1) | |
// Fri Nov 01 2013 08:57:30 GMT+0200 (IST) |
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
String.prototype.indexOf = function(query, start) { | |
var streak = 0; | |
start = Math.min(start || 0, this.length - 1); | |
// TODO stop at this.length - query.length | |
for (var i = start; i < this.length; i++) { | |
if (this[i] === query[streak]) | |
streak++; | |
else |
OlderNewer