Skip to content

Instantly share code, notes, and snippets.

View Floby's full-sized avatar
🐮
Moo

Florent Jaby Floby

🐮
Moo
View GitHub Profile
From 65c619b6c0e988406e4d338ecd7cb49e472c5b51 Mon Sep 17 00:00:00 2001
From: Florent Jaby <florent.jaby@gmail.com>
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"
@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;
@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 / editor.js
Created April 19, 2011 09:18
open the default editor from node
var fs = require('fs');
var child_process = require('child_process');
var spawn = child_process.spawn;
function openEditor(file) {
var cp = spawn(process.env.EDITOR, [file], {
customFds: [
process.stdin,
process.stdout,
process.stderr
@Floby
Floby / npm-debug.log
Created May 11, 2011 00:05
whole npm output when it failed at updating
info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', 'update', '-g' ]
info using npm@1.0.3
info using node@v0.4.8-pre
verbose config file /home/floby/.npmrc
verbose config file /usr/local/etc/npmrc
silly testEngine { name: 'meme',
silly testEngine description: 'a CLI utility to generate memes using memegenerator.net',
silly testEngine keywords: [ 'meme', 'cli' ],
silly testEngine version: '0.1.2',
@Floby
Floby / error output
Created October 22, 2011 20:22
Compile error, via npm install on ubuntu
npm info it worked if it ends with ok
npm info using npm@1.0.99
npm info using node@v0.4.13-pre
npm WARN gui@0.0.1 package.json: bugs['web'] should probably be bugs['url']
npm info preinstall gui@0.0.1
Setting srcdir to : /home/floby/dev/node/gui
Setting blddir to : /home/floby/dev/node/gui/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
@Floby
Floby / readme.md
Created March 26, 2012 12:52
Memento API doc

Api Memento mobile

Categories

  • URL: /category/
  • @params: -
  • @return: categories [object]

GET /category/

@Floby
Floby / app.js
Created May 24, 2012 13:08
BiduleChose bot
#!/usr/bin/env node
// installer les packages `format` et `irc` depuis npm
var chan = '#zftalk-fr'
var irc = require('irc');
var format = require('format');
var client = new irc.Client('irc.freenode.net', 'BiduleChose', {
@Floby
Floby / Bootstrap.php
Created July 30, 2012 13:58
Connecting signals in Centurion
<?php
class Search_Bootstrap extends Centurion_Application_Module_Bootstrap
{
protected function _initSignals()
{
Centurion_Signal::factory('post_delete')->connect(array($this, 'postDeleteRow'), 'Centurion_Db_Table_Row_Abstract');
}
@Floby
Floby / gist:3696745
Created September 11, 2012 07:47
LOL Query from centurion keywords
SELECT DISTINCT `mediacenter_media`.*
FROM `mediacenter_media`
WHERE ( `mediacenter_media`.`id` IN ((SELECT `mediacenter_media`.`id`
FROM `mediacenter_media`
INNER JOIN `media_file`
ON `media_file`.`id` =
`mediacenter_media`.`media_id`
LEFT JOIN `media_tag_file`
ON `media_tag_file`.`file_id` =
`media_file`.`id`