Skip to content

Instantly share code, notes, and snippets.

View tylerhunt's full-sized avatar

Tyler Hunt tylerhunt

View GitHub Profile
require 'bundler/setup'
require 'sinatra/base'
require 'rack/contrib'
# The project root directory
$root = ::File.dirname(__FILE__)
class SinatraStaticServer < Sinatra::Base
get(/.+/) do
@tylerhunt
tylerhunt / cunt_catcher.rb
Created October 31, 2011 23:17 — forked from r38y/cunt.rb
Help prevent typos
module CuntCatcher
def cunt
warn "I'm guessing you meant 'count'?"
count
end
end
class Object
include CuntCatcher
end
def render_once options = nil, extra_options = {}, &block
@rendered_once ||= []
args = [options, extra_options]
return '' if @rendered_once.include?(args.hash)
@rendered_once << args.hash
render options, extra_options, &block
end