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 | |
/** | |
* Base interface for PHP HTML elements | |
* | |
* Interface HtmlElement | |
*/ | |
interface HtmlElement { | |
/** |
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
/** | |
* Flatten a multidimensional array. | |
* | |
* @param {Array.<T>} multidimentionalArray | |
* @returns {Array.<T>} | |
*/ | |
function flattenArray(multidimentionalArray) { | |
return [].concat.apply([], multidimentionalArray); | |
} |
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 is in the range (inbetween) the | |
* value of a and b. Will also return true if equal to | |
* either value. | |
* | |
* @param {number} value | |
* @param {number} a | |
* @param {number} b | |
* @returns {boolean} | |
*/ |
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
/** | |
* Finds the difference between two numbers. | |
* | |
* @param {number} a | |
* @param {number} b | |
* @returns {number} | |
*/ | |
function difference(a, b) { | |
return Math.abs(a-b); | |
} |
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
/** | |
* Retrieves the file extension from a string. | |
* | |
* @param {string} filename | |
* @returns {string} | |
*/ | |
function fileExtension(filename) { | |
return filename.substr(filename.lastIndexOf('.') + 1); | |
} |
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
/** | |
* Linear interpolation (LERP). | |
* | |
* Returns a value between value a to value b over t (0 to 1). | |
* | |
* @param {number} a | |
* @param {number} b | |
* @param {number} t | |
* @returns {number} | |
*/ |
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
/** | |
* Time, a singleton for getting current time and delta time. | |
* I.e. Time.time or Time.deltaTime | |
* | |
* @returns {*} | |
* @constructor | |
*/ | |
var Time = function() { | |
// Singleton is returned if avalible else it is made. | |
if (Time.prototype._singletonInstance) |
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
/** | |
* Clamps a value to within the min or max values given. | |
* | |
* @param {number} value | |
* @param {number} min | |
* @param {number} max | |
* @returns {number} | |
*/ | |
function clamp(value, min, max) { | |
return Math.min(Math.max(value, 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
<?php | |
/** | |
* Configures xDebug to truncate given values. | |
*/ | |
ini_set('xdebug.var_display_max_data', -1); | |
ini_set('xdebug.var_display_max_children', -1); | |
ini_set('xdebug.var_display_max_depth', -1); |
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
/** | |
* Gets the browser name or returns an empty string if unknown. | |
* This function also caches the result to provide for any | |
* future calls this function might have. | |
* | |
* @returns {string} | |
*/ | |
var browser = function() { | |
// Return cached result if avalible, else get result then cache it. | |
if (browser.prototype._cachedResult) |
OlderNewer