Skip to content

Instantly share code, notes, and snippets.

View tommeier's full-sized avatar

Tom Meier tommeier

View GitHub Profile
# Improve / Fix as many things in the code below
# Answers should be sent to hackademy@500tech.com
# Good luck
class User < ActiveRecord::Base
validates_presence_of :name, :email, :date_of_birth, :age_category
before_save do
age = (Time.now - date_of_birth).year
if age < 10 age_category = 'child'
@tommeier
tommeier / upgrade_postgres_9.0.4-9.1.4.sh
Created July 17, 2012 04:35 — forked from databyte/upgrade_postgres_9.0-9.1.sh
Upgrade PostgreSQL from 9.0.4 to 9.1.4
#!/bin/sh
#
# Upgrade PostgreSQL from 9.0.4 to 9.1.4 via HomeBrew on Mac OSX
#
# by David Sommers (tweaked by me)
#
brew update
brew update postgres
@tommeier
tommeier / some_spec.rb
Created April 17, 2012 01:45 — forked from myronmarston/some_spec.rb
VCR with placeholders
use_vcr_cassette 'some/cassette', :tag => :bad_staging_api
#!/usr/bin/env ruby
require 'rubygems'
require 'yaml'
if ARGV.size < 1
puts "Usage: github-test.rb my-project.gemspec"
exit
end
require 'rubygems/specification'