Skip to content

Instantly share code, notes, and snippets.

View jed's full-sized avatar

Jed Schmidt jed

View GitHub Profile
require( "fab" )
( "hello, {{1}}!" )
( "world" )
[ "call" ]
( function( app ) { module.exports = app } )

an update on fab v0.5

hey all, sorry for the lack of pushes this past week, but i'm still chugging on the v0.5 branch locally. here's an update of two changes i've made.

removed dependence on function length

this was a bit of a hard decision to make, but i've decided to stop using the function length property to differentiate unary apps from n-ary apps. it was a cute hack, but it needs to go for two reasons:

  • the google closure compiler doesn't respect argument count during compression. it removes any unused trailing arguments, which can end up changing the length of a function. this isn't too important now, but will be once (fab) starts moving client-ward.
e0109-119-107-225-189:cookie-node jed$ sudo npm install .
npm configfile /Users/jed/.npmrc
npm sudo true
npm cli [ 'install', '.' ]
npm install pkg .
npm install local .
npm readJson package.json
npm testEngine required: node ""
npm packTar . /Users/jed/.node_libraries/.npm/.cache/cookie/v0.1.0/package.tgz
npm exec tar "czf" "/Users/jed/.node_libraries/.npm/.cache/cookie/v0.1.0/package.tgz" "--exclude" ".git" "cookie-node"
puts = require( "sys" ).puts;
puts( "puts" );
puts( "puts" );
puts( "puts" );
require( "repl" ).start();
puts( "puts" );
puts( "puts" );
var body = "Hello World"
, http = require( "http" )
, puts = require( "sys" ).puts
, connect = require( "./Connect/lib/connect" )
, jsgiNode = require( "./jsgi-node" )
, fab = require( "fab_old" )
, connectMiddleware = {
var puts = require( "sys" ).puts
, contextFn = function( a ){ return a && this() }
, argFn = function( a, b ){ return b && a() }
, time;
time = +new Date;
for ( var i = 0; i < 10e6; i++ ) contextFn.call( contextFn, contextFn );
puts( "as context: " + ( +new Date - time ) );
time = +new Date;
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 )