Skip to content

Instantly share code, notes, and snippets.

View omnikron's full-sized avatar
🐋
💨

Oli Barnett omnikron

🐋
💨
  • DE-NRW
  • 16:32 (UTC +02:00)
View GitHub Profile
@omnikron
omnikron / oli.rb
Last active August 29, 2015 13:56 — forked from bjjb/monty.rb
#!/usr/bin/env ruby
# Monty Hall problem proof http://en.wikipedia.org/wiki/Monty_Hall_problem
module Monty
PLAYERS_WITH_POLICY = { jimmy: :switch, jasper: :stick, johnson: :random }
DOORS = [:goat, :goat, :ferrari]
COUNT = Integer(ARGV[0] || 100000)
class << self
def win?(policy)
doors = DOORS.dup.shuffle
@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.