Skip to content

Instantly share code, notes, and snippets.

View asifkalam's full-sized avatar

Asif S Kalam asifkalam

  • C42 Engineering
  • Bangalore
View GitHub Profile
[2013-06-28 19:53:21] TRACE Adhearsion::Initializer: OS: darwin12.3.0 - RUBY: ruby 2.0.0
[2013-06-28 19:53:21] TRACE Adhearsion::Initializer: Environment: {"RBENV_VERSION"=>"2.0.0-p195", "GREP_COLOR"=>"1;32", "TERM_PROGRAM"=>"iTerm.app", "TERM"=>"xterm", "SHELL"=>"/bin/zsh", "TMPDIR"=>"/var/folders/6d/rggbszv10c710lms077b3tk40000gn/T/", "Apple_PubSub_Socket_Render"=>"/tmp/launch-rs8ITb/Render", "USER"=>"asif", "COMMAND_MODE"=>"unix2003", "RBENV_ROOT"=>"/usr/local/opt/rbenv", "SSH_AUTH_SOCK"=>"/tmp/launch-BsOIPN/Listeners", "GEMFURY_URL"=>"https://[email protected]/me/", "__CF_USER_TEXT_ENCODING"=>"0x1F5:0:0", "Apple_Ubiquity_Message"=>"/tmp/launch-ol0qMT/Apple_Ubiquity_Message", "PAGER"=>"less", "RBENV_HOOK_PATH"=>":/usr/local/opt/rbenv/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks:/usr/local/opt/rbenv/plugins/rbenv-readline/etc/rbenv.d", "LSCOLORS"=>"Gxfxcxdxbxegedabagacad", "PATH"=>"/usr/local/opt/rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/bin:/usr/local/opt/rbenv/versio
@asifkalam
asifkalam / timespan_in_words.rb
Created July 21, 2011 11:26
timespan_in_words - poor cousin of distance_of_time_in_words
module TimespanInWords
METRICS = [
{ :unit => :second, :to_next => 60 },
{ :unit => :minute, :to_next => 60 },
{ :unit => :hour, :to_next => 24 },
{ :unit => :day, :to_next => 7 },
{ :unit => :week, :to_next => 4 },
{ :unit => :month, :to_next => 12 },
{ :unit => :year, :to_next => 1 },
]