Tint

This is a handwritten mock up of what happens when syntax highlighting meets responsive design (word wrap). Try bumping up the font size, squashing the browser window, or viewing this page on a mobile device.

require 'net/http'
require 'nokogiri'
 
class Fetcher
def initialize(uri)
@http = Net::HTTP.new(uri.hostname, uri.port)
end
 
def finish
@http.finish
end
 
def get(path)
# prepare a get request
req = Net::HTTP::Get.new(path)
# look like Safari:
req['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14'
res = @http.request(req)
status = res.code.to_i
 
if status == 200
[Nokogiri::HTML(res.body), status]
else
[nil, status]
end
end
end
 
fetcher = Fetcher.new(URI('http://dowebsitesneedtolookexactlythesameineverybrowser.com/'))
fetcher.get('/')

This colour theme is based on Ethan Schoonover's Solarized. The font is Inconsolata.

I would love to see something like this in Pygments and CodeRay.