Skip to content

Instantly share code, notes, and snippets.

View cambridgemike's full-sized avatar

Mike Anderson cambridgemike

View GitHub Profile
@cambridgemike
cambridgemike / gist:f925779887fd5417a61c
Last active August 29, 2015 14:10
hosted graphite/statsd performance
require 'benchmark'
require 'hosted_graphite'
HostedGraphite.api_key = 'API-KEY'
HostedGraphite.protocol = HostedGraphite::UDP
require 'hosted_graphite/statsd'
def do_single
HostedGraphite.increment "benchmark.incrementer"
@cambridgemike
cambridgemike / paper_trail_assoc.rb
Created August 27, 2011 19:09
example usage of paper_trail
# Parent class
class bookshelf
has_many :books
has_paper_trail
end
# Child class
class book
belongs_to :bookshelf
has_paper_trail