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
source :gemcutter | |
gem "redis", ">= 2.0.0" | |
group :development do | |
gem "jeweler" | |
gem "git" | |
end | |
group :development, :test, :rails3 do | |
gem "rack" |
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
source :gemcutter | |
group :development do | |
gem "jeweler" | |
gem "git" | |
gem "sqlite3-ruby" | |
end | |
group :test do | |
gem "hanoi" |
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
source :gemcutter | |
gem "sinatra" | |
gem "redis", "2.0.1" | |
gem "dm-core" | |
gem "dm-validations" | |
gem "data_objects" | |
gem "do_sqlite3" | |
gem "eventmachine" |
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
source 'http://rubygems.org' | |
gem 'rails', '2.3.5' | |
gem 'mysql' | |
gem 'authlogic', '2.1.3' | |
gem 'bitly', '0.4.0' | |
gem 'delayed_job' | |
gem 'paperclip', '2.3.1.1' | |
gem 'delayed_paperclip', '0.5.1' |
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
abstract (1.0.0) | |
actionmailer (3.0.0.rc, 3.0.0.beta4, 3.0.0.beta3, 2.3.8, 2.3.5, 2.3.4) | |
actionpack (3.0.0.rc, 3.0.0.beta4, 3.0.0.beta3, 2.3.8, 2.3.5, 2.3.4) | |
activemodel (3.0.0.rc, 3.0.0.beta4, 3.0.0.beta3) | |
activerecord (3.0.0.rc, 3.0.0.beta4, 3.0.0.beta3, 2.3.8, 2.3.5, 2.3.4) | |
activeresource (3.0.0.rc, 3.0.0.beta4, 3.0.0.beta3, 2.3.8, 2.3.5, 2.3.4) | |
activesupport (3.0.0.rc, 3.0.0.beta4, 3.0.0.beta3, 2.3.8, 2.3.5, 2.3.4) | |
addressable (2.1.2) | |
after_commit (1.0.7, 1.0.5) | |
arel (0.4.0, 0.3.3) |
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
ActionController::Base.session = { | |
:key => '123abc', | |
:secret => 'xxx', | |
:key_prefix => 'prefix', | |
:expire_after => 1.hour | |
} | |
ActionController::Base.session_store = :redis_session_store |
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
Capybara.app = Rack::Builder.parse_file(::File.join(Rails.root, 'config.ru')).first |
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
-- Let's say we want to paginate bands, ordered by name. | |
-- | |
-- The main problem with the use of offsets is the waste of loaded records. | |
-- Math: If you want to load the 7th page (30 artists per page) you will load | |
-- 210 records (30 * 7), to just use 30 of them. As you can imagine this is | |
-- more inefficient as the page number grows. | |
-- | |
-- The alternative is to use the order column(s) as condition, in order to | |
-- exclude the already loaded records. | |
-- |
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
# config/initializers/assets.rb | |
AssetsPackager.configure do |config| | |
config.root_path = ::Rails.public_path | |
config.file_path = ::Rails.root.join('config', 'assets.yml') | |
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
#!/usr/bin/env ruby -w | |
require 'benchmark' | |
TIMES = 10_000_000 | |
EMPTY_ARRAY = [ ] | |
FILLED_ARRAY = [ 1 ] | |
Benchmark.bm(30) do |b| | |
b.report "! Array#empty? with empty array" do |