I hereby claim:
- I am lsm on github.
- I am lsm (https://keybase.io/lsm) on keybase.
- I have a public key ASBpGnftcilmP_g7XoeQkY4v2zyOLF9vafd8a8yy_5pTmAo
To claim this, I am signing this object:
// RegExp copied from sina weibo;) | |
function makeReFn(regStr) { | |
var re = typeof regStr == 'string' ? new RegExp(regStr) : regStr; | |
return function (beRegStr) { | |
if (re.test(beRegStr)) { | |
return true; | |
} else { | |
return false; | |
} |
var mongodbSrc = require('./mongodb-0.9.4-3'); | |
var mongodbDst = require('./mongodb-0.9.6-1'); | |
/**** Edit start ****/ | |
var SRC_HOST = '10.0.0.31'; | |
var SRC_PORT = 27017; | |
var SRC_DB_NAME = 'mydb'; | |
var SRC_ROOT_COLLECTION = 'images'; | |
var FILE_QUERY = {}; // default to all |
/* Kosso : March 12th 2011 | |
This the only way I managed to do this without the app crashing on resume. | |
Done slightly differently to the KS example, since they unregister the service and | |
do not use a setInterval timer. | |
*/ | |
//############ in app.js : | |
// test for iOS 4+ |
var Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
var dataString = ['xxx', 'ssss', 'yyyyy', '1121212', 'aaaaa']; | |
var dataBuffer = [new Buffer('xxx'), new Buffer('ssss'), new Buffer('yyyyy'), new Buffer('1121212'), new Buffer('aaaaa')]; | |
suite.add('Buffer#copy', function() { | |
var offset = 0; | |
dataBuffer.forEach(function(chunk) { |
# npm install genji benchmark | |
var genji = require('genji'); | |
var Benchmark = require('benchmark'); | |
var Base = genji.Base; | |
var util = require('util'), | |
times = 500000; | |
/** | |
* Binary Parser. | |
* Jonas Raoni Soares Silva | |
* http://jsfromhell.com/classes/binary-parser [v1.0] | |
*/ | |
var chr = String.fromCharCode; | |
var maxBits = []; | |
for (var i = 0; i < 64; i++) { | |
maxBits[i] = Math.pow(2, i); |
/** | |
* Javascript OO helpers | |
*/ | |
/** | |
* Module exports. | |
*/ | |
exports.Base = Base; |
/* | |
In a child process, each of the stdio streams may be set to | |
one of the following: | |
1. A new file descriptor in the child, dup2'ed to the parent and | |
exposed to JS as a Stream object. | |
2. A copy of a file descriptor from the parent, with no other | |
added magical stuff. | |
3. A black hole - no pipe created. |
I hereby claim:
To claim this, I am signing this object:
var app = require('express')() | |
app.set('views', path.join(__dirname, 'views')) | |
app.set('view engine', 'pug') | |
app.use(express.static(path.join(__dirname, 'public'))) | |
app.get('/', function(req, res){ | |
res.render('index.pug') | |
}) |