This file contains hidden or 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/bash | |
usage() { | |
cat >&2 <<EOT | |
Usage: $(basename $0) <a_url_to_a_ff_ext.xpi> | |
EOT | |
exit 1; | |
} | |
if [ "$#" -lt "1" ]; then |
This file contains hidden or 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
function say() { | |
var slice = Array.prototype.slice; | |
var concat = Array.prototype.concat; | |
var strs = slice.call(arguments); | |
var func = function() { | |
strs = concat.call(strs, slice.call(arguments)); | |
return func; | |
}; | |
func.toString = function() { | |
return strs.join(' '); |
This file contains hidden or 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 | |
answer() { echo -e "\n\nAnswer: 42\n"; exit; } | |
trap answer TRAP INT HUP; | |
while [ 1 ]; do head -10 /dev/urandom | hexdump -C | head -3 | egrep --color=auto '[a-f][0-9a-f]'; sleep .1; done | |
# to run - | |
# curl https://raw.github.com/gist/1074226/the_answer_to_life_the_universe_and_everything.sh | sh |
This file contains hidden or 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
cmd-list.made | |
endnote | |
git | |
git-add | |
git-am | |
git-annotate | |
git-apply | |
git-archimport | |
git-archive | |
gitattributes |
This file contains hidden or 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/bash | |
DIR=${1:-.}; | |
if [ -z "$YUI" -o ! -r "$YUI" ]; then | |
echo "You need the path to YUI Compressor as env var \$YUI"; | |
exit 1; | |
fi | |
for CSS in `find $DIR -type f -name *.css`; do |
This file contains hidden or 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
// on http://www.w3.org/TR/CSS21/syndata.html | |
Array.prototype.forEach.call(document.querySelectorAll('span.colorsquare'), function(square) { | |
var name = square.childNodes[0].innerText, | |
hex = square.childNodes[1].data.trim(); | |
if (hex[1] === hex[2] && hex[3] === hex[4] && hex[5] === hex[6]) { | |
hex = '#' + hex[1]+hex[3]+hex[5]; | |
} | |
if (hex.length > name.length) { | |
console.log(hex, '->', name); | |
} |
This file contains hidden or 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
// on http://www.w3.org/TR/css3-color/ | |
Array.prototype.forEach.call(document.querySelectorAll('table.colortable')[1].querySelectorAll('td:not(.c)'), function(td) { | |
var name = td.innerText, | |
hex = td.nextSibling.innerText; | |
if (hex[1] === hex[2] && hex[3] === hex[4] && hex[5] === hex[6]) { | |
hex = '#' + hex[1]+hex[3]+hex[5]; | |
} | |
if (hex.length > name.length) { | |
console.log(hex, '->', name); | |
} |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<body> | |
<ol> | |
<li>Work at Yahoo!</li> | |
<li>???</li> | |
<li>PROFIT!!!</li> | |
</ol> | |
</body> | |
</html> |
This file contains hidden or 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
flab = | |
function () { | |
var s = Array.prototype.slice, | |
a = [s.call(arguments)], | |
b = function () { | |
b._calls = a | |
a.push(s.call(arguments)) | |
return b | |
} | |
b.toString = function () { |
This file contains hidden or 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
# lets you do echo 'lol' | todata | |
# or cat filename | todata | |
# and it'll spit out a nice data URI | |
todata() { | |
if [ ! -t 0 ]; then | |
php -r "echo 'data:text/plain;base64,'.base64_encode(file_get_contents('php://stdin')); }" && echo; | |
fi | |
} |