Skip to content

Instantly share code, notes, and snippets.

@cmsd2
cmsd2 / Revision.rb
Created June 17, 2011 09:09
Revision comparison using y combinator
#!/usr/bin/ruby -w
# Revision class
# Designed to function in version comparisons, where the
# version number matches /\d+(\.\d+)*/
# Author: Chris Dawes, Aupeo GmbH <chris@aupeo.com>
# Based on original by: Hugh Sasse, De Montfort University <hgs@dmu.ac.uk>
# And using: http://weblog.raganwald.com/2007/02/guest-blogger-tom-moertel-derives-y.html
def y(&f)
@cmsd2
cmsd2 / gist:995079
Created May 27, 2011 11:33
document.write replacement for jQuery
/*
---
source: http://gist.github.com/995079
based on script for MooTools: http://gist.github.com/133677
provides: document.write
description: jQuery based document.write replacement
requires: jQuery
author: Chris Dawes -- cmsd2@cantab.net