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 'open-uri' | |
desc "Run a remote script from ENV['REMOTE_URL']" | |
task :remote => :environment do | |
instance_eval(open(ENV['REMOTE_URL']).read) | |
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
#!/usr/bin/env ruby | |
# Usage: | |
# | |
# $ campfire "Hello Everyone" | |
# | |
# You can also paste | |
# | |
# $ campfire -p "some code" | |
# | |
# You can also pipe into it |
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
user.go_to_zoo_and_see_the_penguins_and_get_a_snack_but_get_home_before_seven_because_its_a_school_night_and_hey_awesome_mom_made_brownies_but_theyre_still_cooling_so_we_cant_eat_them_yet_so_lets_watch_some_tv_until_daddy_gets_home_oh_I_think_i_hear_him_and_oh_no_i_think_hes_been_drinking_and_mommy_saw_lipstick_on_his_collar_and_NO_dont_hit_mommy_I_want_to_go_to_my_room_but_I_also_want_brownies |
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
#!/usr/bin/env bash | |
echo "Installing key bindings" | |
mkdir -p "$HOME/Library/KeyBindings" | |
curl --silent "http://github.com/nakajima/dot-rot/raw/master/nakajima/DefaultKeyBinding.dict" > "$HOME/Library/KeyBindings/DefaultKeyBinding.dict" | |
echo "Installing TextMate bundles" | |
mkdir -p "$HOME/Library/Application Support/TextMate/Bundles" | |
function get_bundle() { | |
test -e "$HOME/Library/Application Support/TextMate/Bundles/$1.tmbundle" || git clone $2 "$HOME/Library/Application Support/TextMate/Bundles/$1.tmbundle" |
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
<html> | |
<head> | |
<style type="text/css" media="screen"> | |
li { | |
color: #aaa; | |
} | |
</style> | |
<script type="text/javascript" charset="utf-8"> | |
(function() { | |
// Helpers |
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 'fixjoury-girl' | |
# Why the new syntax ideas? | |
# | |
# * People get confused by `klass` | |
# * A lot of builders really don't need `overrides` processing | |
# * The case has been successfully argued that "scenario" builders, (that is, builders that come from other builders) | |
# are a good idea. | |
# | |
# SO without further ado: |
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
class Class | |
def include_eval(&block) | |
include Module.new(&block) | |
end | |
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
if Rails.env.development? | |
module ActionView | |
module Partials | |
def render_partial_with_annotations(options = {}) | |
if partial_path = options[:partial] | |
html = "\n<!-- START PARTIAL: \"#{partial_path}\" -->\n" | |
html += render_partial_without_annotations(options) | |
html += "\n<!-- END PARTIAL: \"#{partial_path}\" -->\n" | |
html | |
else |
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
$ ruby -e 'exit' | |
$ echo $? | |
0 | |
$ ruby -e 'exit 1' | |
$ echo $? | |
1 | |
$ ruby -e 'abort "oh no"' | |
oh no | |
$ echo $? | |
1 |
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: | |
// | |
// $('#the-select').choose('Some Option'); | |
// | |
// It'll throw an error if the option doesn't exist. | |
$.fn.choose = function(name) { | |
var elem = $(this); | |
if (elem.is(':not(select)')) { return elem; } | |
var option = elem.find('option').filter(function() { |