Copyright (c) 2011 Jed Schmidt
a small module for auto-importing modules in node.js.
require( "./autorequire" )
require.auto( <module-name> )
var input = document.getElementById('myfileinput'); | |
var files = input.files; | |
var file = files[i]; | |
var xhr = new XMLHttpRequest(); | |
xhr.open('post', '/path/to/destination', true); | |
xhr.onreadystatechange = function() { | |
if (this.readyState != 4) { return; } | |
// request finished - handle response | |
}; |
curl -d "track=nodejs,tmpvar,jsdom,carena,cider,conductor" http://stream.twitter.com/1/statuses/filter.json -uUSER:PASS 2> /dev/null | json text -C | while read line; do growlnotify -m "$line"; done |
curl -d "track=nodejs,tmpvar,jsdom,carena,cider,conductor" http://stream.twitter.com/1/statuses/filter.json -uUSER:PASS 2> /dev/null | json text -C | while read line; do notify-send -c normal -t 1000 "twitter message" "$line"; done |
function(ks, vs, rr) { | |
// values are discarded by reduce | |
// todo: configurable key function, for complex queries | |
var fk, lk; | |
function uniqCount(keys) { | |
var count = 0, obj = {}; | |
for (var i=0; i < keys.length; i++) { | |
if (!obj[keys[i]]) { | |
count++; | |
obj[keys[i]] = true; |
require.registerExtension('.js', function(js){ | |
return js.replace(/^ *\/\/debug: */gm, ''); | |
}); |
// before | |
mainWindow.menu("File", function(err, file) { | |
if(err) throw err; | |
file.openMenu(function(err, menu) { | |
if(err) throw err; | |
menu.item("Open", function(err, item) { | |
if(err) throw err; | |
item.click(function(err) { | |
if(err) throw err; | |
mainWindow.getChild(type('Window'), function(err, dialog) { |
emulate: | |
emulator -cpu-delay 0 -no-boot-anim -cache ./cache -avd default > /dev/null 2>&1 & # put the avd's chatty ass in the background | |
open /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app | |
palm-emulator --start "SDK 1.4.5.465 (320x480)" |
python -m SimpleHTTPServer | |
By default, SimpleHTTPServer serves on port 8000. To specify a port, use (where 9090 is the port you want): | |
python -m SimpleHTTPServer 9090 | |
And to run it in the background, use: | |
python -m SimpleHTTPServer & |
/Library/Application\ Support/Titanium/sdk/osx/1.1.0/tibuild.py -d ~/tmp -n -t bundle -a /Library/Application\ Support/Titanium/sdk/osx/1.1.0/ ~/Projects/Titanium\ Studio\ Workspace/MyApp |