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
require 'rubygems' | |
require 'httparty' | |
require 'sinatra' | |
require 'ruby-debug' | |
require 'baby_tooth' | |
configure do | |
enable :sessions | |
BabyTooth.configure do |config| | |
config.client_id = 'XXXXXXXX', |
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
# this lets you do prefix F1-F5 to rate the current song in iTunes | |
bind F1 run-shell "osascript -e 'tell app \"iTunes\" to set the rating of current track to 20'" | |
bind F2 run-shell "osascript -e 'tell app \"iTunes\" to set the rating of current track to 40'" | |
bind F3 run-shell "osascript -e 'tell app \"iTunes\" to set the rating of current track to 60'" | |
bind F4 run-shell "osascript -e 'tell app \"iTunes\" to set the rating of current track to 80'" | |
bind F5 run-shell "osascript -e 'tell app \"iTunes\" to set the rating of current track to 100'" |
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
# this is a little messy but it works. | |
# ran as a post-build task: ruby /path/to/script/campfire.rb 2>&1 >/dev/null & | |
require 'rubygems' | |
require 'uri' | |
require 'net/http' | |
require 'tinder' | |
IMAGE_TRANSLATION = { 'OK' => 'win', 'FAILURE' => 'fail' } |
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
# I want to write | |
method = condition ? 'show' : 'hide' | |
# but that compiles to: | |
# var method; | |
# method = (typeof condition !== "undefined" && condition !== null) ? condition : { | |
# 'show': 'hide' | |
# }; |
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
# you'll probably want to alias this in one of your dotfiles | |
# i.e. alias st="ruby -I\"lib:test\" search_and_test.rb" | |
# | |
# the -I"lib:test" can be important if you get complaints like "no such file to load -- test_helper (MissingSourceFile)" | |
ack_opts = [ | |
"-i", # case insensitive | |
"-l", # just return file names | |
"-G _test.rb", # only search files whose name matches /_test.rb/ | |
ARGV.join(' '), # pass along any options we're passed in (usually just the search string) |
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 | |
# ack the diff with a regexp to | |
# prevent you from adding lines (the \+ at the beginning indicates an added line in the diff) | |
# that introduce console.log | |
# and are not commented out (the \s* before console.log) | |
has_console_log=$(git diff --cached | ack '^\+\s*console\.log\(.*\)') | |
if [ "$has_console_log" != "" ] |
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
# usage: rails new APP_NAME -m http://gist.github.com/627198.txt -TJ | |
# the -T drops test-unit and the -J drops prototype | |
gem "pg" | |
gem "omniauth" | |
gem "paperclip" | |
gem "haml" | |
gem "sass" |
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
common: &shared | |
adapter: sqlite3 | |
pool: 5 | |
timeout: 5000 | |
<% %W(development test staging production).each do |env| %> | |
<%= env %>: | |
database: rcworkshop_<%= env %>.sqlite3 | |
<<: *shared | |
<% end %> |
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
en: | |
users: | |
show: | |
title: "{{@user.name}} has {{@user.hair.color}} hair" | |
description: "{{@user.name}}'s page on my site" | |
keywords: "user, {{@user.name}}, {{page_keywords}}, etc. etc." |
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
en: | |
default: | |
title: "My default title" | |
users: | |
index: "My Awesome User index" | |
show: "{{name}}'s page!" |