Skip to content

Instantly share code, notes, and snippets.

View fbernier's full-sized avatar
👷‍♂️

François Bernier fbernier

👷‍♂️
View GitHub Profile
# 2. Include Sweeping module in your controller(s) to have cache_sweeper
# method to be avaliable, or right in ApplicationController so it will be
# available in all controllers inheriting from it.
class ApplicationController < ActionController::Base
include ActionController::Caching::Sweeping
# ...
end
@fbernier
fbernier / capybara.md
Created September 14, 2012 00:06 — forked from steveclarke/capybara.md
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@fbernier
fbernier / gist:3682112
Created September 9, 2012 02:18
wtf actor count
require 'celluloid'
class Yo
include Celluloid
end
puts Celluloid::Actor.all.length
@fbernier
fbernier / gist:3307057
Created August 9, 2012 18:48
any reason to break?
require 'celluloid'
class MyClass
include Celluloid
def do_some
'yo'
end
end
a = Myclass.new
@fbernier
fbernier / a.rb
Created July 18, 2012 15:15
difference in execution
trans = Transaction.filter(~{:somecolumn => nil}, :send_time => nil)
trans.each do |t|
# do something
end
require "celluloid"
class MyClass
include Celluloid
def initialize
@a = 0
end
def do_something