This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sortArrayByKey( arr, key ){ | |
let keyPath = key.split( '.' ); | |
return arr.map( ( e, i ) => { | |
let value = e[ keyPath[ 0 ] ]; | |
for( let index = 1; index < keyPath.length; index ++ ){ | |
value = value[ keyPath[ index ] ]; | |
} | |
return { | |
index: i, | |
value: value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by dave @ beesandbombs.tumblr.com >:) | |
void setup() { | |
setup_(); | |
result = new int[width*height][3]; | |
result_ = new int[width*height][3]; | |
} | |
int[][] result, result_; | |
float time; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<script type="text/javascript" src="http://cdn.jsdelivr.net/sparkjs/0.5.9/spark.min.js"> </script> | |
<style> | |
#led1{ | |
width: 150px; | |
height: 150px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pseudo-random generator | |
function Marsaglia(i1, i2) { | |
// from http://www.math.uni-bielefeld.de/~sillke/ALGORITHMS/random/marsaglia-c | |
var z = i1 || 362436069, w = i2 || 521288629; | |
var intGenerator = function() { | |
z = (36969 * (z & 65535) + (z >>> 16)) & 0xFFFFFFFF; | |
w = (18000 * (w & 65535) + (w >>> 16)) & 0xFFFFFFFF; | |
return (((z & 0xFFFF) << 16) | (w & 0xFFFF)) & 0xFFFFFFFF; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body style="background:#fff;"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"></script> | |
<canvas id="canvas"></canvas> | |
<script id="jsbin-javascript"> |
NewerOlder