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
require 'formtastic/validations' | |
module Formtastic | |
class SemanticFormBuilder < ActionView::Helpers::FormBuilder | |
@@validate_by_default = false | |
cattr_accessor :validate_by_default | |
end | |
end | |
Formtastic::SemanticFormBuilder.validate_by_default = true |
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
Put this in an automator service as described by | |
http://blog.fosketts.net/2010/08/09/assign-keyboard-shortcut-applescript-automator-service/ |
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
Specification From ... To (exclusive) | |
">= 3.0" 3.0 ... ∞ | |
"~> 3.0" 3.0 ... 4.0 | |
"~> 3.0.0" 3.0.0 ... 3.1 | |
"~> 3.5" 3.5 ... 4.0 | |
"~> 3.5.0" 3.5.0 ... 3.6 | |
taken from: http://rubygems.rubyforge.org/rubygems-update/Gem/Version.html |
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 Dude < Person | |
awesomeness "SUPER AWESOME" | |
intellect 80 | |
end | |
# Dude.awesomeness #=> "SUPER AWESOME" | |
# Dude.new.intellect #=> 80 |
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
a = [] | |
a << false ? "bad" : "awesome" | |
puts a.inspect # => [false] | |
a = [] | |
a << (false ? "bad" : "awesome") | |
puts a.inspect # => ["awesome"] |
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
defaults write com.macromates.textmate OakDefaultLanguage E00B62AC-6B1C-11D9-9B1F-000D93589AF6 |
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 FourToedFrontFeet | |
def number_of_toes | |
4 | |
end | |
end | |
module Quadruped | |
include FourToedFrontFeet | |
def number_of_legs | |
4 |
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
require 'rubygems' | |
require 'rr' | |
extend RR::Adapters::RRMethods | |
module Something | |
def go | |
puts "going" | |
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
class Frog | |
def self.go | |
puts 45 | |
end | |
end | |
Frog.go | |
module Whatever |
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 One | |
def go | |
1 | |
end | |
end | |
module Two | |
def go | |
2 | |
end |