rails

Git Video - Supplementing Github Commits with Video!

Ever come back to a project and completely forget how all the pieces fit together? Supplement your commits with Git Video.

image

That half-sentence you throw into the commit message usually does no help when you have walked away from a project for more than a day. Projects take major evolutions— architecture, ideologies, and approaches to problems are constantly changing, and documenting them becomes hard. A short video connected to each commit on Github is perfect, and lets you use gestures, inflection, and visuals to help you remember what state the project is in at that point in time.

image

Doing this once a day will help you battle that incessant, twenty-minute, “back into the groove” you usually have to entertain when switching between projects. It was created in a night on Rails, uses Github’s API, designed with Bootstrap, launched on Heroku, monitored with New Relic, and relies on Nimbb for the video embedding. Special thanks to the team over at Nimbb for sponsoring this project with some free video space. A company willing to go out of the way for independent developers deserves a look— so check them out.

A Better time_ago_in_words for Ruby on Rails

def time_ago time, append = ' ago'
  return time_ago_in_words(time).gsub(/about|less than|almost|over/, '').strip << append
end

I love the time_ago_in_words method that comes bundled with rails, but it often produces a pretty lengthy string that doesn’t fit on narrow columns, or mobile views. This is a simple fix I use, placed in “helpers/application_helper.rb”.

time_ago(Time.now)
#a minute ago

time_ago(5.minutes.from_now)
#5 minutes ago

time_ago(Time.now - 20.years, '!')
#20 years!