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
node /opt/toolbar/app-cluster.js 8080 | |
node.js:134 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
Error: EBADF, Bad file descriptor '/opt/toolbar/package.json' | |
at Object.openSync (fs.js:221:18) | |
at Object.readFileSync (fs.js:112:15) | |
at Object.<anonymous> (/opt/toolbar/app-cluster.js:12:34) | |
at Module._compile (module.js:404:26) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Dojo Stateful Replication</title> | |
<script> | |
var dojoConfig = { | |
baseUrl: '/js/dojo/1.7.0/dojo', | |
}; | |
</script> | |
<script src="/js/dojo/1.7.0/dojo/dojo.js"></script> |
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
// requires request, measured, optimist and microtime npm modules | |
var util = require('util') | |
, request = require('request') | |
, microtime = require('microtime') | |
, measured = require('measured') | |
, collection = new measured.Collection('http') | |
, argv = require('optimist').usage('node load.js -c [concurrent] -n [total] url').argv; | |
var c = argv.c || 1 | |
, n = argv.n || 1, uri = argv._[0] |
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 DNode = require('dnode'), | |
argv = require('optimist') | |
.usage('Usage: $0 --p [num] --pp [num] --name [str]') | |
.demand(['pp', 'name']) | |
.argv, | |
sprintf = require('sprintf').sprintf, | |
http = require('http'), | |
util = require('./util'), | |
DNode = require('dnode'), | |
logf = require('./util').logf, |
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
# install git | |
sudo apt-get --yes install g++ curl libssl-dev apache2-utils | |
sudo apt-get --yes install git-core | |
# download the Node source, compile and install it | |
git clone https://github.com/joyent/node.git ~/node | |
cd ~/node | |
./configure | |
make | |
sudo make install | |
# install the Node package manager for later use |
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 dgram = require('dgram'); | |
module.exports = function (port, host) { | |
return new function() { | |
this._host = host || '127.0.0.1'; | |
this._port = port || 8125; | |
this._client = dgram.createSocket("udp4"); | |
this._send = function (message) { | |
console.log('STATSD', message); |
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
// A module published to a private registry would optionally have a "registry" | |
// property that is a reference to the registry where this module is published. | |
// | |
// A `npm publish` would publish to the registry in the registry property. | |
// | |
// Otherwise, `npm --registry http://private.me:5984/registry/_design/app/_rewrite publish` | |
// | |
{ | |
"name": "foo", |
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 isActive = new IsActive(10000, window); | |
// isActive.on('active', function () { console.log('active') }); | |
// isActive.on('inactive', function () { console.log('inactive') }); | |
// isActive.start(); | |
var IsActive = function (timerPeriod, g) { | |
timerPeriod = parseInt(timerPeriod) || 60000; | |
if (!g) g = window; | |
var ACTIVE = 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
app.factory('desktopNotification', function ($window, $document) { | |
var focused = true; | |
var onFocus = function () { focused = true; }; | |
var onBlur = function () { focused = false; }; | |
if (/*@cc_on!@*/false) { // check for Internet Explorer | |
$document.onfocusin = onFocus; | |
$document.onfocusout = onBlur; |
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
// Really simple Winston Logstash UDP Logger | |
var dgram = require('dgram'), | |
util = require('util'), | |
os = require('os'), | |
winston = require('winston'); | |
var LogstashUDP = module.exports = function (options) { | |
winston.Transport.call(this, options); | |
options = options || {}; |
OlderNewer