This file contains hidden or 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 mongo = require("./mongoHelper").connect("localhost", 27017, "test"); | |
| mongo.collection("collname", function(coll) { | |
| }); |
This file contains hidden or 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 sys = require('sys'); | |
| function request() | |
| { | |
| var host = 'google.com'; | |
| var client = http.createClient(443, host, true); | |
| var request = client.request('GET', '/', | |
| {'host': host}); | |
| request.end(); |
This file contains hidden or 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 redis = require('redis'); | |
| var cli = redis.createClient(); | |
| cli.on('error', function(err) { | |
| console.log('Err:' + err); | |
| }); | |
| function addWorker() { | |
| console.log('adding worker again'); | |
| cli.blpop('nl', 0, function(err, data) { |
This file contains hidden or 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 redis = require('redis'); | |
| var cli = redis.createClient(); | |
| cli.on('error', function(err) { | |
| console.log('Err:' + err); | |
| }); | |
| function addWorker() { | |
| console.log('adding worker again'); | |
| cli.blpop('nl', 0, function(err, data) { |
This file contains hidden or 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
| db.insert({data: 1000}, function(err) { | |
| //do something when inserted | |
| }) | |
| console.log("I don't wait"); | |
This file contains hidden or 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
| info it worked if it ends with ok | |
| verbose cli [ 'node', '/usr/local/bin/npm', 'install', '-g' ] | |
| info using [email protected] | |
| info using [email protected] | |
| verbose config file /home/arunoda/.npmrc | |
| verbose config file /usr/local/etc/npmrc | |
| silly exec /usr/local/bin/node "/usr/local/lib/node_modules/npm/bin/npm-get-uid-gid.js" "nobody" 1000 | |
| silly output from getuid/gid {"uid":65534,"gid":1000} | |
| silly output from getuid/gid | |
| verbose into /usr/local/lib [ '.' ] |
This file contains hidden or 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
| OS: Ubuntu 10.10 | |
| NodeJS: v0.4.10 | |
| RAM: 2GB | |
| Processer: Core 2 Duo 2.0 Ghz |
This file contains hidden or 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
| // Arrays | |
| var aaa = []; | |
| // Stack | |
| var aa = [10]; | |
| aa.push(20); | |
| aa.pop(); //gets 20 |
This file contains hidden or 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
| rake |
This file contains hidden or 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 a() { | |
| "use strict" | |
| function b() { | |
| console.log(arguments.callee.caller); | |
| } | |
| b(); | |
| } | |
| a(); |
OlderNewer