Skip to content

Instantly share code, notes, and snippets.

View jed's full-sized avatar

Jed Schmidt jed

View GitHub Profile
var http = require( "http" )
, puts = require( "sys" ).puts
, str = "?token=xxx&apiKey=xxx"
, request = http
.createClient( 80, "rpxnow.com", true )
.request( "POST", "/api/v2/auth_info", {
host: "rpxnow.com",
"content-length": str.length
});
var x = get;
// just an idea for now
with( fab = require( "fab" ) )
with( fab.html )
module.exports = fab
()
( /^\// )
with ( require( "fab" ) )
( fab )
( require )
( "html" )
( "nodejs" )
( "googleAnalytics" )
()
( globalize, html )
fab = require( "fab" );
appCount = 79353;
with ( fab )
( fab )
( import, html )
( listen, 0xFAB )
( route, /^\/$/ )
require("url").parse("//google.com");
// { href: '//google.com'
// , pathname: '//google.com'
// }
()
var max = 1000000
, fn = function fn(a,b,c,d,e){}
, jedTime
, higginsTime
, t = new Date;
for ( var i = max; i--; ) schmidt( fn );
jedTime = new Date - t;
t = new Date;
@jed
jed / clever_vs_clearer.js
Created October 27, 2010 08:29
is this code worth the 5 byte savings?
{1:"createElement",2:"createAttribute",3:"createTextNode",8:"createComment",11:"createDocumentFragment"}
",Element,Attribute,TextNode,,,,,Comment,,,DocumentFragment".replace(/\b\w/g,"create$&").split(",")
@jed
jed / invert.js
Created October 27, 2010 08:41
each, extend, and map in one function
function invert( index, fn ) {
var key = index.length, val
if ( key > 0 ) while ( key-- ) this[ val = index[ key ] ] = fn ? fn( val, key ) : key
else for ( key in index ) this[ val = index[ key ] ] = fn ? fn( val, key ) : key
return this
}