Skip to content

Instantly share code, notes, and snippets.

@davertron
davertron / webapp.rb
Created November 17, 2010 00:28 — forked from igrigorik/webapp.rb
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
#!/bin/bash
set -x
# Make a new git bare repo
mkdir repo
cd repo
git init --bare
<html>
<head>
<script type="text/javascript">
// The purpose of this function is to draw a div inside another div
// at half dimensions (sort of like looking at a mirror in another
// mirror...
function turtles_all_the_way_down(previous_div, level, max_level){
if(level == max_level){
return;
}