javascript:(function(){var%20collection%20%3D%20%5B%5D%3B%0Avar%20page%20%3D%201%3B%0Awhile%20(page%20%3E%200)%20%7B%0A%09%24.ajax(%7B%0A%09%09%20async%3A%20false%2C%0A%09%09%20type%3A%20'GET'%2C%0A%09%09%20url%3A%20window.location.href.replace(%2F(%5Cd%2B)%24%2F%2Cpage)%2C%0A%09%09%20success%3A%20function(data)%20%7B%0A%09%09%20%09%24data%20%3D%20%24(data)%3B%0A%09%09%09var%20epTitle%20%3D%20%24data.find('%23episode%20h2').first().text()%3B%0A%09%09%09var%20output%20%3D%20'%23%23%23%20%23'%2Bpage%2B'%3A%20'%2BepTitle%2B%22%5Cn%5Cn%22%3B%0A%09%09%09output%20%2B%3D%20'%5B**%5BShow%20link%5D('%2Bwindow.location.href.replace(%2F%5Cd%2B%24%2F%2Cpage)%2B%22)**%5D%5Cn%5Cn%22%0A%09%09%09%24data.find('%23episode_links').find('a').each(function()%7B%20output%20%2B%3D%20%22*%20%5B%22%2B%24(this).text().replace(%2F%5C%7C%2Fg%2C'-').replace(%2F%5B%5C%5B%5C%5D%5D%5D%2Fg%2C'**')%2B%22%5D(%22%2B%24(this).attr('href')%2B%22)%5Cn%22%20%7D)%3B%0A%09%09%09collection.push(output)%3B%0A%09%09%09page%20%2B%3D%201%3B%0A%09%
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
// generates a Markdown list of all the show links on a 5by5 episode page, | |
// autoselects the result for copying and provides next/prev navigation | |
// only designed for 5by5, which already has jQuery loaded and matches | |
// the regex. Customize as needed for other uses. | |
// Brett Terpstra 2013 | |
var output = "\n\n### [Episode "+window.location.href.replace(/.*\/(\d)/,"$1")+"]("+window.location.href+")\n\n"; | |
$('#episode_links').find('a').each(function(){ output += "* ["+$(this).text()+"]("+$(this).attr('href')+")\n" }); | |
// create next/prev links (no boundry checking) | |
var ep = parseInt(window.location.href.match(/(\d+)$/)[0],10); |
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
javascript:(function(){var%20output%3D%22%5Cn%5Cn%23%23%23%20%5BEpisode%20%22%2Bwindow.location.href.replace(%2F.*%5C%2F(%5Cd)%2F%2C%22%241%22)%2B%22%5D(%22%2Bwindow.location.href%2B%22)%5Cn%5Cn%22%3B%24(%22%23episode_links%22).find(%22a%22).each(function()%7Boutput%2B%3D%22*%20%5B%22%2B%24(this).text()%2B%22%5D(%22%2B%24(this).attr(%22href%22)%2B%22)%5Cn%22%7D)%3Bvar%20ep%3DparseInt(window.location.href.match(%2F(%5Cd%2B)%24%2F)%5B0%5D%2C10)%3Bvar%20nextLink%3D%24(%22%3Ca%3E%22).attr(%22href%22%2Cwindow.location.href.replace(%2F%5Cd%2B%24%2F%2Cep%2B1)).text(%22Next%20Episode%22).css(%7Bdisplay%3A%22block%22%2Cpadding%3A%2210px%22%2CtextAlign%3A%22center%22%2CbackgroundColor%3A%22%23ddd%22%2C%22float%22%3A%22right%22%7D)%3Bvar%20prevLink%3D%24(%22%3Ca%3E%22).attr(%22href%22%2Cwindow.location.href.replace(%2F%5Cd%2B%24%2F%2Cep-1)).text(%22Previous%20Episode%22).css(%7Bdisplay%3A%22block%22%2Cpadding%3A%2210px%22%2CtextAlign%3A%22center%22%2CbackgroundColor%3A%22%23ddd%22%2C%22float%22%3A%22left%22%7D)%3B%24(%2 |
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
rake assets # copy site resources and dotfiles | |
rake bump # Bump version number | |
rake clean # Clean out caches: .pygments-cache, .gist-cache, .sass-cache | |
rake config[key,value] # Change or add a config setting | |
rake copydot[source,dest] # copy dot files for deployment | |
rake deploy # Default deploy task | |
rake draft[title] # Create a draft | |
rake draft_no_edit[title] # Create a draft without prompt | |
rake drafts # Alias for finddraft without requesting search terms | |
rake edit[file] # Open a text file in the default editor |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Disabled</key> | |
<false/> | |
<key>EnvironmentVariables</key> | |
<dict> | |
<key>LANG</key> | |
<string>en_US.UTF-8</string> |
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
#!/usr/bin/ruby | |
input = STDIN.read | |
subs = { | |
" " => " ", | |
"a" => "ɐ", | |
"b" => "q", | |
"c" => "ɔ", | |
"d" => "p", |
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
# Rake file tricks for timing and notifying task completion | |
# at the top of the file with other config settings | |
run_time = Time.now | |
# quick function to determine diff between passed time and now | |
def finish_timer(start_time) | |
finish_time = Time.now - start_time | |
total_min = "%d" % (finish_time / 60) |
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
# Check your GMail using the provided Atom feed | |
# Assumes your GMail is your primary email address for the current user | |
# Also assumes that you've stored the password for your Google account in the keychain | |
# You know what happens when you assume... makes an ass out of you and Uma Thurman | |
gmail() { | |
user=`dscl . -read /Users/$(whoami)|grep "EMailAddress:"|sed 's/^EMailAddress: //'` | |
pass=$(security find-internet-password -w -a "$user" -s "accounts.google.com") | |
curl -u "$user:$pass" --silent "https://mail.google.com/mail/feed/atom"| perl -ne ' | |
print "Subject: $1 " if /<title>(.+?)<\/title>/ && $title++; | |
print "(from $1)\n" if /<email>(.+?)<\/email>/; |
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
/* This stylesheet is designed to work with the grey theme for GMail | |
- hides the top bar and Google+ notifications | |
- simplifies buttons (remove border/background, add hover state back) | |
- dim Rapportive until hovered | |
This is only partially tested at this point and may cause some issues | |
Please let me know if you find problems: <http://brettterpstra.com/contact/> | |
Brett Terpstra 2013 <http://brettterpstra.com> /* |
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
# ls archives (inspired by `extract`) | |
lsz() { | |
if [ $# -ne 1 ] | |
then | |
echo "lsz filename.[tar,tgz,gz,zip,etc]" | |
return 1 | |
fi | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2|*.tar.gz|*.tar|*.tbz2|*.tgz) tar tvf $1;; |