Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am n1t0 on github.
  • I am moi_anthony (https://keybase.io/moi_anthony) on keybase.
  • I have a public key whose fingerprint is CF82 D46E CAF0 2B67 DC63 EAB1 F19D 35EA CA5D 8E64

To claim this, I am signing this object:

@n1t0
n1t0 / dattss.js
Last active December 22, 2015 09:09
var foo = require('dattss').dattss({ auth: '__YOUR_AUTH_KEY__' });
/* DaTtSs lets you aggregate 3 types of statistics */
foo.agg('users.new', '1c'); // counters (evolves incrementally)
foo.agg('users.total', '23g'); // gauges (snapshot of a value)
foo.agg('users.signup', '153ms'); // timers (time it takes to do smthg)
/* Use paths to easily split your data into categories */
foo.agg('core.boot', '20ms');
foo.agg('core.boot', '1c');
// Update/Insert objects with
c_medias.update({
slt: insert.slt,
mid: insert.mid
}, insert, { upsert: true }, function(err) {
if(err) {
return cb_(err);
}
else {
return cb_();
@n1t0
n1t0 / common.js
Created February 7, 2012 16:09
upload fix
if (upload) {
upload.on('data', function(buf) {
console.log('data');
rstream.write(buf);
});
upload.on('end', function() {
console.log('end');
rstream.end();
});
//upload.pipe(rstream);
@n1t0
n1t0 / addfile.js
Created February 7, 2012 16:05
test case addFile stream
var request = http.get(options, function(res){
if(res.statusCode === 200){
var options = { remote: my.pic.sha + '-toto.jpg',
stream: res
};
my.cf.addFile(container, options, function(err, up) {
if(err) cb(err);
else if(!up) {
cb(new Error('Not up'));
}