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
# BAD | |
function1 = -> | |
console.log('stuff') | |
$(function1) | |
function2 = (parameter1) -> | |
console.log(parameter1) | |
$(function2) |
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
<false> is not true. (Test::Unit::AssertionFailedError) | |
/Users/matthooks/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/test/unit/assertions.rb:48:in `assert_block' | |
/Users/matthooks/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/test/unit/assertions.rb:500:in `_wrap_assertion' | |
/Users/matthooks/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_block' | |
/Users/matthooks/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/test/unit/assertions.rb:63:in `assert' | |
/Users/matthooks/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/test/unit/assertions.rb:495:in `_wrap_assertion' | |
/Users/matthooks/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/test/unit/assertions.rb:61:in `assert' | |
./features/step_definitions/contact_search_steps.rb:115:in `/^I should see contacts contacted more than two weeks ago$/' | |
features/contacts_search.feature:75:in `Then I should see contacts contacted more than two weeks ago' |
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 -*- | |
$:.push File.expand_path("../lib", __FILE__) | |
require "example_gem/version" | |
Gem::Specification.new do |s| | |
s.name = "example_gem" | |
s.version = ExampleGem::VERSION | |
s.platform = Gem::Platform::RUBY | |
s.authors = ["Name"] | |
s.email = ["Email"] |
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
Results 210.50 | |
System Info | |
Xbench Version 1.3 | |
System Version 10.6.1 (10B504) | |
Physical RAM 3072 MB | |
Model MacBookPro2,1 | |
Drive Type INTEL SSDSA2M160G2GC | |
Disk Test 210.50 | |
Sequential 132.18 | |
Uncached Write 145.15 89.12 MB/sec [4K blocks] |
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
# BEFORE | |
def validate_password_with_openid? | |
!using_openid? && require_password? | |
end | |
# AFTER | |
def validate_password_with_openid? | |
require_password? | |
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
# ACTIVATIONS_CONTROLLER.RB | |
class ActivationsController < ApplicationController | |
before_filter :require_no_user, :only => [:new, :create] | |
before_filter :load_and_verify_user, :only => [:new, :create] | |
def new | |
render | |
end | |
def create |
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 options[:validate_password_field] | |
validates_length_of options[:password_field], {:minimum => 4, :if => "validate_#{options[:password_field]}?".to_sym}.merge(options[:password_field_validates_length_of_options]) | |
validates_confirmation_of options[:password_field], options[:password_field_validates_confirmation_of_options].merge(:if => "#{options[:password_salt_field]}_changed?".to_sym) | |
validates_presence_of "#{options[:password_field]}_confirmation", :if => "#{options[:password_salt_field]}_changed?".to_sym | |
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
puts 'hello' | |
puts 'goodbye' |
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 sort | |
params[:block].each_with_index do |id, pos| | |
Block.find(id).update_attribute(:position, pos+1) | |
end | |
head :ok | |
end | |
def index | |
@blocks = @page.blocks |
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
puts 'hello world' |