This file contains hidden or 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 fs = require('fs'); | |
var connect = require('connect'); | |
var VHOSTS_DIR = '/srv/connect/apps'; | |
var VHOSTS = {}; | |
var hostsDirectory = function( req, res) { | |
res.writeHead( 200, {"Content-Type":"text/html"} ); | |
names = []; | |
for( var vhost in VHOSTS ){ |
This file contains hidden or 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
{ | |
hose_name => [ | |
{ | |
title: 'Atlanta twitter content search', | |
entries_samples: [1,...], | |
polls_samples: [1,...], | |
entries_total : 345211, | |
polls_total : 44556 | |
}, | |
{ |
This file contains hidden or 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 file changes for every book, could be stored in database | |
### | |
BOOK.THEME = 1 | |
BOOK.SECTION = 4 | |
### | |
Here we declare the image files for the toy chest. | |
### |
This file contains hidden or 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 file changes for every book, could be stored in database | |
### | |
BOOK.THEME = 1 | |
BOOK.SECTION = 3 | |
### | |
Here we declare the image files for the toy chest. | |
### |
This file contains hidden or 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 file changes for every book, could be stored in database | |
### | |
BOOK.THEME = 1 | |
BOOK.SECTION = 1 | |
### | |
Here we declare the image files for the toy chest. | |
### |
This file contains hidden or 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 fs = require('fs'); | |
/** | |
* Offers functionality similar to mkdir -p | |
* | |
* Asynchronous operation. No arguments other than a possible exception | |
* are given to the completion callback. | |
*/ | |
function mkdir_p(path, mode, callback, position) { | |
mode = mode || 0777; |
This file contains hidden or 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
/* Je prétends que ton POST est pas Cross-Domain.. */ | |
var tonCallback = function(textOrHTML){ | |
// si textOrHTML est du JSON | |
var json = JSON.parse(textOrHTML); | |
// sinon | |
var resultDocument = $(textOrHTML); | |
}; | |
// tu peut en plus de l'option "data" mettre des variables GET dans ton url... |
This file contains hidden or 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
function element(value, context) { | |
var ret = $([]); // $(context) ? | |
if (value.jquery) { | |
ret = value; | |
} else if (value == 'parent') { | |
ret = $(context).parent(); | |
} else if (value == 'clone') { | |
ret = $(context).clone().removeAttr('id'); | |
} else if (value == 'window') { |
This file contains hidden or 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
defineImportCallback = (script, callback) -> | |
unless script.readyState? | |
script.onload = -> callback() | |
return | |
# IE case | |
script.onreadystatechange = -> | |
if script.readyState is "loaded" or script.readyState is "complete" | |
script.onreadystatechange = null | |
callback() |
This file contains hidden or 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 stdin = process.openStdin(); | |
stdin.setEncoding('utf8'); | |
stdin.on('data', logeval ); | |
function logeval(chunk){ | |
if(chunk) console.log( eval( chunk ) ); | |
} |