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
# reload this profile | |
reloadprofile() { | |
[ -x ~/.bash_profile ] && . ~/.bash_profile; | |
} | |
# edit this profile | |
editprofile() { | |
$EDITOR ~/.bash_profile; | |
} |
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
<IfModule mod_rewrite.c> | |
RewriteCond %{REQUEST_FILENAME} \.(?:list|of|file|types)$ | |
RewriteCond %{HTTP_REFERER} !^https?://(?:(?:sub|doms|go|here)\.sites|go|here) [NC] | |
RewriteRule \.(?:list|of|file|types)$ - [F,L] | |
</IfModule> |
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 | |
} |
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
<!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
// 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
// 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
#!/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
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/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 |