I hereby claim:
- I am dongilbert on github.
- I am dongilbert (https://keybase.io/dongilbert) on keybase.
- I have a public key whose fingerprint is 11E8 E1EB C4AC 096D 18B1 2D07 73BC 273C 63F2 EDFE
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<?php | |
namespace Entities; | |
abstract class AbstractBaseEntity | |
{ | |
protected $entityData = []; | |
final public function __construct($data = []) | |
{ |
<?php | |
function benchmark($name, $iterations, Closure $function) | |
{ | |
echo "Starting Benchmark: {$name} (".number_format($iterations)." Iterations)\n"; | |
$start = microtime(true); | |
for ($i = 0; $i < $iterations; $i++) { | |
$function(); | |
} | |
$elapsed = microtime(true) - $start; |
/** | |
* Helper function for registering and loading scripts and styles. | |
* Uses regex to determine if the file is CSS or JavaScript and calls | |
* the proper WordPress register and enqueue functions accordingly. | |
* | |
* @name ID to register with WordPress | |
* @file_path Path to actual file, relative to your plugin or theme, without preceding slash. | |
* @for Whether this is for a plugin or a theme. | |
*/ | |
function load_file($name, $file_path, $for = 'plugin') { |
<?php | |
/** | |
* This script outputs an array of file hashes recursively for the current directory. | |
* Useful for generating hashlist for security scanning programs | |
* | |
*/ | |
function recursive_md5($dir, $types = null, $recursive = true, $baseDir = '') | |
{ | |
$to_ignore = array( | |
'.', |
<?php | |
// URL Encode the address | |
$address = urlencode($data['storelocator']['address']); | |
// Get the JSON response from google. You can also get XML by changing geocode/json to geocode/xml | |
$geo = file_get_contents('http://maps.google.com/maps/api/geocode/json?sensor=false&address='.$address); | |
// Decode the results into an Object | |
$result = json_decode($geo); |
/* | |
* This is a base container for | |
* whenever I use jQuery Cycle. | |
* http://jquery.malsup.com/cycle/ | |
* | |
* Use this as base HTML | |
* | |
* <div id="slider"> | |
* <div id="slides"> | |
* <div class="slide" style="display:block">...</div> |
/* | |
* This goes at the top of your plugin edit view, | |
* and will ask for confirmation before you leave. | |
* Be sure to replace viewname with your controller | |
* name, shortened. If you follow 2.5 guidelines | |
* with sub controllers that handel specific parts | |
* of the application, then this will work fine. | |
*/ | |
Joomla.submitbutton = function(task) { |
-- Old Post Meta sometimes creeps | |
-- in from manually deleting revisions | |
-- and other things direct from the | |
-- database. Using this SQL below | |
-- you can remove the postmeta remnants | |
-- that have been left behind. | |
DELETE a | |
FROM wp_postmeta AS a | |
LEFT JOIN wp_posts AS b |
<?php | |
/** | |
* Paste this code in your theme's functions.php | |
* file and wherever you normally would call | |
* `get_option_tree('option-name');`, use | |
* `get_theme_option('option-name');` instead. | |
* This will pass through the already retrieved | |
* global $option_tree (called when your theme loads) | |
* and save you from several additional database | |
* calls on a single page request. |