Skip to content

Instantly share code, notes, and snippets.

@arv
arv / compile.sh
Last active December 17, 2015 04:59
Shows how you can build a smaller js binary to only parse (and print) some ES6 code.
traceur --out out.js parser.js
# Traceur does not strip dead code. Use Uglify2.
uglifyjs src/runtime/runtime.js out.js -cm -o out.min.js
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
Introduction
============
The Hydna Protocol is a TCP/IP-based, application layer procotol designed
to facilitate high performance one-to-many real time communication. It is
an asynchronous protocol, albeit a few internal operations rely on
chat-style communication.
It is a very terse, multicasting, binary protocol that is well-suited for
rapidly sending large amounts of small packets.
anonymous
anonymous / FoldedArrayReverse.js
Created August 21, 2010 22:37
function FoldArrayRev (chunkSize) {
this._chunkSize = chunkSize || 1000;
this._data = [[]];
this._tail = 0;
}
FoldArrayRev.prototype = {
push: function (item) {
if (this._data[this._tail].length >= this._chunkSize) {
this._data[this._tail] = this._data[this._tail].reverse();
this._data.push([]);