Moved to https://gist.github.com/dkubb/28403
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
describe PostsController do | |
describe "GET index" do | |
subject { get :index } | |
it { should assign_to(:posts).with(Post.all) } | |
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
def tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
- Install stud
$ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
- Download and install the powssl script
$ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl
$ chmod +x ~/bin/powssl
- Run powssl to create development certificate and configure stud.
$ powssl
This runs provides an .optim job for dragonfly and also adds the .optim job into .thumb
This requires you have the 'image_optim' gem and it's dependencies.
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
namespace :jshint do | |
task :require do | |
sh "which jshint" do |ok, res| | |
fail 'Cannot find jshint on $PATH' unless ok | |
end | |
end | |
task :check => 'jshint:require' do | |
project_root = File.expand_path('../../', File.dirname(__FILE__)) | |
config_file = File.join(project_root, 'config', 'jshint.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
# Hook into unicorn, unicorn middleware, not rack middleware | |
# | |
# Since we need no knowledge about the request we can simply | |
# hook unicorn | |
module Middleware::UnicornOobgc | |
MIN_REQUESTS_PER_OOBGC = 5 | |
MAX_DELTAS = 20 |
OlderNewer