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 | |
// Whitelist default double click url | |
add_filter( 'acm_whitelisted_script_urls', 'rk_acm_whiltelisted_script_urls'); | |
function rk_acm_whiltelisted_script_urls( $whitelisted_urls ) { | |
$whitelisted_urls = array( 'ad.doubleclick.net' ); | |
return $whitelisted_urls; | |
} | |
// Tokenize url | |
add_filter( 'acm_default_url', 'rk_acm_default_url' ) ; |
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 it as [google-cse id="your-google-cse-id"] | |
* Might need a little tweaking | |
*/ | |
add_shortcode( 'google-cse', 'localtv_google_cse_shortcode' ); | |
function localtv_google_cse_shortcode( $atts ) { | |
extract( | |
shortcode_atts( | |
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 | |
/** | |
* Easily get post meta value for Custom Metaboxes and Fields plugin | |
* | |
* @see https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress | |
* | |
* @param string $key to retrieve | |
* @param bool $echo if true then echo value | |
* @param string $sanitize_callback sanitize value with this callback | |
* @param string $cmb_prefix prefix of post meta |
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 | |
/** | |
* Additional setup for our freshly baked Ad Code Manager v0.2 | |
* Not tested with v0.1 | |
* | |
* Quick config for DFP JS API | |
* | |
*/ | |
// Add additional output tokens |
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 | |
/** | |
* Shortcode callback [video5 src="" width="" height=""] | |
* | |
* @param array atts shortcode atts | |
* @return string HTML5 video tag | |
*/ | |
add_shortcode( 'video5', function( $atts, $content = null ) { | |
global $content_width; |
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 | |
add_filter( 'acm_output_html', 'my_acm_output_html', 10, 2 ); | |
function my_acm_output_html( $output_html, $tag_id ) { | |
switch ( $tag_id ) { | |
case 'my_leaderboard': | |
$output_html = '<a href="%url%"><img src="%image_url%" /></a>'; | |
break; | |
case 'rich_media_leaderboard': | |
$output_html = '<script> // omitted </script>'; | |
break; |
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
server { | |
## Your website name goes here. | |
server_name example.com; | |
listen 80; | |
## Your only path reference. | |
root /home/my/example/path/to/site; | |
error_log logs/example-error.log error; | |
access_log logs/example-access.log; | |
client_body_timeout 180; | |
client_body_buffer_size 8K; |
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 | |
add_action( 'init', 'x_maintenance_mode' ); | |
function x_maintenance_mode() { | |
if ( defined( 'X_MAINTENANCE_MODE' ) && true === X_MAINTENANCE_MODE ) { | |
if ( is_super_admin() && is_admin() ) | |
return; | |
die( 'Site is currently under maintenance' ); |
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 | |
#use it like this: git-to-svn.sh /path/to/git/repo /path/to/svn/trunk | |
if [ -z "$1" ]; then | |
printf "\033[31;40mYou haven\'t specified the path to copy from\n" | |
printf "\033[00m" | |
fi | |
if [ -z "$2" ]; then | |
printf "\033[31;40mYou haven\'t specified the path to copy to\n" | |
printf "\033[00m" | |
exit |
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 | |
# | |
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html) | |
# modified by [email protected] | |
# modified by aconway@[redacted] - handle diffs that introduce new files | |
# | |
# Generate an SVN-compatible diff against the tip of the tracking branch | |
# Get the tracking branch (if we're on a branch) | |
TRACKING_BRANCH=`git svn info | grep URL | sed -e 's/.*\/branches\///'` |
OlderNewer