Skip to content

Instantly share code, notes, and snippets.

this.inject = function(fn) {
return function() {
var inject = annotate(fn);
var callArgs = [];
var args = Array.prototype.slice.call(arguments, 0);
inject.forEach(function(arg) {
if (arg.slice(0,1) === "$") {
callArgs.push(use[arg]);
} else {
var fs = require('fs'),
nconf = require('nconf');
function FileWriter(logger, conf, cb) {
"use strict";
var currentFile = conf.get("logger:folder") + "/" + process.pid + ".log",
writeStream = fs.createWriteStream(currentFile),
rotate = 0,
maxSize = 1024 * 1024 * 1024,
var sync = require('synchronize');
function executeQuery(qryString, cb) {
setTimeout(function() {
cb(null, qryString);
}, 1500);
}
sync.fiber(function() {
var query = function(qryString) {
var obj = {},
needed = 1024*1024;
for(i = 0; i < needed; i++) {
obj[i] = "avx";
}
function forLoopTest() {
var start = process.hrtime();
@geNAZt
geNAZt / configCrypt.js
Created March 13, 2013 08:53
Decrypter
process.stdin.resume();
process.stdin.on('data', function stdinPass(data) {
process.stdin.removeListener('data', stdinPass);
process.stdin.pause();
var pass = data.toString("utf8").trim();
var m = crypto.createHash('md5');
m.update(pass, "utf8");
var key = m.digest('hex');
process.stdin.resume();
process.stdin.on("data", function(data) {
process.stdin.pause();
var pass = data.toString("utf8").trim();
var m = crypto.createHash('md5');
m.update(pass, "utf8");
var key = m.digest('hex');
m = crypto.createHash('md5');
/**
* Module dependencies.
*/
var util = require('util'),
OAuth2Strategy = require('passport-oauth').OAuth2Strategy,
InternalOAuthError = require('passport-oauth').InternalOAuthError;
function Strategy(options, verify) {
options = options || {};
options.authorizationURL = options.authorizationURL || 'https://stackexchange.com/oauth';
function step1() {
console.log("Step 1");
setTimeout(function () {
step2();
}, 2000);
}
function step2() {
console.log("Step 2");
setTimeout(function () {
var data = 'F somekeyforyourservero {"Topic":"test","Text":"test","SenderUserId":3,"Addressers":[],"DateSent":"2013-02-16T11:10:26.953174Z","Id":0}';
data = data.replace(/^\s*F\s*somekeyforyourservero\s*/, '');
console.log(data);
var buffer = new Buffer(150000),
buffer.fill("0"),
events = require('events'),
util = require('util');
function BufferStream(buffer) {
events.EventEmitter.call(this);
this.readable = true;
this.writeable = false;