Public Gists by cjkihlbom

Gravatar
Mon Sep 28 09:53:56 -0700 2009
1
2
3
StringTemplater with no tokens
- returns blank string if the given string is blank
- returns a non-blank string unchanged
Gravatar
Wed Jan 28 01:09:37 -0800 2009
1
2
3
export PROJDIR="$HOME/Projects"
 
p() {
Gravatar
Fri Dec 05 05:48:14 -0800 2008
1
2
3
path = "/Users/cj/Desktop/prisma.csv"
require 'csv'
CSV.open(path, 'r') do |row|
Gravatar
Thu Aug 28 07:15:59 -0700 2008
1
2
3
def has_children?
  self.class.reflect_on_all_associations(:has_many).map { |a| !send(a.name).empty? }.any?
end
Gravatar
Wed Aug 06 02:22:23 -0700 2008
1
2
3
# by bryan helmkamp with slight modification by chris wanstrath
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow
 
Gravatar
Wed Jul 23 14:46:32 -0700 2008
1
REST/CRUD conventions from http://project.ioni.st/post/2283#snippet_2283