Skip to content

Instantly share code, notes, and snippets.

View dsturnbull's full-sized avatar

David Turnbull dsturnbull

View GitHub Profile
#!/usr/bin/env bash
function serve() {
ruby -rwebrick <<-EOM
server = WEBrick::HTTPServer.new({
:Port => 1234,
:DocumentRoot => File.expand_path('$1'),
:MimeTypes => WEBrick::HTTPUtils::load_mime_types('/etc/apache2/mime.types')
})
trap("INT"){ server.shutdown }