Skip to content

Instantly share code, notes, and snippets.

View matthooks's full-sized avatar

Matt Hooks matthooks

View GitHub Profile
# BAD
function1 = ->
console.log('stuff')
$(function1)
function2 = (parameter1) ->
console.log(parameter1)
$(function2)
<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'
# -*- 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"]
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]
# BEFORE
def validate_password_with_openid?
!using_openid? && require_password?
end
# AFTER
def validate_password_with_openid?
require_password?
end
# 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
###
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
###
puts 'hello'
puts 'goodbye'
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
puts 'hello world'