This file contains hidden or 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
We could have sent you a birthday card. We could have sent you some flowers or a cake. | |
But we didn't. | |
We could have even sent you one of those automatically generated messages to wish you happy birthday where we don't even have to replace INSERT NAME. | |
But we didn't | |
We wrote this birthday greeting just for you. |
This file contains hidden or 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
source 'http://rubygems.org' | |
gem 'rails', '3.1.0' | |
gem 'rack', '1.3.3' | |
group :assets do | |
gem 'sass-rails', "~> 3.1.0.rc" | |
gem 'coffee-rails', "~> 3.1.0.rc" | |
gem 'uglifier', "1.0.0" | |
gem 'compass', '~> 0.12.alpha' |
This file contains hidden or 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
skip_vim_plugin "color-sampler" | |
skip_vim_plugin "conque" | |
skip_vim_plugin "fugitive" | |
skip_vim_plugin "git" | |
skip_vim_plugin "taglist" | |
skip_vim_plugin "unimpaired" | |
skip_vim_plugin "pep8" |
This file contains hidden or 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 sort(elements) | |
return elements if elements.size <= 1 | |
return elements if elements[0] < elements[1] | |
[elements[1], elements[0]] | |
end | |
describe "sort" do | |
example "empty array => empty array" do | |
sort([]).should == [] |
This file contains hidden or 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
Running Jasmine specs... | |
. | |
PASS: 1 test, 0 failures, 0.005 secs. |
This file contains hidden or 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
module MyApp | |
class Con < EM::Connection | |
def post_init | |
@queue = EM::Queue.new | |
end | |
def receive_data(data) | |
@queue.push(data) | |
end | |
end |
This file contains hidden or 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
$ redis-benchmark ‹ruby-1.9.2› | |
====== PING (inline) ====== | |
10000 requests completed in 0.09 seconds | |
50 parallel clients | |
3 bytes payload | |
keep alive: 1 | |
100.00% <= 0 milliseconds | |
109890.11 requests per second |
This file contains hidden or 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
1) Partnership as a relation between two people connects a person with a partner | |
Failure/Error: person = create(:person_parent, partner: partner) | |
ActiveRecord::RecordInvalid: | |
Validation failed: Person partnership cannot assign partner to a partner | |
# ./spec/models/partnership_spec.rb:13:in `block (3 levels) in <top (required)>' | |
2) Partnership as a relation between two people connects a partner with a customer_partner | |
Failure/Error: person = create(:person_parent, partner: partner) | |
ActiveRecord::RecordInvalid: | |
Validation failed: Person partnership cannot assign partner to a partner |
This file contains hidden or 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
class Batch | |
end | |
class Invoice < ActiveRecord::Base | |
belongs_to :invoicable, polymorphic: true | |
belongs_to :invoicer, polymorphic: true | |
has_many :invoice_lines | |
def amount |
This file contains hidden or 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
# Helper class for importing files with records to the database. | |
class SeedFile | |
def self.import(path) | |
new(path).import | |
end | |
attr_reader :path | |
def initialize(path) | |
@path = Pathname(path) |