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 http = require('http') | |
var config = { | |
host: '127.0.0.1', | |
port: 20202 | |
} | |
http.createServer(function (i,o) { | |
o.writeHead(200, { | |
'Content-Type': 'text/plain' |
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
/* | |
* This file is part of the Spludo Framework. | |
* Copyright (c) 2009-2010 DracoBlue, http://dracoblue.net/ | |
* | |
* Licensed under the terms of MIT License. For the full copyright and license | |
* information, please see the LICENSE file in the root folder. | |
*/ | |
/* | |
* based on https://github.com/DracoBlue/spludo/blob/master/build/run_dev_server.js |
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
GridStore.prototype.getStream = function() { | |
var self = this; | |
var stream = new (require("stream")).Stream; | |
stream.readable = true; | |
process.nextTick(function() { | |
self.chunkCollection(function(err, collection) { | |
collection.find({'files_id':self.fileId}, function(err, cursor) { | |
function handleChunk(err, chunk) { | |
if (chunk) { |
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 complete(x,value) { | |
var values = arguments.callee.values; | |
values[x] = value; | |
if (++arguments.callee.completed < 2) return; | |
// do whatever with values | |
} | |
asyncOp("foo", function(err,data) { complete("foo",data); }) | |
asyncOp("bar", function(err,data) { complete("bar",data); }) |
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 waiter = new Waiter | |
var onlineUsers = waiter(function(done) { // done takes two arguments: (error, value) | |
// ... blah blah blah ... | |
done(err,value) | |
// ... blah ... | |
} | |
var latestPosts = waiter(function(done) { | |
// ... blah ... | |
// many async functions will accept 'done' as is | |
// ... |
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/local/bin/node mongolian_trainer.js | |
Connecting to mongo://127.0.0.1:27017 | |
Connected to mongo://127.0.0.1:27017 | |
mongo://127.0.0.1:27017/mongolian_trainer.small count = 50 | |
mongo://127.0.0.1:27017/mongolian_trainer.medium count = 500 | |
mongo://127.0.0.1:27017/mongolian_trainer.large count = 50000 | |
db names: [ 'casbah_test', | |
'casbahTest', | |
'mapper_test', | |
'mongolian_trainer', |
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
[ | |
{ | |
"name": "ace", | |
"url": "https://github.com/ajaxorg/ace", | |
"description": "Ajax.org Cloud9 Editor", | |
"watchers": 415, | |
"forks": 84 | |
}, | |
{ | |
"name": "actor", |
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
Top 50 githubbed npm modules by watchers: | |
1. cloud9 1349 watchers - https://github.com/ajaxorg/cloud9 | |
2. socket.io 1089 watchers - https://github.com/LearnBoost/Socket.IO-node | |
3. dryice 956 watchers - https://github.com/isaacs/npm | |
4. npm 956 watchers - https://github.com/isaacs/npm | |
5. connect 948 watchers - https://github.com/senchalabs/connect | |
6. yui3-mocha 931 watchers - https://github.com/yui/yui3 | |
7. yui3-core 931 watchers - https://github.com/yui/yui3 | |
8. ukijs 663 watchers - https://github.com/voloko/uki | |
9. fab 539 watchers - https://github.com/jed/fab |
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
ace KEYWORD DEATHMATCH | |
1. ace 829 score - https://github.com/ajaxorg/ace | |
2. vice 8 score - https://github.com/Gozala/vice | |
amazon KEYWORD DEATHMATCH | |
1. aws-lib 105 score - https://github.com/mirkok/aws-lib | |
2. simpledb 14 score - https://github.com/rjrodger/simpledb | |
3. aws 2 score - https://github.com/teemow/node-aws | |
apache KEYWORD DEATHMATCH |
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 fs = require("fs") | |
var sprintf = require('sprintf').sprintf | |
fs.readFile(__dirname+"/npmdump.json", function (err, data) { | |
if (err) throw err | |
var packages = JSON.parse(data) | |
fs.readFile("../output.json", function (err, data) { | |
if (err) throw err |
OlderNewer