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
class SumOfFactors | |
def initialize(until_num, *divisible_by) | |
@until_num = until_num | |
@divisible_by = divisible_by | |
end | |
def get_sum | |
get_range.collect { |num| num if divisible? num }.compact.inject :+ | |
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
# http://gist.github.com/16885 | |
# $ ./script/console | |
# Loading development environment (Rails 2.1.0) | |
# >> | |
# >> User.whatis :create! | |
# File: /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/validations.rb:876 | |
# 872: end | |
# 873: | |
# 874: # Creates an object just like Base.create but calls save! instead of save |
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
require 'open-uri' | |
# url dsl -- the ultimate url dsl! | |
# | |
# You just can't beat this: | |
# | |
# $ irb -r url_dsl | |
# >> include URLDSL | |
# => Object | |
# >> http://github.com/defunkt.json |
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 ruby | |
# Written by Kieran P | |
# http://github.com/KieranP | |
# http://twitter.com/k776 | |
# http://k776.tumblr.com | |
# | |
# Feel free to fork and modify. | |
# If you do, send me a message on | |
# Github details changes and I'll |
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
-------------------------------- | |
| TICKETS THAT CAN BE CLOSED | | |
-------------------------------- | |
-------------------------------- | |
| NEEDS CORE TEAM ATTENTION | | |
-------------------------------- | |
https://rails.lighthouseapp.com/projects/8994/tickets/3424 | |
https://rails.lighthouseapp.com/projects/8995/tickets/47 |
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 create_boot_file | |
if options[:skip_activerecord] | |
copy_file "config/skip_activerecord.rb", "config/boot.rb" | |
else | |
copy_file "config/boot.rb" | |
end | |
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
Usage: script/generate generator [options] [args] | |
Rails Info: | |
-v, --version Show the Rails version number and quit. | |
-h, --help Show this help message and quit. | |
General Options: | |
-p, --pretend Run but do not make any changes. | |
-f, --force Overwrite files that already exist. | |
-s, --skip Skip files that already exist. |
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
List of patches that can be applied straight-away. | |
* The patch adds up support for PostgreSQL case sensitive columns called citex. | |
https://rails.lighthouseapp.com/projects/8994/tickets/3174 | |
* PostgreSQL timestamp with zone type support | |
https://rails.lighthouseapp.com/projects/8994/tickets/3777 | |
* ActiveRecord#touch without validations and add ActiveRecord#touch! with validations | |
https://rails.lighthouseapp.com/projects/8994/tickets/2520 |
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
# rails tryout -m fashioned.rb --skip-activerecord | |
app = File.expand_path(File.join(File.dirname(__FILE__))).split('/').last | |
# This uses Edge Rails for now | |
file 'Gemfile', <<-GEMS | |
source 'http://rubygems.org' | |
gem "rails", :git => "git://github.com/rails/rails.git" | |
gem "mongo_ext" | |
gem "mongo_mapper" |
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
//** Vertical Rhythm **// | |
// By Chris Eppstein and Eric Meyer, living here on a temporary basis | |
// set the default border style for rhythm borders | |
!default_rhythm_border_style = "solid" | |
// The IE font ratio is a fact of life. Deal with it. | |
!ie_font_ratio = 16px / 100% | |
OlderNewer