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
➜ sigar git:(master) sudo node-gyp configure | |
gyp info it worked if it ends with ok | |
gyp info using [email protected] | |
gyp info using [email protected] | darwin | x64 | |
gyp info spawn python | |
gyp info spawn args [ '/Users/shripadk/.node-gyp/0.8.14/tools/gyp/gyp', | |
gyp info spawn args 'binding.gyp', | |
gyp info spawn args '-f', | |
gyp info spawn args 'make', | |
gyp info spawn args '-I', |
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
➜ test sudo npm install test-sigar-gyp --verbose | |
npm info it worked if it ends with ok | |
npm verb cli [ '/Users/shripadk/node/bin/node', | |
npm verb cli '/Users/shripadk/node/bin/npm', | |
npm verb cli 'install', | |
npm verb cli 'test-sigar-gyp', | |
npm verb cli '--verbose' ] | |
npm info using [email protected] | |
npm info using [email protected] | |
npm verb read json /Users/shripadk/Test/package.json |
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
{ | |
'targets': [ | |
{ | |
'target_name': 'sigar', | |
'conditions': [ | |
['OS=="win"', { | |
'build': '<!(echo windows))' | |
}, { | |
'build': '<!(sudo cp -rp <(module_root_dir)/deps/sigar <(module_root_dir)/build/sigar && cd <(module_root_dir)/build/sigar && sudo ./autogen.sh && sudo ./configure --prefix=<(module_root_dir)/build/Release --with-pic && sudo make && sudo make install))', | |
'sources': ['src/node_sigar.cc'], |
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
{ | |
'targets': [ | |
{ | |
'target_name': 'sigar', | |
'conditions': [ | |
['OS=="win"', { | |
'build': '<!(echo windows))' | |
}, { | |
'build': '<!(sudo cp -rp <(module_root_dir)/deps/sigar <(module_root_dir)/build/sigar && cd <(module_root_dir)/build/sigar && ./autogen.sh && ./configure --prefix=<(module_root_dir)/build/Release --with-pic && make && make install))', | |
'sources': ['src/node_sigar.cc'], |
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
Manager.prototype.initStore = function () { | |
this.handshaken = {}; | |
this.connected = {}; | |
this.open = {}; | |
this.closed = {}; | |
this.rooms = {}; | |
this.roomClients = {}; | |
var self = this; |
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
Transport.prototype.end = function (reason) { | |
if (!this.disconnected) { | |
this.log.info('transport end (' + reason + ')'); | |
var local = this.manager.transports[this.id]; | |
this.close(); | |
this.clearTimeouts(); | |
this.disconnected = true; |
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 Route = function(pattern, callback) { | |
this.pattern = pattern; | |
this.callback = callback; | |
}; | |
Route.prototype.matches = function(url) { | |
var params = {}; | |
if(!url.length) return false; | |
if(url[url.length-1] === "/") { | |
url = url.slice(0, url.length-1); |
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
ZQueue = function() { | |
this.queue = []; | |
this.queued = false; | |
}; | |
ZQueue.prototype.dequeue = function() { | |
this.queued = false; | |
this.shiftQueue(); | |
}; |
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
#!/usr/bin/env node | |
var os = require('os'); | |
var WebSocketClient = require('websocket').client; | |
var count = 0; | |
function recursion() { | |
var client = new WebSocketClient(); | |
client.on('connectFailed', function(error) { |
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 sockjs = require('sockjs'); | |
var node_static = require('node-static'); | |
var sockjs_opts = {sockjs_url: "http://127.0.0.1:8888/sockjs.js"}; | |
var sockjs_echo = sockjs.createServer(sockjs_opts); | |
sockjs_echo.on('connection', function(conn) { | |
console.log(conn.id + ' connected'); | |
conn.on('data', function(message) { |