Skip to content

Instantly share code, notes, and snippets.

@comfuture
comfuture / ajaxize.js
Created September 16, 2010 11:31
ajaxize.js
function ajaxize(selector) {
$(selector).each(function(idx, el) {
el = $(el);
var opts = (el.attr('rel') || '').split(' ');
var hasOption = function(opt) { return opts.indexOf(opt) > -1 }
var pos = hasOption('before') ? 'Before' : 'After';
var toggle = hasOption('toggle');
var increase = hasOption('increase');
var inherit = hasOption('inherit');
var target_name = el.attr('target');
@comfuture
comfuture / hello.js
Created September 10, 2010 13:56
nano framework for node.js
with (require('./nano')) {
get('/hello', 'Hello, world');
get('/index.html', readfile('index.html'));
static_file('/about.html');
get('/bye', function() {
return 'Bye~ ' + request.args['name'];
});