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
from datetime import date, strftime | |
def _list_years(self): | |
x = 1 | |
years = () | |
today = date.today() | |
for x in range(15): | |
year = today - timedelta(days=365 * x) | |
years += (year.strftime('%Y'),) | |
x += 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
curl -s -w %{time_total}\\n -o /dev/null http://www.site.com |
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
// Function to automatically pop up lightbox window. | |
if (window.location.hash) { | |
var hash = window.location.hash; | |
if (hash == '#registration_form') { | |
$('.fancybox').fancybox().trigger('click'); | |
} | |
} |
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 echo $GLOBALS['wp_query']->request; ?> |
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 extract_subdomain () { | |
$url_parts = explode( '.',$_SERVER['HTTP_HOST'] ); | |
unset( $url_parts[0] ); | |
$domain = implode( '.', $url_parts ); | |
return $domain; | |
} | |
?> |
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 display_custom_template( $template ) { | |
echo '<!--TEMPLATE:'.$template.'-->'; | |
} | |
add_filter( 'template_include', 'display_custom_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
// Debug mode (uncomment below to enter debug mode) | |
define('WP_DEBUG', true); | |
error_reporting(E_ALL); | |
ini_set('display_errors', True); |
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
// For debugging - show template file | |
add_action('wp_head', 'show_template'); | |
function show_template() { | |
global $template; | |
?><!-- TEMPLATE: <?php print_r($template);?>--><?php | |
} |