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 | |
/** | |
* Prints debug info for the current request. | |
* Works well interest just after the opening <head> tag in your header template | |
*/ | |
function nigelheap_debug_request() { | |
global $wp, $template; |
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 | |
/** | |
* Returns an array of all meta values over all posts of a certain type based on a key, can be unique or not | |
*/ | |
function nigelheap_get_meta_values($key = '', $type = 'post', $status = 'publish', $unique = true) { | |
global $wpdb; | |
if( empty( $key ) ) |
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 | |
use Illuminate\Support\Collection; | |
if (! Collection::hasMacro('pluckWithKey')) { | |
/* | |
* Keeps the key from the original array while plucking the value from the child array. | |
* Useful for pulling keyed config form the config files | |
* | |
* Example: If you have this: |
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
MYSQL_USER=root | |
MYSQL_PASS=root | |
MYSQL_CONN="-u${MYSQL_USER} -p${MYSQL_PASS}" | |
# | |
# Collect all database names except for | |
# mysql, information_schema, and performance_schema | |
# | |
for f in dbs/*.sql | |
do |
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
MYSQL_USER=root | |
MYSQL_PASS=root | |
MYSQL_CONN="-u${MYSQL_USER} -p${MYSQL_PASS}" | |
# | |
# Collect all database names except for | |
# mysql, information_schema, and performance_schema | |
# | |
SQL="SELECT schema_name FROM information_schema.schemata WHERE schema_name NOT IN" | |
SQL="${SQL} ('mysql','information_schema','performance_schema')" |
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
window.console.log.apply(console, [ | |
'\ %c Made by Itomic %c %c %c http://www.itomic.com.au %c \n\n', | |
'color: #fff; background: #1dbeea ; padding:5px 0;', | |
'background: #1dbeea ; padding:5px 0;', | |
'background: #222222 ; padding:5px 0;', | |
'color: #fff; background: #222222 ; padding:5px 0;', | |
'background: #fff; padding:5px 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
/** | |
* Dsu local alias | |
*/ | |
$aliases['dsu'] = array( | |
'root' => '/home/username/public_html', | |
'uri' => 'domain.com', | |
'path-aliases' => array( | |
'%dump-dir' => '/tmp', | |
), |
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
jQuery('.btResOn').click(function(){ | |
__gaTracker('send', { | |
hitType: 'event', | |
eventCategory: 'reserva', | |
eventAction: 'contacto', | |
eventLabel: 'reserva' | |
}); | |
}); |
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
#!/usr/bin/env bash | |
# Use this one-liner to produce a JSON literal from the Git log: | |
git log \ | |
--pretty=format:'{%n "commit": "%H",%n "author": "%an <%ae>",%n "date": "%ad",%n "message": "%f"%n},' \ | |
$@ | \ | |
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \ | |
perl -pe 's/},]/}]/' |
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 | |
$g = stream_context_create( | |
array("ssl" => array( | |
"capture_peer_cert" => true | |
) | |
) | |
); | |
$url = 'itomic.com.au'; |