Skip to content

Instantly share code, notes, and snippets.

View jacobat's full-sized avatar

Jacob Atzen jacobat

  • Copenhagen, Denmark
View GitHub Profile
test "should fail without some param" do
thing = Thing.new(@valid_params.delete[:some_param])
assert !thing.valid?
end
@jacobat
jacobat / build-deb-ruby-1.9.2-p290.sh
Created April 9, 2012 10:02 — forked from jtimberman/gist:881058
i can has ruby-1.9.2 package with fpm
#!/bin/sh
rubyversion=1.9.2-p290
rubysrc=ruby-$rubyversion.tar.bz2
checksum=096758c3e853b839dc980b183227b182
destdir=/tmp/install-$rubyversion
sudo apt-get -y install libssl-dev
gem list -i fpm || sudo gem install fpm
@jacobat
jacobat / random_time.rb
Created August 28, 2012 11:05 — forked from ekampp/random_time.rb
Random time extention
class Date
# Samples a random time
#
# Parameters
# This takes up to three parameters, that is a range of `years`, `months` and
# `days`. Each defining the boundries of the sample date.
#
# Examples
# `Time.random({ years: 1..2 })` will produce a date between one and two