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 | |
/* | |
Description: A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes. | |
Author: Stephen Harris | |
Author URI: http://www.stephenharris.info | |
*/ | |
/* Copyright 2011 Stephen Harris ([email protected]) | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by |
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
AddType text/cache-manifest manifest | |
RewriteEngine On | |
# Put your installation directory here: | |
# If your URL is www.example.com/, use / | |
# If your URL is www.example.com/site_folder/, use /site_folder/ | |
RewriteBase / | |
# Do not enable rewriting for files or directories that exist |
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
# LESS compiler | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} ^(.*)\.css | |
RewriteCond %1.less -f | |
RewriteRule ^(.*)\.css lessphp/less.php?f=$1.less |
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
/** | |
Uploading files | |
Taken from: http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/ | |
INSTRUCTIONS: | |
In the page you wish to use this script you'll need to enque the media scripts and this script. | |
Then create a input box and a button with NOTHING in between.. with the class 'upload_image_button' | |
<?php | |
wp_enqueue_media(); |
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() { | |
var script, | |
scripts = document.getElementsByTagName('script')[0]; | |
function load(url) { | |
script = document.createElement('script'); | |
script.async = true; | |
script.src = url; | |
scripts.parentNode.insertBefore(script, scripts); |
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 | |
// PHP Logical operators: The difference between OR vs ||, AND vs && | |
// Key concept #1: "||" and "&&" have greater precedence than "=", "OR", "AND" | |
// http://php.net/manual/en/language.operators.precedence.php | |
// Key concept #2: PHP logical operators are short-circuit | |
// http://en.wikipedia.org/wiki/Short-circuit_evaluation | |
// http://php.net/manual/en/language.operators.logical.php |
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
#!/bin/bash | |
#start | |
#----------------------------------------------------------------------- | |
find /srv/backup/daily/databases/ -name '*.gz' -mtime +7 | xargs rm -f; | |
find /srv/backup/daily/websites/ -name '*.gz' -mtime +7 | xargs rm -f; | |
# Are Weekly Backups Implemented? | |
# find /srv/backup/weekly/ -name '*.gz' -mtime +30 | xargs rm -f; | |
#----------------------------------------------------------------------- | |
#end |
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
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
* Tip: http://pivotallabs.com/users/jdean/blog/articles/1400-working-with-asynchronously-loaded-javascript | |
*/ | |
(function(doc, script) { | |
var js, |
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
[ | |
{name: 'Afghanistan', code: 'AF'}, | |
{name: 'Åland Islands', code: 'AX'}, | |
{name: 'Albania', code: 'AL'}, | |
{name: 'Algeria', code: 'DZ'}, | |
{name: 'American Samoa', code: 'AS'}, | |
{name: 'AndorrA', code: 'AD'}, | |
{name: 'Angola', code: 'AO'}, | |
{name: 'Anguilla', code: 'AI'}, | |
{name: 'Antarctica', code: 'AQ'}, |
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( |
OlderNewer