Skip to content

Instantly share code, notes, and snippets.

View dvgica's full-sized avatar

David van Geest dvgica

View GitHub Profile

Keybase proof

I hereby claim:

  • I am DWvanGeest on github.
  • I am dwvangeest (https://keybase.io/dwvangeest) on keybase.
  • I have a public key whose fingerprint is 8E15 3812 85DF 6DDE BB69 C886 AF07 12E3 E027 D5D5

To claim this, I am signing this object:

@dvgica
dvgica / coverage.rake
Created November 4, 2011 20:58
Rake tasks for running your Rails tests with Rcov
# modified from original by Tim Su at http://www.betaful.com/2010/11/rails-3-rcov-test-coverage/
# place this in lib/tasks/
namespace :coverage do
task :clean do
rm_rf "test/coverage"
rm_f "test/coverage.data"
Rcov = "rcov --rails --aggregate coverage.data -Ilib \
@dvgica
dvgica / am_pm_time_select.rb
Created November 4, 2011 18:41
Initializer to add am/pm support to time_select helpers in Rails 3 (3.1 has an option, use it!)
# modified from Bruno Miranda's original found here: http://brunomiranda.com/past/2007/6/2/displaying_12_hour_style_time_select/
# usage: <%= form.time_select :the_time, { :twelve_hour => true } %>
module ActionView
module Helpers
class DateTimeSelector
def select_hour_with_twelve_hour_time
datetime = @datetime
options = @options