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
// Load the TCP Library | |
net = require('net'); | |
// Keep track of the chat clients | |
var clients = []; | |
// Start a TCP Server | |
net.createServer(function (socket) { | |
// Identify this client |
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
// nodetime for local use | |
var uphttp = require('http'); | |
var nodetime = require('nodetime'); | |
var upload_port = 12345; | |
nodetime.on('sample', function(sample) { | |
var upload = uphttp.request({ port: upload_port, | |
method: 'POST', | |
path: '/upload' | |
}); | |
upload.end(JSON.stringify(sample)); |
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 v0.8 roadmap | |
----------------- | |
- Move the remaining platform functions from src/platform-*.cc into libuv. | |
- Get rid of waf. Waf is an ugly build system. All platforms will build | |
using gyp. (Ben) | |
- Extensions. We need to define an easy and suggested way of building | |
extensions, which should be similar across all supported platforms. (Bert, |
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 perl | |
# nodebrew | |
# | |
# Install: | |
# | |
# 1. このスクリプトをダウンロードして実行権限つけてパスが通ってるところにおく | |
# 2. 以下にパスを通す | |
# $HOME/.nodebrew/current/bin | |
# |
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 gcc44 package and update-alternatives (in chkconfig) | |
yum -y install gcc44 chkconfig | |
# Check if gcc is already a link | |
if [ ! -L /usr/bin/gcc ]; then mv /usr/bin/gcc /usr/bin/gcc41; fi | |
if [ ! -L /usr/bin/g++ ]; then mv /usr/bin/g++ /usr/bin/g++41; fi | |
# Install update-alteratives links for gcc41 and gcc44 | |
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc41 60 --slave /usr/bin/g++ g++ /usr/bin/g++41 | |
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc44 40 --slave /usr/bin/g++ g++ /usr/bin/g++44 | |
# Select gcc44 to compile gecode-3.5.0 in chef::bootstrap_server | |
update-alternatives --config gcc |
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
// Usage | |
// [1, 2, 3, 4].max() => 4 | |
// [1, 2, 3, 4].min() => 1 | |
// | |
// With blocks | |
// [1, 2, 3, 4].max( function(d){ | |
// return d*-1; | |
// }); => -1 | |
// | |
// [1, 2, 3, 4].min( function(d){ |
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 is a Node+WebSocket powered demo to sync videos | |
across different browsers. This file is the client, | |
the other one is the Node server. Powered by Node and | |
http://github.com/miksago/node-websocket-server --> | |
<style> | |
.inactive { display: none; } | |
.active { display: block; } | |
</style> | |
<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
var NativeModule; | |
/* Hack to get a reference to node's internal NativeModule */ | |
(function(){ | |
// intercept NativeModule.require's call to process.moduleLoadList.push | |
process.moduleLoadList.push = function(){ | |
// `NativeModule.require('native_module')` returns NativeModule | |
NativeModule = arguments.callee.caller('native_module'); | |
// delete the interceptor and forward normal functionality |
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
/* | |
smtpd.js is SMTP server written for node.js | |
MIT License | |
*/ | |
var tcp = require('tcp'); | |
var sys = require('sys'); |
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
LIVE: 0 TOTAL: 0 MEM: 11.492 Mb DIFF: 0.004 Mb | |
LIVE: 0 TOTAL: 0 MEM: 11.770 Mb DIFF: 0.277 Mb | |
LIVE: 0 TOTAL: 0 MEM: 10.523 Mb DIFF: -1.246 Mb | |
LIVE: 0 TOTAL: 0 MEM: 10.527 Mb DIFF: 0.004 Mb | |
LIVE: 0 TOTAL: 0 MEM: 10.488 Mb DIFF: -0.039 Mb | |
LIVE: 0 TOTAL: 0 MEM: 10.492 Mb DIFF: 0.004 Mb | |
LIVE: 0 TOTAL: 449 MEM: 13.281 Mb DIFF: 2.789 Mb | |
LIVE: 0 TOTAL: 947 MEM: 14.941 Mb DIFF: 1.660 Mb | |
LIVE: 0 TOTAL: 1441 MEM: 15.832 Mb DIFF: 0.891 Mb | |
LIVE: 1 TOTAL: 1958 MEM: 17.031 Mb DIFF: 1.199 Mb |