Skip to content

Instantly share code, notes, and snippets.

function keepTrying(otherArgs, promise) {
promise = promise||new Promise();
// try doing the important thing
if(success) {
promise.resolve(result);
} else {
setTimeout(function() {
keepTrying(otherArgs, promise);
@mrvicadai
mrvicadai / index.html
Last active August 29, 2015 14:06 — forked from stepheneb/index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>D3: Subselection Example</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
body {
font: 13px sans-serif;
@mrvicadai
mrvicadai / gist:1cd58227aeb12a51bae6
Last active August 29, 2015 14:07
heatmap-out-of-order.json
[
{"time":"2014-10-12T17:20:00.000Z","quant":100,"count":10},
{"time":"2014-10-12T17:20:00.000Z","quant":10,"count":1},
{"time":"2014-10-12T17:19:00.000Z","quant":100,"count":20},
{"time":"2014-10-12T17:19:00.000Z","quant":10,"count":1},
{"time":"2014-10-12T17:18:00.000Z","quant":100,"count":30},
{"time":"2014-10-12T17:18:00.000Z","quant":10,"count":1},
@mrvicadai
mrvicadai / data1
Last active August 29, 2015 14:10
stacked bars sample data
[
{
"category": "A",
"mark": "success"
},
{
"category": "A",
"mark": "success"
},
{
@mrvicadai
mrvicadai / main.juttle
Last active August 29, 2015 14:11
Jut Chart Party
function get_level(value) {
if (value < 25) {return "success";}
if (value < 50) {return "warning";}
if (value < 75) {return "error";}
return "nothing";
}
sub data1() {
emitter -limit 1000 -hz 10
}
ssh count
dc:14:de:8e:d7:c1:15:43:23:82:25:81:d2:59:e8:c0 245272
32:f9:38:a2:39:d0:c5:f5:ba:bd:b7:75:2b:00:f6:ab 197846
d0:db:8a:cb:74:c8:37:e4:9e:71:fc:7a:eb:d6:40:81 152046
34:47:0f:e9:1a:c2:eb:56:eb:cc:58:59:3a:02:80:b6 140777
df:17:d6:57:7a:37:00:7a:87:5e:4e:ed:2f:a3:d5:dd 91904
81:96:a6:8c:3a:75:f3:be:84:5e:cc:99:a7:ab:3e:d9 80499
7c:a8:25:21:13:a2:eb:00:a6:c1:76:ca:6b:48:6e:bf 78172
1c:1e:29:43:d2:0c:c1:75:40:05:30:03:d4:02:d7:9b 71851
8b:75:88:08:41:78:11:5b:49:68:11:42:64:12:6d:49 70786
(function( $ ) {
$.fn.simulateDragDrop = function(options) {
return this.each(function() {
new $.simulateDragDrop(this, options);
});
};
$.simulateDragDrop = function(elem, options) {
this.options = options;
this.simulateEvent(elem, options);
};
@mrvicadai
mrvicadai / joda.instructions.md
Created July 10, 2015 17:00
Joda Instructions

Joda Instructions

Step 1

Run the following bash commands

pip install redis
pip install flask
@mrvicadai
mrvicadai / gist:d3a2edb4ca441a66347d
Last active August 29, 2015 14:26 — forked from mfournier/gist:5883828
example collectd processes plugin
<Plugin "processes">
ProcessMatch "carbon-cache" "python.+carbon-cache"
ProcessMatch "carbon-aggregator" "python.+carbon-aggregator"
</Plugin>
@mrvicadai
mrvicadai / install.sh
Created September 25, 2015 05:03 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"