Skip to content

Instantly share code, notes, and snippets.

View phildionne's full-sized avatar

Philippe Dionne phildionne

View GitHub Profile
@phildionne
phildionne / cachemire.rb
Last active December 24, 2015 02:09 — forked from plehoux/cachemire.rb
module Cachemire
extend ActiveSupport::Concern
included do
class_attribute :cache_store
end
module ClassMethods
private
@phildionne
phildionne / Gemfile
Last active December 24, 2015 03:29 — forked from stephencelis/minidress.rb
Minidress
source 'https://rubygems.org'
gem 'bundler', '~> 1.3'
gemspec
@phildionne
phildionne / lazy.rb
Last active August 29, 2015 13:56 — forked from fbernier/lazy.rb
# Enumerator#lazy is very slow and should only be used when iterating over large/infinite collections
# where you know you are going to get your results quite early in the iteration.
require 'benchmark/ips'
Benchmark.ips do |r|
r.report("map") do
(0..50).map{ |i| 'lol' if i.even? }
end