This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
request = require('request'), | |
BufferList = require('bufferlist').BufferList, | |
sys = require('sys'); | |
var app = express.createServer( | |
express.logger(), | |
express.bodyDecoder() | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var argv = require('optimist') | |
.usage('Usage: --key=[consumer key] -secret=[consumer secret]') | |
.demand(['key', 'secret']) | |
.argv | |
; | |
var OAuth = require('oauth').OAuth; | |
var Step = require('step'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var sys = require('sys'); | |
var oauth = require('oauth'); | |
var app = express.createServer(); | |
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY"; | |
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET"; | |
function consumer() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = tree | |
tree.sync = treeSync | |
var fs = require("fs") | |
, path = require("path") | |
function tree (root, cb) { | |
fs.lstat(root, function (er, s) { | |
if (er) return cb(er) | |
s.name = root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The back of the card is rotated 180 degrees from the card itself, giving | |
the illusion that it really is the back! Unfortunately hiding the back | |
face of both "faces" doesn't work with webkit builds (requires Snow Leopard!) | |
but we set it anyway. | |
*/ | |
.card #back { -webkit-transform: rotateY(180deg); } | |
.card .face { -webkit-backface-visibility: hidden; } | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}; |