Skip to content

Instantly share code, notes, and snippets.

View Floby's full-sized avatar
🐮
Moo

Florent Jaby Floby

🐮
Moo
View GitHub Profile
@Floby
Floby / routes.js
Created March 9, 2011 21:59
some code of how I did identification with socket.io
then in client code, a JS var is exposed with the passed in token
and the first thing it does upon connection si sending the token
@Floby
Floby / gist:850083
Created March 1, 2011 22:58
To know who exactly is on the internet. within the IPv4 address space...
#!/usr/bin/env node
var cp = require('child_process');
var sys = require ('sys')
var fs = require ('fs')
var lines = require ('lines')
var nextAddress;
var i=1, j=1, k=1;
nextAddress = function() {
++k;
From 65c619b6c0e988406e4d338ecd7cb49e472c5b51 Mon Sep 17 00:00:00 2001
From: Florent Jaby <[email protected]>
Date: Wed, 28 Jul 2010 13:09:27 +0200
Subject: [PATCH] Added an experimental support for lines with streams
+ added function sys.lines(stream) which sets up a few utilities for streams
++ adds a function stream.writeln(string) which is a shorthand for stream.write(string + "\n")
++ add a listener on data events on this stream
+++ do nothing if the encoding is binary
+++ bufferize characters other than "\n"