Skip to content

Instantly share code, notes, and snippets.

@takaaki
takaaki / brew_install_cofee-script
Created January 12, 2011 13:08
the error message
brew install coffee-script
==> Downloading https://github.com/jashkenas/coffee-script/tarball/1.0.0
0.0%
curl: (22) The requested URL returned error: 502
Error: Failure while executing: /usr/bin/curl -f#LA 'Homebrew 0.7.1 (Ruby 1.8.7-174; Mac OS X 10.6.6)' https://github.com/jashkenas/coffee-script/tarball/1.0.0 -o /Users/takaaki/Library/Caches/Homebrew/coffee-script-1.0.0.0
#!/bin/bash
# Requires "youtube-dl"
# http://rg3.github.com/youtube-dl/documentation.html
function fetch_mp4 {
youtube-dl --format=18 --literal $1
}
fetch_mp4 "http://www.youtube.com/watch?v=g2pTc97QypI";
@takaaki
takaaki / install_mongo.sh
Created December 11, 2010 12:20
Installing MongoDB on Mac
brew install mongodb | tee ~/bin/brew/brew_install_mongodb.txt
@takaaki
takaaki / quick_reference.md
Created October 21, 2010 08:48
Takaaki rocks.
===== Applications =====
Sun Jan 17 13:31:53 +0900 2010
1Password
Adium
Adobe
Adobe Bridge CS3
Adobe Device Central CS3
Adobe Help Viewer 1.1
Adobe Photoshop CS3
Adobe Reader 9
#!/bin/sh
# Launch or relaunch Firefox in Safe Mode
# Takaaki Kato <takaaki@samuraicoder.net>
# Assumes Firefox.app is located under /Applications
osascript -e 'tell application "Firefox" to quit'
sleep 3 # wait til Firefox quits
/Applications/Firefox.app/Contents/MacOS/firefox-bin -safe-mode
#!/bin/sh
# Get browser versions
# Prints version numbers of Safari and Firefox as well as OS X version number.
# by Takaaki Kato
# Partially stolen from http://episteme.arstechnica.com/eve/forums/a/tpc/f/8300945231/m/854004613931
# This script is dependent on the application location. Place apps under /Applications
# You can pipe the result to grep. For example `browsers | grep Firefox `
echo "Safari \c"

#grb git-remote-branch

Usage: grb create branch_name [origin_server]
grb publish branch_name [origin_server]
grb rename branch_name [origin_server]
grb delete branch_name [origin_server]
grb track branch_name [origin_server]

Notes:

#!/usr/bin/env ruby
# Shorten a URL using bit.ly API
# http://code.google.com/p/bitly-api/wiki/ApiDocumentation
# Login name and API key are required. Available by singing up on the site.
# TODO: Accept more than one URL at a time.
# TODO: URL needs to be escaped. Is 'cgi' class already included in ActiveSupport?
# TODO: Invalid URL string should get an error.
# TODO: Make this into a Mac OS X service and a TextMate command