Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block robesris

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am robesris on github.
  • I am robesris ( on keybase.
  • I have a public key ASD8tCTzCIgBKWExzxm1BDg-izBIODdLB3afCZyo5MKO7Qo

To claim this, I am signing this object:

robesris / Monty Hall
Created Dec 5, 2014
A demo proving the Monty Hall problem, in Ruby
View Monty Hall
TRIES = 1000
successes = 0.0
1.upto(TRIES) do
doors = [:goat, :goat, :goat]
# put a car behind a random door
doors[(rand * 3).to_i] = :car
puts "1: #{doors[0]}"
View gist:a64b8f627abee4550346
2.0.0-p451 :001 > something = "abcdefghijk"
=> "abcdefghijk"
2.0.0-p451 :002 > a=something.sub(/(def)(.*)i/,"#{$1}#{$2}")
=> "abcjk"
2.0.0-p451 :003 > b=something.sub(/(def)(.*)i/,"#{$1}#{$2}")
=> "abcdefghjk"
2.0.0-p451 :004 > a==b
=> false
2.0.0-p451 :005 >
View albums.php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (is_dir($file)) {
echo "<h1>$file</h1>";
$album = opendir($file);
while (false !== ($song = readdir($album))) {
$info = pathinfo($song);
if ($info['extension'] == "mp3" || $info['extension'] == "ogg") {
View pixen_to_gameQuery.rb
module PixenToGameQuery
require 'RMagick'
include Magick
FPR = 12 # Frames per row in a sprite sheet generated by Pixen
COLPAD = 2 # Pix between each column of images on the sprite sheet
ROWPAD = 2 # Pix between each row of images on the sprite sheet
LEFTPAD = 4 # Extra pix on left of sprite sheet
RIGHTPAD = 20 # Extra pix on right of sprite sheet
BOTTOMPAD = 2 # Extra pix on bottom of sprite sheet
View gist:100119
First, rewinding head to replay your work on top of it...
Applying Began setting up request_access feature to use email-spec
Applying Began setting up request_access feature to use email-spec
error: patch failed: app/models/access_request.rb:5
error: app/models/access_request.rb: patch does not apply
error: app/views/user_mailer/request.html.erb: already exists in index
error: db/migrate/20090418013058_create_user_mailers.rb: already exists in index
error: patch failed: features/request_access.feature:24
error: features/request_access.feature: patch does not apply
error: patch failed: features/send_email.feature:3
You can’t perform that action at this time.