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
.DS_Store | |
*.swp | |
.sass-cache | |
.irb-save-history | |
.capfile | |
.bundle | |
.bundle/* | |
config/deploy.rb | |
config/database.yml |
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
# Returns the expected method return | |
def return_out_of_ensure | |
return 'actual return' | |
ensure | |
'not returned' | |
end | |
# Returns from ensure despite a method return | |
def return_within_ensure | |
return 'not returned' |
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
# load libraries | |
require 'rubygems' | |
require 'wirble' | |
# so I can use awesome print (syntax: ap object) for sane object printing: | |
require 'ap' | |
require 'irb/completion' | |
require 'map_by_method' | |
require 'what_methods' |
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 | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
alias gi="echo is \'gitx\' really that hard to type?; gitx; osascript -e 'tell application \"System Events\" to keystroke \"2\" using command down'" |
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 | |
reminder_location = 'ignored/reminders.txt' | |
file_location = File.join( File.dirname(__FILE__), '..', '..', reminder_location) | |
more_work_needed = IO.readlines(file_location).join('').strip != '' | |
exit 1 if more_work_needed |
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
function appendParamsToUrl(url, params){ | |
if(url.match(/\?/)){ | |
//it just has a question mark at the end | |
if(url.indexOf('?') == url.length-1){ | |
return url + jQuery.param(params); | |
}else{ | |
//it already has query params | |
return url + '&' + jQuery.param(params); | |
} | |
}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
http://paulbarry.com/articles/2009/08/30/active-record-random | |
class ActiveRecord::Base | |
def self.random | |
if (c = count) > 0 | |
first(:offset => rand(c)) | |
end | |
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
# http://optimisdev.com/posts/open-all-conflicted-files-in-textmate | |
git ls-files --unmerged | awk '{print $4}' | sort -u | xargs mate |
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 | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |