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 => 'test@example.com',: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 |
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
config.cache_classes = ENV['RELOAD_CLASSES'].blank? |
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
#frequency counter | |
#adds each character in ruby files to a hash incrementing a counter | |
#outputs list in reverse order. least frequent first | |
#Usage | |
#ruby frequency_counter.rb FILE1 [FILE2 FILE3... etc] | |
characters = Hash.new(0) | |
ARGV.each do |file| | |
content = File.read file |
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
twitter = Hateoas.site "api.twitter.com" | |
twitter.actions | |
# => [sign_in: {method: :get}] | |
twitter.sign_in user: "mark@example.com", password: "password" | |
twitter.actions | |
# => [read_messages: {method: :get}, tweet: {method: :post}] |
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
#encoding: utf-8 | |
あけまして = | |
class A | |
class << self | |
alias おめでとう instance_eval | |
def ございます e; puts e; end | |
end | |
self | |
end |