This file contains 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
/** | |
* lol() | |
* improving the console.log through dynamic LULZ injection | |
* | |
* history | |
* - v0.0 RC - 2014-08-08 - 13h01 : initial release | |
* - v0.1 RC - 2014-08-08 - 13h29 : DogeScript support | |
* | |
* Licensed under WTFPL | |
* |
This file contains 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
/* | |
from : http://en.wikipedia.org/wiki/Mersenne_twister | |
*/ | |
let MT | |
let index | |
class PRNG { | |
static setSeed(seed) { | |
// Create a length 624 array to store the state of the generator | |
MT = new Uint32Array(624) | |
index = 0 |
This file contains 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
<?php | |
$url = ""; | |
if( isset( $_GET['url'] ) ) | |
{ | |
$url = $_GET[ 'url' ]; | |
} | |
else | |
{ |
This file contains 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
/** | |
* converts a XYZ vector3 to longitude latitude (Direct Polar) | |
* @param lng longitude | |
* @param lat latitude | |
* @param vector3 optional output vector3 | |
* @returns a unit vector of the 3d position | |
*/ | |
function lonLatToVector3( lng, lat, out ) | |
{ | |
out = out || new THREE.Vector3(); |
This file contains 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
/** | |
* checks if a value has a given bit set to 1 | |
* @value the int / uint to test | |
* @mask the bits to check | |
**/ | |
function bit_isset( value, mask ) | |
{ | |
return ( value & mask ) != 0; | |
} |
This file contains 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
/* | |
the quick sort method is described here : | |
http://antjanus.com/blog/web-development-tutorials/understanding-quicksort-js-native-implementation/ | |
*/ | |
function tripletSort( arr ) | |
{ |
This file contains 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
/** | |
* creates a noise on the specified 2d context's canvas | |
* @ctx a 2d context | |
* @rgba color code specifies which channels are affected (default = 0 ) | |
* @min noise lower bound ( >= 0 ) | |
* @max noise upper bound ( <= 0xFF ) | |
* */ | |
function noise( ctx, rgba, min, max ) | |
{ |
This file contains 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
var console = (window.console = window.console || {}); | |
var original = console[ 'log' ]; | |
console[ "log" ] = function() | |
{ | |
var args = Array.prototype.slice.apply( arguments ); | |
original.apply( console, args ); | |
try | |
{ | |
throw new Error(); | |
} |
This file contains 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 dijkstra( graph_array, source, target) | |
{ | |
//builds adjacency list | |
var vertices = []; | |
var neighbours = {}; | |
graph_array.forEach( function( edge ) | |
{ | |
//store the vertex 0 |
This file contains 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
<style> | |
html, body{ | |
width:100%; | |
height:100%; | |
overflow: hidden; | |
top:0; | |
left:0; | |
margin:0; | |
padding:0; | |
} |
OlderNewer