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/ruby | |
#Util to show migrations in a nice to read format | |
#Highlights current version of db in red | |
#requires term-ansicolor gem | |
#usage - copy to your rails root, chmod +x lsm.rb , then ./lsm or ./lsm s to sort alphabetically | |
require 'date' | |
require 'rubygems' | |
require 'term/ansicolor' | |
include Term::ANSIColor |
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 | |
#Adapted from http://pragmatig.wordpress.com/2009/06/17/quick-markdown-preview-for-github-readme/ | |
#Added --firefox or -f parameter so that it won't open firefox each time, and you can just hit refresh instead. | |
raise "Usage:\nmarkdown <filename> [-f|--firefox]" unless ARGV[0] | |
require 'rubygems' | |
#e.g. rdiscount, gem install rdiscount (or any other bluecloth flavour...) | |
require 'markdown' |
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
Building native extensions. This could take a while... | |
ERROR: Error installing bloopsaphone: | |
ERROR: Failed to build gem native extension. | |
/home/mark/.rvm/rubies/ruby-1.8.7-p249/bin/ruby extconf.rb | |
checking for main() in -lportaudio... yes | |
creating Makefile | |
make | |
gcc -I. -I. -I/home/mark/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -I../../c -c bloopsaphone.c |
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 | |
require 'rubygems' | |
begin | |
require 'term/ansicolor' | |
include Term::ANSIColor | |
rescue LoadError | |
puts "To get color from this post-commit hook install term/ansicolor" | |
%w[red blue green].each { |color| eval "def #{color} &blk; blk.call; 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
After do |scenario| | |
save_and_open_page if scenario.status == :failed | |
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
ruby-1.9.2-p0 > require './koch_snowflake' | |
=> true | |
ruby-1.9.2-p0 > k=KochSnowflake.new 5,514 | |
=> #<KochSnowflake:0x97222e4 @iteration=514, @size=5> | |
ruby-1.9.2-p0 > k.area | |
=> NaN | |
ruby-1.9.2-p0 > k=KochSnowflake.new 5,513 | |
=> #<KochSnowflake:0x977cc80 @iteration=513, @size=5> | |
ruby-1.9.2-p0 > k.area | |
=> 16.168975852600433 |
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 aliases | |
alias gs='git status' | |
alias gl='git log ' | |
alias ga='git add ' | |
alias gd='git diff --ignore-space-change ' | |
alias gpl='git pull --rebase' | |
alias grc='git rebase --continue' | |
alias gpo='git push origin ' | |
alias gb='git branch ' | |
alias gf='git fetch ' |
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 'ticketmaster' | |
require 'ticketmaster-pivotal' | |
require 'ticketmaster-trac' | |
require 'ruby-debug/debugger' | |
pivotal = TicketMaster.new(:pivotal, :username => '[email protected]',:password => 'password' ) | |
pivotal_project = pivotal.project(some_integer) | |
trac = TicketMaster.new(:trac, {:username=> 'username', :password => "password", :url => "http://example.com"}) |
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
show_line() { | |
default_context_lines=10 | |
usage() { | |
echo "show_line <file> <line number> [number of context lines]" | |
echo "OR:" | |
echo "show_line <file>:<line number>[:<number of context lines>]" | |
echo | |
echo "Usage Examples:" |
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
pry(main)> debug_string "今日は" | |
今 | |
0xE4 228 1110 0100 | |
0xBB 187 1011 1011 | |
0x8A 138 1000 1010 | |
日 | |
0xE6 230 1110 0110 | |
0x97 151 1001 0111 |
OlderNewer