Copyright (c) 2011 Jed Schmidt
a small module for auto-importing modules in node.js.
require( "./autorequire" )
require.auto( <module-name> )
Traceback (most recent call last): | |
File "flickrtouchr/flickrtouchr.py", line 368, in <module> | |
inodes[photoid] = getphoto(imgurl, target) | |
File "flickrtouchr/flickrtouchr.py", line 170, in getphoto | |
fh = open(filename, "w") | |
IOError: [Errno 2] No such file or directory: u"japan '09/20091002220101-3975078266_o-vanilla ice cream w/ coffee @ sushi sen, nishi azabu.jpg" |
// objective: a function for generating guids of unique entities | |
// usage: guid( obj ) => integer | |
// approach 1 | |
// entities kept in a hash array, key id found by iteration | |
// pros: | |
// (1) unobtrusive; doesn't pollute objects with expandos | |
// (2) ids can't be accidentally deleted/changed | |
// (3) ids can be assigned to any type of object |
var guid = { | |
// uses an expando to store the id on the object | |
// wicked fast, but not reliable without DOM hackery (see jQuery source) | |
"expando": function( last ) { | |
return function guid( obj ) { | |
if ( obj ) { | |
if ( obj.guid ) return obj.guid | |
obj.guid = last | |
Checking for program g++ or c++ : /usr/bin/g++ | |
Checking for program cpp : /usr/bin/cpp | |
Checking for program ar : /usr/bin/ar | |
Checking for program ranlib : /usr/bin/ranlib | |
Checking for g++ : ok | |
Checking for program gcc or cc : /usr/bin/gcc | |
Checking for gcc : ok | |
Traceback (most recent call last): | |
File "/Users/jed/desktop/node/tools/waf-light", line 158, in <module> | |
Scripting.prepare(t, cwd, VERSION, wafdir) |
var domReady = !document.readyState && document.addEventListener | |
? function( fn ){ document.addEventListener( "domContentLoaded", fn ) } | |
: function( fn ){ setTimeout( /in/( document.readyState ) ? function(){ domReady( fn ) }, 50 ) : fn ) } |
curl -N localhost:8080 |
var http = require( "http" ) | |
, url = require( "url" ) | |
, exec = require( "child_process" ).exec | |
, username = process.argv[ 2 ] | |
, seconds = +process.argv[ 3 ] || 300 | |
, friends | |
, events = {} | |
if ( !username ) { |
var getVars = function( dummy, err, re ) { | |
try { eval( dummy ) } catch( e ) { err += e } | |
re = new RegExp( "^" + err.replace( dummy, "(\\w+)" ) + "$" ) | |
return function( code ) { | |
var args = [] | |
, name | |
while ( 1 ) { |
this is a (fab) experiment i've been toying with. it's a bookmarklet that serializes the DOM on the current page to (fab) code. the idea is to eventually be able to slurp out an existing page into static code, and then slowly start to introduce dynamic behavior using (fab).
to try it, create a bookmarklet with this source:
javascript:with(document)(body.appendChild(createElement('script')).src='https://gist.github.com/raw/913050/5e6c66b14256c12d4842945768e9351b1b798a27/index.js?'+Date.now())._
use with care, because it'll overwrite the current page contents. i think it'd be nice to use github's oauth support to save it in a gist.