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 | |
/** | |
* Exactly the same as array_filter except this function | |
* filters within multidimensional arrays | |
* | |
* @param array $array | |
* @param callable|null $callback optional filter callback function | |
* @param bool $remove_empty_arrays optional flag removal of empty arrays after filtering | |
* |
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 | |
// patterns | |
$patterns = array( ); | |
for ($i = 0; $i < 20; ++$i) { | |
// the generic alternating patterns |
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 | |
/** function get_index | |
* | |
* Gets the FEN string index for a 2D location | |
* of a square array of blocks each containing | |
* a square array of elements within those blocks | |
* | |
* This was designed for use within foreach structures | |
* The first foreach ($i) is the outer blocks, and the |
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 | |
/* | |
Find the length of the longest increasing sequence through adjacent numbers | |
(including diagonals) in a rectangular grid of numbers in a language of your | |
choice. The solution should handle grids of arbitrary width and height. | |
For example, in the following grid, one legal path (though not the longest) | |
that could be traced is 0->3->7->9 and its length would be 4. |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
/* | |
Combine multiple SQL files using PHP command line. | |
Will combine to current working directory | |
Best used with files that were split using the SQL splitter: split.php | |
Will prepend and append the _root_.sql and _end_.sql files if found | |
Arguments: |
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
//http://stackoverflow.com/questions/30492259/get-a-random-number-focused-on-center | |
// max is non-inclusive | |
// bellFactor = 1 is normal flat RNG | |
// bellFactor = 2 is sawtooth shaped | |
// bellFactor = 4 is basic bell curve | |
function weightedRandom(max, bellFactor) { | |
max = parseInt(max, 10); | |
bellFactor = parseInt(bellFactor || 1, 10); | |
if (bellFactor < 1) { | |
bellFactor = 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
; // the thing | |
(function($) { | |
"use strict"; | |
/** | |
* The Thing | |
* | |
* @constructor | |
*/ |
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 | |
/** function my_round | |
* | |
* rounds a value to the closest value | |
* starting at another value | |
* e.g.- my_round(6.28318, 5, 2) => 7 | |
* | |
* To round to closest of: | |
* 2 6 10 14 18 22 ... |
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
<div class="loader"> | |
<svg width="2.4em" height="2.4em"> | |
<!-- unit circle --> | |
<circle cx="1.2em" cy="1.2em" r="1em"/> | |
</svg> | |
</div> |
OlderNewer