Skip to content

Instantly share code, notes, and snippets.

View jonathanlurie's full-sized avatar
🐛
I like to code things

Jonathan Lurie jonathanlurie

🐛
I like to code things
View GitHub Profile
@jonathanlurie
jonathanlurie / endianness.js
Last active July 12, 2017 00:38 — forked from TooTallNate/endianness.js
Get host machine endianness using JavaScript Typed Arrays (polyfill for `os.endianness()` in node.js)
function endianness () {
var b = new ArrayBuffer(4);
var a = new Uint32Array(b);
var c = new Uint8Array(b);
a[0] = 0xdeadbeef;
if (c[0] == 0xef) return 'LE';
if (c[0] == 0xde) return 'BE';
throw new Error('unknown endianness');
}
@jonathanlurie
jonathanlurie / data-3.csv
Last active May 25, 2017 03:06 — forked from d3noob/data-3.csv
v4 curve interpolation comparison
date close
1-May-12 558.13
30-Apr-12 553.98
27-Apr-12 567.00
26-Apr-12 589.70
25-Apr-12 599.00
24-Apr-12 630.28
21-Apr-12 666.70
23-Apr-12 666.70
20-Apr-12 634.98