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
/* REMOVE SELF PINGING */ | |
function remove_self_pinging(&$links,&$pung) { | |
$self = get_option('siteurl'); | |
foreach ($links as $link => $data) { | |
if (false !== strpos($link,$self)) | |
unset($links[$link]); | |
} | |
} | |
add_action('pre_ping','remove_self_pinging',0,2); | |
/* END REMOVE SELF PINGING */ |
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 | |
/* | |
Plugin Name: [RPC] XMLRPCless Blog | |
Plugin URI: http://earnestodev.com/ | |
Description: Disable XMLRPC advertising/functionality blog-wide. | |
Version: 0.0.7 | |
Author: EarnestoDev | |
Author URI: http://earnestodev.com/ | |
*/ | |
// Disable X-Pingback HTTP Header. |
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 | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. You can find more information | |
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing | |
* wp-config.php} Codex page. You can get the MySQL settings from your web host. | |
* | |
* This file is used by the wp-config.php creation script during the |
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
branch=$(git rev-parse --symbolic --abbrev-ref $1) | |
branch=$(echo $1 | awk -F'/' '{print $3}') | |
if [ ! -f $1 ]; then | |
echo "Branch $branch was deleted! Do something then.." | |
else | |
echo "Branch $branch was updated! Do something then.." | |
fi |
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
if [ `git rev-parse --abbrev-ref HEAD` == "development" ]; then | |
echo "development-script" | |
elif [ `git rev-parse --abbrev-ref HEAD` == "staging" ]; then | |
echo "staging-script" | |
elif [ `git rev-parse --abbrev-ref HEAD` == "production" ]; then | |
echo "production-script" | |
fi |
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 | |
MYSQL="/opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper" | |
NGINX="/opt/local/sbin/nginx" | |
PHPFPM="/opt/local/sbin/php-fpm" | |
PIDPATH="/opt/local/var/run" | |
MEMCACHED="/opt/local/bin/memcached -m 24 -P /opt/local/var/run/memcached.pid -u root" | |
if [ $1 = "start" ]; then | |
sudo $MYSQL start | |
echo "Starting php-fpm ..." |
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
/** | |
* Wrapper around get_posts that utilizes object caching | |
* | |
* @access public | |
* @param mixed $args (default: NUL) | |
* @param bool $force_refresh (default: false) | |
* @return void | |
*/ | |
function get_posts_cached( $args = NULL, $force_refresh = false ) { | |
$cache_incrementor = wp_cache_get( 'get_posts_cached', 'cache_incrementors' ); |
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
location ~* /(wp-login\.php|administrator|admin\.php) { | |
set $humantest 0; | |
if ($http_cookie !~* "humans=fucking_love_cookies") { | |
set $humantest 1; | |
} | |
if ($args ~* (callback|logout|lostpassword)) { | |
set $humantest 0; | |
} | |
if ($humantest = 1) { | |
add_header Content-Type text/html; |
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 | |
session_start(); // start the current/old session (loads the $_SESSION variables) | |
$base_name = '/sess_'; // the base name for the session data files | |
$old_sessionid = session_id(); // get the current/old id | |
$_SESSION['test'] = 123; // some test data | |
session_regenerate_id(); // generate a new id and a new data file | |
$new_sessionid = session_id(); // get the new session id to store in the user table for the current visitor |
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
$GLOBALS['wp_object_cache']->delete( 'your_option_name', 'options' ); | |
$value = get_option( 'your_option_name' ); |
OlderNewer