Skip to content

Instantly share code, notes, and snippets.

@julian7
julian7 / include-vs-cover-vs-between.rb
Created November 11, 2012 18:09
include? vs. cover? vs. between?
require 'date'
require 'benchmark'
n = 1_000_000
start_date = Date.new(2012, 01, 01)
end_date = Date.new(2012, 03, 01)
act_date = Date.new(2012, 02, 01)
Benchmark.bm(10) do |x|
x.report('include?') do
@paulca
paulca / .ey-example
Created February 20, 2012 22:46
Quick Deploy for Rails 3.1 on Engine Yard Cloud
# Place this file in the root of your project directory
# eg. APPNAME=tito
APPNAME=
# eg. APP_SERVERS=(deploy@app1.tito.io deploy@app2.tito.io)
APP_SERVERS=()
# eg. CACHE_DIRS=(public/cache)
CACHE_DIRS=()
@marcomd
marcomd / gist:1788853
Created February 10, 2012 11:27
ActiveAdmin: Add attributes_table to generic resource
#Add this new method
#activeadmin-0.4.0\lib\active_admin\views\pages\show.rb
#after def attributes_table
def attributes_table_for_resource(specified_resource, *args, &block)
panel(I18n.t('active_admin.details', :model => "#{specified_resource.class.name} #{specified_resource.id}")) do
attributes_table_for specified_resource, *args, &block
end
end