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=postgresql | |
--skip-test-unit | |
--skip-bundle | |
--template=https://gist.github.com/jwaldrip/5538342/raw/rails-template.rb |
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
def session_with_debug | |
SessionDebugger.new(session_without_debug) | |
end | |
alias_method_chain :session, :debug | |
class SessionDebugger < SimpleDelegator | |
def []=(key, val) | |
puts "#{caller.first} SET session:#{key} TO #{val.inspect}" |
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=postgresql | |
--skip-test-unit | |
--skip-bundle | |
--template=https://gist.github.com/tomchapin/5541218/raw/rails-template.rb |
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 the source arrays don't have nil in them, you only need to extend the first array with nils, zip will automatically pad the others with nil. This also means you get to use compact to clean the extra entries out which is hopefully more efficient than explicit loops | |
def interleave(a,*args) | |
max_length = args.map(&:size).max | |
padding = [nil]*[max_length-a.size, 0].max | |
(a+padding).zip(*args).flatten.compact | |
end | |
# Here is a slightly more complicated version that works if the arrays do contain nil |
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
set -xg fish_color_user d75fff | |
set -xg fish_color_host d78700 | |
set -xg fish_color_git_added 00ff00 | |
set -xg fish_color_git_clean 00ff00 | |
set -xg fish_color_git_copied ff00ff | |
set -xg fish_color_git_deleted ff5f00 | |
set -xg fish_color_git_dirty ff5f00 | |
set -xg fish_color_git_modified 00afff | |
set -xg fish_color_git_renamed ff00ff |
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 'active_support/core_ext/string/inflections' | |
require 'colorize' | |
players = ARGV.clone | |
raise 'You must specify players (separated by spaces) as parameters.' and exit(1) unless players.count > 0 | |
until players.count == 0 | |
player1, player2 = players.shuffle!.slice!(0,2) | |
player2 ||= "Bot(AI)" |
NewerOlder