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
/* Centering a DIV */ | |
body { | |
text-align: center; | |
min-width: 600px; | |
} | |
#wrapper { | |
margin:0 auto; | |
width:600px; |
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
#!/bin/bash | |
# /etc/init.d/xvfb_daemon | |
# Xvfb startup script. | |
# Tom Meier <tom@venombytes.com> | |
# | |
### BEGIN INIT INFO | |
# Provides: xvfb | |
# Short-Description: Start/stop/restart daemon | |
# Description: Controls the Xvfb daemon which starts/stops the X Virtual Framebuffer server | |
### END INIT INFO |
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
# app/models/student.rb | |
class Student < ActiveRecord::Base | |
include CommonValidations::StudentTeacherValidations | |
end | |
# app/models/teacher.rb | |
class Teacher < ActiveRecord::Base | |
include CommonValidations::StudentTeacherValidations | |
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
# for testing validates_length_of :name, :within => 3..100, :allow_nil => true | |
it "should not be valid with a name having less than 3 or more than 100 characters, if name is given" do | |
@category = Category.new @valid_attributes | |
@category.name = 'to' | |
@category.should have(1).errors_on(:name) | |
@category.errors.on(:name).should include "too short" | |
@category = Category.new @valid_attributes | |
@category.name = 't'*101 | |
@category.should have(1).errors_on(:name) | |
@category.errors.on(:name).should include "too long" |
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 pending_total | |
if not_needed? | |
0.00 | |
else | |
# everyone gets the member pricing | |
daily_rate = ACCOMMODATION_RATES[room_type][:member] | |
departure_date = departure.to_date | |
arrival_date = arrival.to_date | |
total_days = departure_date - arrival_date | |
before_discounted_days = [[start_date - arrival_date, 3].min, 0].max |
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
module ActiveRecord | |
class Base | |
class << self | |
def default_scope(options = {}) | |
reset_scoped_methods | |
default_scoping = self.default_scoping.dup | |
previous = default_scoping.pop | |
if previous.respond_to?(:call) or options.respond_to?(:call) |
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 node | |
// USAGE | |
// if you have given this executable permissions | |
// and you named the file something like "hn" | |
// then you can run "hn" which will | |
// print all of the news items on hackernews. | |
// You could also run "hn 1" which opens the first url. | |
// Make sure $BROWSER is set to a value. |
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
/Users/galvatron/Sites/project/vendor/ruby/1.9.1/gems/cucumber-rails-1.0.2/lib/cucumber/rails.rb:4:in `dirname': can't convert nil into String (TypeError) | |
»·······from /Users/galvatron/Sites/project/vendor/ruby/1.9.1/gems/cucumber-rails-1.0.2/lib/cucumber/rails.rb:4:in `<top (required)>' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:76:in `require' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:76:in `rescue in block in require' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:62:in `block in require' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:55:in `each' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:55:in `require' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fast |
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
Background: # features/admin/orders/filters_orders_by_delivery_location.feature:7 | |
Given "John Smith" has an order for delivery at "Harvest Moon" # features/step_definitions/admin/order_steps.rb:1 | |
And "Jane Doe" has an order for delivery at "Green's Garage" # features/step_definitions/admin/order_steps.rb:1 | |
And I am on the admin orders page # features/step_definitions/web_steps.rb:44 | |
Scenario: Filtering order by delivery location # features/admin/orders/filters_orders_by_delivery_location.feature:12 | |
When I filter orders by "Harvest Moon" delivery location # features/step_definitions/admin/order_steps.rb:6 | |
Then I should see "John Smith" # features/step_definitions/web_steps.rb:105 | |
And I should not see "Jane Doe" # features/step_definitions/web_steps.rb:123 | |
And the delivery location "Harvest Moon" should be sele |
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
function! SourceVimLocal() | |
if filereadable(".vimlocal") | |
source .vimlocal | |
endif | |
endfunction | |
call SourceVimLocal() |
OlderNewer