Skip to content

Instantly share code, notes, and snippets.

@pcreux
pcreux / delegate_matcher.rb
Created December 1, 2011 11:47 — forked from txus/delegate_matcher.rb
RSpec matcher for delegations
# RSpec matcher to spec delegations.
#
# Usage:
#
# describe Post do
# it { should delegate(:title).to(:name) } # post.title => post.name
# it { should delegate(:month).to(:created_at) } # post.month => post.created_at
# it { should delegate(:author_name).to(:author, :name) } # post.author_name => post.author.name
# end
#!/usr/bin/env ruby
require 'csv'
require 'date'
CSV::Reader.parse(File.open(ARGV[0])) do |row|
date = row[0].match(/^\d{4}-\d{2}-\d{2}/) ? Date.strptime(row[0], "%Y-%m-%d") : row[0]
hours = row[2]
memo = "#{row[3]} #{row[4]}"
puts "#{date} | #{hours} | #{memo}"
end
@pcreux
pcreux / chpwd_update_git_vars.sh
Created November 30, 2009 18:13 — forked from scelis/chpwd_update_git_vars.sh
Zsh prompt with git status
update_current_git_vars