Skip to content

Instantly share code, notes, and snippets.

@oleics
oleics / npm-1.1.25
Created June 19, 2012 21:01
npm install restify
admin@199069:~/tmp$ node -v
v0.7.10
admin@199069:~/tmp$ npm -v
1.1.25
admin@199069:~/tmp$ npm install restify
npm http GET https://registry.npmjs.org/restify
npm http 200 https://registry.npmjs.org/restify
npm http GET https://registry.npmjs.org/restify/-/restify-1.4.3.tgz
npm http GET https://registry.npmjs.org/async/0.1.22
npm http GET https://registry.npmjs.org/bunyan/0.8.0
@oleics
oleics / useyourimagination.plugin.js
Created June 12, 2012 20:26
dustjs: chunk WriteStream Interface
module.exports = plugin
var request = require('request')
function plugin(chunk, context, bodies, params) {
return chunk.map(function(chunk) {
request
( { method: 'GET'
, uri: 'http://localhost:2001/useyourimagination/'
}
@oleics
oleics / coolstreams.js
Created April 28, 2012 18:51
Cool nodejs streams
var Stream = require('stream').Stream
, Lazy = require('lazy')
var timeout = -1
, rndMax = 10000
// create two streams and emit random JSON data strings (objects)
var s1 = createStream()
, s2 = createStream()
emit_random_data(s1, 's1', timeout, rndMax)
@oleics
oleics / client.js
Created April 22, 2012 18:08
UNIX domain sockets
var net = require('net');
connect();
function connect() {
var client = net.connect('/tmp/test.sock', function() { //'connect' listener
console.log('client connected');
client.write('world!');
function ping() {
@oleics
oleics / example.bat
Created February 9, 2012 15:55
Let vcbuild.bat create a zip-archive of node and npm
rem Use curl and 7za
set NPM_VERSION=1.1.0-3
curl -o "%temp%\npm.zip" "http://nodejs.org/dist/npm-%NPM_VERSION%.zip"
if not exist "%temp%\npm" ( mkdir "%temp%\npm" )
7za x "%temp%\npm.zip" -o"%temp%\npm"
7za a -tzip "Release\node-v%NODE_VERSION%-win.zip" "Release\node.exe" "%temp%\npm\*" -mx9
rem Same but with wget and zip/unzip
set NPM_VERSION=1.1.0-3
wget -O "%temp%\npm.zip" "http://nodejs.org/dist/npm-%NPM_VERSION%.zip"
$(document).ready(function() {
//$.cookie('mri', null);
var mri_numChilds = $('body').data('numChilds');
var mri_id = mri_numChilds ? $('body').data('id') : $('body').data('pid');
var mri_pid = $('body').data('pid');
var mri_pos = 0;
var mri_max = 5;
var mri = [];
$('#menu-right > div').hide().each(function() {
mri.push($(this));