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 fork = require('child_process').fork; | |
var c = fork('bin/carapace', ['examples/chroot-jail/server.js']); | |
c.on('message', function (data) { | |
console.log('Received a message from carapace'); | |
console.dir(data); | |
if (data.event == 'port') { | |
console.log([ | |
'Server is listening on port ' + data.data.port, | |
'(It wanted to listen on ' + data.data.desired + ')' |
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
language: node_js | |
node_js: | |
- 0.4 | |
- 0.6 |
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'), | |
cradle = require('./'), | |
db = new(cradle.Connection)().database('cradle'); | |
db.save('hello', function (err, doc) { | |
db.saveAttachment('hello', 'world', 'text/plain', fs.createReadStream('someFile')); | |
}); |
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 registry = require('./registry'); | |
console.log('Analyzing ' + registry.total_rows + ' rows'); | |
var haveGithub = 0; | |
registry.rows.forEach(function (row) { | |
var doc = row.doc; | |
if (!doc['dist-tags'] || !doc['dist-tags'].latest) { | |
return console.error(doc.name + ' has no dist-tags'); |
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 util = require('util'), | |
Plates = require('plates'), | |
flatiron = require('../'), | |
app = flatiron.app; | |
app.use(flatiron.plugins.http); | |
var sandwiches = { | |
bacon: 24, | |
burger: 42 |
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/node | |
require('child_process').spawn(process.argv[2], process.argv.slice(3), { customFds: [0, 1, 2] }); |
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 ruby | |
if ARGV[0] and ARGV[1] | |
slug = ARGV[0] + "/" + ARGV[1] | |
else | |
url = `git config --get remote.origin.url` | |
return $?.exitstatus if $?.exitstatus != 0 | |
m = /git@github\.com:([a-zA-Z0-9_-]+)\/([a-zA-Z0-9._-]+)\.git/.match(url) | |
slug = m[1] + "/" + m[2] | |
end | |
$stdout.write "[](http://travis-ci.org/#{slug})" |
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 forever = require('forever'); | |
var m = new forever.Monitor(); | |
m.command = '/usr/bin/env'; | |
m.args = ['node', '--trace-gc', 'gc.js']; | |
m.start(); |
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
PID/THRD RELATIVE ELAPSD SYSCALL(args) = return | |
25607/0x4c060d: 258 19 __sysctl(0x10B580940, 0x6, 0x0) = 0 0 | |
25607/0x4c060d: 265 7 __sysctl(0x10B580940, 0x6, 0x7FDB61802000) = 0 0 | |
25607/0x4c060d: 275 2 gettimeofday(0x10B5809A0, 0x0, 0x10B580964) = 1329155773 0 | |
25607/0x4c060d: 276 1 gettimeofday(0x10B580B58, 0x0, 0xD4AD9) = 1329155773 0 | |
25607/0x4c060d: 279 4 kqueue(0x10B580B58, 0x0, 0xD4AE3) = 3 0 | |
25607/0x4c060d: 281 3 kevent(0x3, 0x10B580B38, 0x1) = 0 0 | |
25607/0x4c060d: 290 5 socket(0x1, 0x1, 0x0) = 4 0 | |
25607/0x4c060d: 293 4 setsockopt(0x4, 0xFFFF, 0x1022) = 0 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 nssocket = require('../lib/nssocket'); | |
// | |
// define a simple message protocol as [<type>, <id>] and create some messages that use it. | |
// | |
var message1 = ['message', 'one']; | |
var message2 = ['message', 'two']; | |
// | |
// Create an `nssocket` TCP server and tell the server to listen on port `6785`. |