Skip to content

Instantly share code, notes, and snippets.

View technicalpickles's full-sized avatar

Josh Nichols technicalpickles

View GitHub Profile
[alias]
up = !sh -c 'git pull && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..'
down = !sh -c 'open http://www.youtube.com/watch?v=qchPLaiKocI'
some_variable = if some_condition?
some_value
else
another_value
end
22 task :spec => [ "spec:default", "spec:job_specs" ]
23
24 namespace :spec do
25
26 desc 'This will run all of the specs for the jobs... if you have permission'
30 Spec::Rake::SpecTask.new(:job_specs) do |t|
31 >---t.spec_files = FileList['jobs/spec/**/*_spec.rb']
32 >---t.spec_opts = ['--options', 'jobs/spec/spec.opts']
33 end
40 end
Spec::Matchers.define :include_module do |mod|
match do |instance|
mod.instance_methods.inject(true) { |accum, method| accum && instance.respond_to?(method) }
end
failure_message_for_should do |instance|
"expected the class #{instance.class.name} to include the module #{mod}"
end
failure_message_for_should_not do |instance|
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

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.

class FilterableEnumerable
def initialize(original)
@original = original
end
def ==(value)
@original.select { |v| v == value }
end
def method_missing(sym, *args, &block)
class FilterableEnumerable
def initialize(original)
@original = original
end
def >(value)
@original.select { |v| v > value }
end
def >=(value)
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/