Skip to content

Instantly share code, notes, and snippets.

View srabuini's full-sized avatar

Sebastian Rabuini srabuini

View GitHub Profile

Keybase proof

I hereby claim:

  • I am srabuini on github.
  • I am naitsabes (https://keybase.io/naitsabes) on keybase.
  • I have a public key ASB-9-9MGlwX1BgPPgdwTeG_NZn7lnQe5eZ6WA-G2ftgFQo

To claim this, I am signing this object:

@srabuini
srabuini / scrambler.rb
Created April 14, 2019 04:31
Generates a formula to scramble a Rubik's cube
#!/usr/bin/env ruby
module Scrambler
FACES = %w[B L D R U F].freeze
def self.run(steps)
directions = []
faces = []
steps.times do
@srabuini
srabuini / app.rb
Last active December 29, 2015 11:03
class App
REQUEST_METHOD = 'REQUEST_METHOD'.freeze
PATH_INFO = 'PATH_INFO'.freeze
attr_reader :env
def initialize(routes)
@routes = routes
@h = Hart.new(@routes)
end
class WestheimerRule
UNITS = %i(seconds minutes hours days weeks months years lustra decades
centuries millennniums)
def initialize(time:, unit:)
@time = time
@unit = unit
end
def estimate
@srabuini
srabuini / bitcoin.md
Created December 1, 2013 06:43
Bitcoin intro & notes
@srabuini
srabuini / gist:4050005
Created November 10, 2012 05:11
Move elements a number (positive or negative) of steps and return it
class Array
def move(steps)
(steps % size).times { self << shift }; return self
end
end