Skip to content

Instantly share code, notes, and snippets.

View guybrush's full-sized avatar

Patrick guybrush

View GitHub Profile
@indexzero
indexzero / cluster.js
Created January 11, 2012 19:59 — forked from mnutt/cluster.js
clustering with node 0.6.7
global.config = require('./lib/config').load("config/app.json");
var cluster = require('cluster');
var fs = require('fs');
var app = require('./app');
// Logging
var log = require('./lib/winston');
global.log = log;
// Write out pidfile
@rauchg
rauchg / ms.md
Created December 21, 2011 00:25
Milliseconds conversion utility.
@tj
tj / app.js
Created December 17, 2011 23:15
express 3.x cookie session middleware example
var express = require('express')
, cookieSessions = require('./cookie-sessions');
var app = express();
app.use(express.cookieParser('manny is cool'));
app.use(cookieSessions('sid'));
app.get('/', function(req, res){
req.session.count = req.session.count || 0;
@sorensen
sorensen / custom-dnode-session.js
Created December 8, 2011 23:07
DNode/Express Mongoose Authentication
// DNode Session
// =============
var connect = require('connect')
module.exports = function(opt) {
var key = opt.key || 'connect.sid'
, store = opt.store
, interval = opt.interval || 120000
// Here is a proposal for minimalist JavaScript classes, humbly offered.
// There are (at least) two different directions in which classes can be steered.
// If we go for a wholly new semantics and implementation, then fancier classical
// inheritance can be supported with parallel prototype chains for true inheritance
// of properties at both the class and instance level.
// If however, we keep current JavaScript prototype semantics, and add a form that
// can desugar to ES3, things must necessarily stay simpler. This is the direction
// I'm assuming here.
@mattpodwysocki
mattpodwysocki / jsconf-eu-2011.md
Created October 1, 2011 13:40
JSConf.EU Slides
@isaacs
isaacs / streams.md
Created September 26, 2011 00:58
A spec for streams

Status of this Document

This is a proposal. It does not match the code as of writing.

This describes the minimum contract that Stream objects must adhere to in order to properly interoperate with pipes.

Stream Class

The parent class for all stream objects. Implements the pipe

@creationix
creationix / webserver.c
Created September 11, 2011 07:47
libuv webserver updated to latest libuv
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "uv.h"
#include "http_parser.h"
static uv_stream_t server;
static http_parser_settings settings;
static uv_buf_t refbuf;
@tj
tj / example.js
Created August 3, 2011 15:42
less retarded js prototypes
var User = {
toString: function(){
return '<User ' + this.name + '>'
}
};
var Admin = { __proto__: User, isAdmin: true };
var tj = { __proto__: Admin };
@guybrush
guybrush / node_timeline.md
Created June 7, 2011 19:30
nodejs videos