Skip to content

Instantly share code, notes, and snippets.

@cambridgemike
cambridgemike / paper_trail_assoc.rb
Created Aug 27, 2011
example usage of paper_trail
View paper_trail_assoc.rb
# Parent class
class bookshelf
has_many :books
has_paper_trail
end
# Child class
class book
belongs_to :bookshelf
has_paper_trail
@cambridgemike
cambridgemike / gist:f925779887fd5417a61c
Last active Aug 29, 2015
hosted graphite/statsd performance
View gist:f925779887fd5417a61c
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"