Skip to content

Instantly share code, notes, and snippets.

#
# Start a WEBrick server in the cwd (serves html, rhtml, assets)
#
# Usage:
# webrick_on
# webrick_on 8000
#
function webrick_on
{
ruby -e "require 'webrick';include WEBrick;s = HTTPServer.new(:Port => ${@:-9090},:DocumentRoot => Dir::pwd);trap('INT'){s.shutdown};s.start"
#!/usr/bin/env ruby -w
# delicious2yojimbo.rb by Ben Kerney, ben.kerney@gmail.com
# Based on delicious2yojimbo.pl by Marcus Kazmierczak, marcus@mkaz.com
# and Manton Reece, http://www.manton.org/, which, when I downloaded it on
# 2009-05-16, was not working for me.
# Rather than troubleshoot, I rewrote it in Ruby.
@bak
bak / gist:27806
Created November 22, 2008 11:26
Drew McLellan's bookmarklet to insert any png into the DOM of a site as an apple-touch-icon
javascript:var%20links=document.getElementsByTagName('head')[0].getElementsByTagName('link');for(var%20i=0;i%3Clinks.length;i++){if(links[i].getAttribute('rel')=='apple-touch-icon'){links[i].parentNode.removeChild(links[i])}; break;};var%20s=document.createElement('link');s.setAttribute('rel', 'apple-touch-icon');s.setAttribute('href',prompt('Touch icon URL?','http://'));document.getElementsByTagName('head')%5B0%5D.appendChild(s);void(s);
@bak
bak / reset.sass
Created October 22, 2008 06:27
Eric Meyer's reset.css expressed in sass
// http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded
// Copyright 1995-2007 Eric A. and Kathryn S. Meyer
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,