Skip to content

Instantly share code, notes, and snippets.

@haio
haio / LICENSE.txt
Last active August 31, 2015 11:25 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

Keybase proof

I hereby claim:

  • I am haio on github.
  • I am haio (https://keybase.io/haio) on keybase.
  • I have a public key whose fingerprint is A408 F72F C140 7741 E8A5 F30F 9EE3 1107 59FB E60F

To claim this, I am signing this object:

@haio
haio / array_deduplication
Created July 9, 2014 16:11
Array deduplication
var array = ['Lorem', 'Lorem', '<3', 'Ipsum', 'Ipsum'];
array = array.filter(function (item, pos, self) {
return self.indexOf(item) === pos;
});
console.log(array);
// ["Lorem", "<3", "Ipsum"]
git reset --soft 'HEAD^'
//Load shell
var shell = require("gl-now")({ clearColor: [0,0,0,0] });
var camera = require("game-shell-orbit-camera")(shell);
var xtend = require('xtend');
//Mesh creation tools
var createMesh = require("gl-simplicial-complex");
var polygonize = require("isosurface").surfaceNets;
var createAxes = require("gl-axes");
@haio
haio / gist:7887024
Last active December 30, 2015 21:19
MQTT QoS Levels
MQTT defines three levels of Quality of Service (QoS). The QoS defines how hard the broker/client will try to ensure that a message is received. Messages may be sent at any QoS level, and clients may attempt to subscribe to topics at any QoS level. This means that the client chooses the maximum QoS it will receive. For example, if a message is published at QoS 2 and a client is subscribed with QoS 0, the message will be delivered to that client with QoS 0. If a second client is also subscribed to the same topic, but with QoS 2, then it will receive the same message but with QoS 2. For a second example, if a client is subscribed with QoS 2 and a message is published on QoS 0, the client will receive it on QoS 0.
Higher levels of QoS are more reliable, but involve higher latency and have higher bandwidth requirements.
* 0: The broker/client will deliver the message once, with no confirmation.
* 1: The broker/client will deliver the message at least once, with confirmation required.
* 2: The broker/client wi
@haio
haio / Delete all queues in RabbitMQ
Created November 28, 2013 10:40
Delete all queues in RabbitMQ
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl start_app
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@haio
haio / gist:7462519
Last active December 28, 2015 07:09
polyfill
polyfill
Repetition Killed the Cat
@haio
haio / gist:7428727
Created November 12, 2013 10:27
fgrep
fgrep "lua" ./ -R