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 File.dirname(__FILE__) + '/../config/database' | |
register DatabaseSetup | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Migration.verbose = true | |
ActiveRecord::Migrator.migrate(File.dirname(__FILE__)+"/../db/migrate") |
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 can make as many tabs as you wish... | |
# tab names are actually arbitrary at this point too. | |
--- | |
- tab1: cd ~/foo/bar | |
- tab2: | |
- mysql -u root | |
- use test; | |
- show tables; | |
- tab3: echo "hello world" | |
- tab4: cd ~/baz/ && svn up |
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
default = lambda { |h,k| h[k] = Hash.new(&default) } | |
top = Hash.new(&default) |
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 'active_support' | |
while (deck ||= %w(Diamond Heart Spade Club).collect{ |suit| {'Ace' => 'Waterfall', 2 => 'You', 3 => 'Me', 4 => 'Women of Society', 5 => 'Category', 6 => 'Gentlemen', 7 => 'Heaven', 8 => 'Mate', 9 => 'Rhyme', 'Jack' => 'Thumb Master', 'Queen' => 'Questions', 'King' => 'Pour'}.collect{|card, rule| "#{(card)} of #{suit}s: #{rule}"} }.flatten.shuffle).select {|card| card =~ /king/i}.present? do puts deck.pop 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
git svn branch remote_name | |
git checkout -b local_name -t remote_name |
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
# GIT PS1 | |
# COLORS | |
LIGHT_GRAY="\[\033[0;37m\]"; BLUE="\[\033[0;34m\]"; RED="\[\033[0;31m\]"; LIGHT_RED="\[\033[1;31m\]"; | |
GREEN="\[\033[0;32m\]"; WHITE="\[\033[1;37m\]"; LIGHT_GRAY="\[\033[0;37m\]"; YELLOW="\[\033[1;33m\]"; | |
BROWN="\[\033[0;33m\]"; BLACK="\[\033[0;30m\]";PURPLE="\[\033[0;35m\]";CYAN="\[\033[0;36m\]"; | |
# GIT PROMPT (http://gist.github.com/120804) | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \(\1\)/'; | |
} | |
function parse_git_status { |
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
## database.yml (after) | |
<% | |
# http://mislav.uniqpath.com/rails/branching-the-database-along-with-your-code/ | |
branch = `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '') | |
suffix = `git config --bool branch.#{branch}.database`.chomp == 'true' ? "_#{branch}" : "" | |
%> | |
development: | |
# ... adapter/auth config ... | |
database: myapp<%= suffix %> |
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' |
OlderNewer