Skip to content

Instantly share code, notes, and snippets.

ab -n 1000 -c 100 -H "Content-Type: application/json" http://127.0.0.1:8080/api/system/nodeDetails?APIToken=apitoken-root
ab -n 1 -p test/fixtures/benchmark.json -H "Content-Type: application/json" -T "application/json" http://127.0.0.1:8080/api/beacon/insert?APIToken=apitoken-root
bin/joola.io.cli -e "joolaio.users.update({username:'root', _password:'password', _APIToken: 'token'})"
> db['root_codepen-clicks'].remove({clicks:{$lt:0}})
> db['root_codepen-visits'].remove({visits:{$lt:0}})
@itayw
itayw / example.html
Created January 23, 2014 09:36
joola.io docs - examples - a complete example
<html>
<html>
<title>joola.io Documentation - Examples - A complete example.
</html>
<body>
<h3>joola.io Documentation</h3>
<h2>Examples</h2>
<h1>A complete example</h1>
<hr>
@itayw
itayw / iwish.js
Last active January 2, 2016 14:29
-require joola.io.js
var myProject = joolaio.project.add('pet-project')
.collections.add('visits')
.dimensions.add('user.email', 'string')
.metrics.add('visits', 'int', 'sum')
.metrics.add('unique visists', 'int', 'sum', 'unique', 'user.email')
.metrics.add('visit time', 'int', 'avg', 'duration');
.collections.add('purchases')
.dimensions.add('user.email', 'string')
@itayw
itayw / gist:8178824
Created December 30, 2013 07:13
Async JSON.stringify and JSON.parse
common.stringify = function (obj, callback) {
var errored = false;
if (!obj)
return callback(null, obj);
try {
var
expected = [],
es = require('event-stream');
@itayw
itayw / sloc-20131214
Last active December 31, 2015 07:49
sloc joola.io
$ npm install -g sloc
$ sloc -e "bin/joola.io.js|public/|views/|.json|.md" lib/
---------- result ------------
physical lines : 5532
lines of source code : 3546
total comment : 1328
singleline : 112
multiline : 1216
@itayw
itayw / gist:7927865
Created December 12, 2013 13:22
stats incr in joola.io
function getInterval(){
//The interval in ms
return Math.floor(Math.random() * 1500) + 1
}
function getValue(){
//The value to push
return Math.floor(Math.random() * 100) + 0
}
Object.defineProperty(Error.prototype, 'toJSON', {
value: function () {
var alt = {};
Object.getOwnPropertyNames(this).forEach(function (key) {
alt[key] = this[key];
}, this);
return alt;
},
@itayw
itayw / gist:7732107
Created December 1, 2013 11:07
Handling CLA from within Travis-CI
https://github.com/adobe/brackets/pull/5857