This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |