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 modulo(dividend, divisor){ | |
while (dividend >= divisor){ | |
dividend -= divisor; | |
} | |
return dividend; | |
} |
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
/* | |
A shim for non ES5 supporting browsers. | |
Adds function bind to Function prototype, so that you can do partial application. | |
Works even with the nasty thing, where the first word is the opposite of extranet, the second one is the profession of Columbus, and the version number is 9, flipped 180 degrees. | |
*/ | |
Function.prototype.bind = Function.prototype.bind || function(to){ | |
// Make an array of our arguments, starting from second argument | |
var partial = Array.prototype.splice.call(arguments, 1), | |
// We'll need the original function. |
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
/** | |
* Does nothing (useful) for a specified time. | |
* | |
* @param {Uint} The time to sleep, in milliseconds. | |
*/ | |
function sleep(t){var m=+new Date+t;while(+new Date<m);} | |
// Please note that this is a pattern that is hardly useful, never advisable and a bit intensive. |
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
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 |
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
str = "asas"; | |
int = (str.charCodeAt(0) << 24) + (str.charCodeAt(1) << 16) + (str.charCodeAt(2) << 8) + str.charCodeAt(3); |
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(g){ | |
var urlPath = | |
window.URL ? 'URL' : | |
window.webkitURL ? 'webkitURL' : | |
window.mozURL ? 'mozURL' : | |
window.msURL ? 'msURL' : | |
window.oURL ? 'oURL' : ''; | |
var blobPath = |
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(g){ | |
/*var URL = | |
window.URL || | |
window.webkitURL || | |
window.mozURL || | |
window.msURL || | |
window.oURL; | |
var BlobBuilder = |
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> | |
<script src="inline-worker.js"></script> | |
</script> | |
</head> | |
<body> | |
<div id="log"></div> | |
<script> | |
inlineWorker.onready(function(){ |
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 (global, prefixes, timeouts, id, i) { | |
if (typeof process !== 'undefined' && process && process.nextTick) { | |
global.setImmediate = function (callback, args) { | |
var i = id; | |
timeouts[id] = { | |
c: callback, | |
a: args || [], | |
}; |
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 (define, names) { | |
if (!define || !names.forEach) return; | |
names.forEach(function (name) { | |
define(Number.prototype, name, { | |
value: function () { | |
return Math[name].apply( | |
Math, | |
[this].concat([].slice.call(arguments)) |
OlderNewer