Skip to content

Instantly share code, notes, and snippets.

curl -XDELETE 'http://localhost:9200/_all/'
@itayw
itayw / Joola Demo
Last active August 29, 2015 14:12
Joola Demo
#Figure 1
### Before we get started
- We will be using our `localhost` with default configuration and settings.
- We will be running the `master` (stable) branch.
- We will be using MongoDB as our datastore with default configuration.
- We will be using the demo APIToken `apitoken-demo`.
###Installing Joola
```bash
@itayw
itayw / server.js
Last active August 29, 2015 14:10
Advanced Node.JS Meetup Examples
var express = require('express');
var useragent = require('useragent');
var app = express();
useragent(true);
app.use(function (req, res, next) {
var agent = useragent.parse(req.headers['user-agent']);
req.joola_event = {
timestamp: new Date(),
@itayw
itayw / rdb-test.js
Created November 13, 2014 14:08
ReDB quick load test
var r = require('rethinkdb');
var i = 0;
var document = {
timestamp: new Date(),
username: 'username',
value: 123
};
r.connect(function (err, conn) {
var i = 0;
while (true){
@itayw
itayw / distinct.rql.js
Last active August 29, 2015 14:08
rethinkdb - early query - simple
r.db('joola').table('reads').filter(r.row('timestamp').during(r.time(2010,1,1,'Z'), r.time(2015,1,1,'Z'))).group('workspace', 'username').sum('readCount');
sudo docker run --rm -v /var/run/docker.sock:/var/run/docker.sock bobrik/image-cleaner
@itayw
itayw / heatmap.js
Created October 28, 2014 08:06
Joola wbepage heatmap
joola.init({
host: 'https://itay-playground.app.joo.la:443',
APIToken: 'DWyrb8NOmvdP2BwzaBU9gl1u4TVU4b1a'
}, function (err, ref) {
console.log('Joola initialized, version ', joola.VERSION);
//hook mouse moves
var pointindex = 0;
var movestack = [];
document.body.onmousemove = function (e) {
### Keybase proof
I hereby claim:
* I am itayw on github.
* I am itayw (https://keybase.io/itayw) on keybase.
* I have a public key whose fingerprint is 9ABA B6B8 78FC 6D4D B4AF 123B 5B6F 3DAB D769 0BE2
To claim this, I am signing this object:
http://www.paletton.com/#uid=73r0u0kqEnjhFuQmqqXt+j7BXdU
http://www.cssmatic.com/gradient-generator#'\-moz\-linear\-gradient\%28top\%2C\%20rgba\%2857\%2C71\%2C147\%2C1\%29\%200\%25\%2C\%20rgba\%2857\%2C71\%2C147\%2C0\.8\%29\%20100\%25\%29\%3B'
var app = {
"name": "Create Application [" + boxname + "]",
"status": "pending",
"steps": [
{
"name": "Step 1: Create VM [" + boxname + "]",
"recipe": "vm/gce_addinstance",
"args": {
"id": boxname,
"name": boxname,