Skip to content

Instantly share code, notes, and snippets.

View nhessler's full-sized avatar

Nathan Hessler nhessler

  • Hessler Consulting
  • Austin, TX
View GitHub Profile
@nhessler
nhessler / torc.rb
Created December 5, 2015 15:07 — forked from JoshCheek/torc.rb
Tail optimized recursive call w/ Nathan at Rubyconf
$depth = 0
at_exit { p depth: $depth }
def record_depth
$depth = caller.length-1 if caller.length-1 > $depth
end
require 'binding_of_caller'
module Torc
def torc(*args)
@nhessler
nhessler / conway.rb
Last active September 21, 2015 14:51 — forked from abachman/conway.rb
An implementation of Conway's Game of Life in Ruby based on Sets
# Conway's Game of Life
# 2015-09-18
# by
# Nathan Hessler https://twitter.com/spune
# Adam Bachman https://twitter.com/abachman
# at Ruby DCamp 2015 http://rubydcamp.org/
# awesome test library
def assert(value)
if !value
require 'sinatra/base'
require 'minitest/autorun'
require 'minitest/spec'
require "rack/test"
require 'nokogiri'
class MyApp < Sinatra::Base
enable :inline_templates
get '/users/:id' do