Skip to content

Instantly share code, notes, and snippets.

View omnikron's full-sized avatar
🐋
💨

Oli Barnett omnikron

🐋
💨
  • DE-NRW
  • 20:32 (UTC +02:00)
View GitHub Profile
@omnikron
omnikron / Bill.rb
Last active December 16, 2015 03:39
For recurring billing.
# Calculates billable day-of-month numbers at the end
# of a month with fewer than 31 days.
#
# eg. billable_days Date.new(2012, 02, 29) => 29, 30, 31
#
def billable_days(date = Date.today)
if date.day == date.end_of_month.day
(date.day..31)
else
date.day
@omnikron
omnikron / commit-msg
Created January 18, 2012 10:39 — forked from henrik/commit-msg
# Outdated, view updated version at https://github.com/omnikron/stagecoach/tree/master/lib/githooks # Git commit-msg hook that works in tandem with the redmine_stagecoach gem to automatically add your branch's associated github issue number to your commit
#!/usr/bin/env ruby
#
# Git commit-msg hook adapted from Henrik Nyh's <http://henrik.nyh.se> original version
# <https://gist.github.com/184711>
#
# Works in tandem with the redmine_stagecoach gem to automatically add your
# branch's associated github issue number to your commit message.
#
# If you include "#noref" in the commit message, nothing will be added to
# the commit message, and the "#noref" itself will be stripped.