Skip to content

Instantly share code, notes, and snippets.

View technicalpickles's full-sized avatar

Josh Nichols technicalpickles

View GitHub Profile
# http://gist.github.com/10524
# Prevents autotest from running your entire test suite after fixing a failed test.
# Works with ZenTest 3.10.0
# Place this in your .autotest file:
require 'rubygems'
require 'active_support'
class Autotest
def run_with_not_rerunning_everything
hook :initialize
describe MakesController do
fixtures :users
integrate_views
describe "index should be visible to" do
# this is a macro that just pumps out three tests: log in anonymous, log in as a user, log in as an admin
it_should_behave_like "check all users"
before do
intervals = []
time = @start_time
while (time < @end_time)
intervals << [time, time.next_interval]
time = time.next_interval
end
## Time ext
class Time
def whack(objects)
objects.inject({}) do |results, o|
results[o.table_name] = o.delete_all
results
end
end
njero - http://neverlet.be
sutto - http://blog.ninjahideout.com
zapnap - http://blog.zerosum.org
tpope - http://tpope.net
reinh - http://reinh.com
bryanl - http://smartic.us
linoj - http://www.vaporbase.com
technicalpickles - http://technicalpickles.com
MaD15 - enlightsolutions.com/
qrush - http://litanyagainstfear.com/
class FilterableEnumerable
def initialize(original)
@original = original
end
def >(value)
@original.select { |v| v > value }
end
def >=(value)
class FilterableEnumerable
def initialize(original)
@original = original
end
def ==(value)
@original.select { |v| v == value }
end
def method_missing(sym, *args, &block)

Boston.rb hackfest, April 7th, 2009

Hello

Dan Croak hacked on hello. Hello is a Ruby interface to a collection of the word “hello” in many languages and dialects. It was written for Flickr-style messages after users sign in to a web application.

Beardo

Nick Quaranto and Mike Burns hacked on beardo. Beardo is a command line interface for Co-op, since some of us are too cool to use the web interface. It uses rest-client as a wrapper around the Co-op API.

Dan Pickett, http://en.oreilly.com/rails2009/profile/46469
Brian Cardarella, http://en.oreilly.com/rails2009/profile/45790
Nick Plante, http://en.oreilly.com/rails2009/profile/2753