This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extend jQuery objects with Underscore collection methods. | |
# | |
# Each collection method comes in two flavors: one prefixed | |
# with _, which yields a bare DOM element, and one prefixed | |
# with $, which yields a jQuery-wrapped element. | |
# | |
# So if `this` is a jQuery object, instead of: | |
# | |
# _.max @, (el) -> $(el).height() | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :gemcutter | |
gem 'goliath', :git => 'git://github.com/postrank-labs/goliath.git' | |
gem 'em-synchrony', :git => 'git://github.com/igrigorik/em-synchrony.git' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'em-http' | |
EM.run do | |
def dispatch(uri, retries = 0) | |
h = EM::HttpRequest.new(uri).get | |
h.callback { |rep| [:success, rep.response]; EM.stop } | |
h.errback do |rep| | |
p [:fail, rep] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe LeadService do | |
LeadService.configure(:test) do | |
before { settings.set(:instance, self) } | |
end | |
# Required for Rack::Test | |
# | |
def app | |
LeadService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# by Eric Lindvall <eric@5stops.com> | |
# | |
class LruGenerationalHash | |
attr_reader :max_size | |
def initialize(max_size, generations = 2) | |
@generations = generations.times.collect { Hash.new } | |
@max_size = max_size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Provide data over STDIN to Instrumental | |
# Format of data: | |
# <metric name> <value> <unix timestamp> | |
# or | |
# <metric name> <value> | |
# | |
# Second form will assume that the time the | |
# metric is reported is when the event occurred. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rbczmq' | |
require 'fileutils' | |
require 'celluloid' | |
class Heartbeat | |
include Celluloid | |
def self.start(id = nil, options = nil) | |
new(ZMQ::Context.new, id, options) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Created by Eric Lindvall <eric@sevenscale.com> | |
# | |
class KestrelMonitor < Scout::Plugin | |
OPTIONS=<<-EOS | |
host: | |
label: Host | |
notes: Kestrel host | |
default: localhost | |
port: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Annotate your "bundle outdated" with GitHub compare URLs | |
# | |
require 'open-uri' | |
require 'json' | |
def rubygems_gem_info(gem_name) |
OlderNewer