This file contains hidden or 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 | |
$to = "[email protected]"; | |
$subject = "My Multipart test"; | |
$message = "I am the plain text message"; | |
$boundary = uniqid(rand(), true); | |
$header = "MIME-Version: 1.0\n" |
This file contains hidden or 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 | |
OPTIND=1 | |
verbose=0 | |
dbuser="" | |
dbpasswd="" | |
while getopts "vh?U:P:H:" opt; do | |
case "$opt" in |
This file contains hidden or 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: WP Minions Post Pusher | |
* Description: Pushes all published posts to one blog using wp-minions | |
* Version: 1.0 | |
* Author: Thorsten ott | |
* Author URI: http://thorsten-ott.de/ | |
* License: GPLv2 or later | |
*/ |
This file contains hidden or 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 | |
# ./curl-urls.sh numprocessses http://urltograp urlpattern | |
# ./curl-urls.sh 3 http://www.domain.com domain.com | |
numprocessses=$1 | |
baseurl=$2 | |
urlpattern=$3 | |
function forky() { | |
local num_par_procs | |
if [[ -z $1 ]] ; then |
This file contains hidden or 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
/** | |
* Disable xmlrpc | |
*/ | |
if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { | |
include_once(ABSPATH . WPINC . '/class-IXR.php'); | |
class blocking_xmlrpc_server { | |
function serve_request() { | |
$response = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site.' ) ) ); | |
die( $response->getXml() ); |
This file contains hidden or 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 i in `wp site list | cut -f 2 | grep -v url`; do wp --url=$i eval 'global $wpdb, $blog_id; $blogname=get_option("blogname"); $blogurl=home_url(); $domains=$wpdb->get_results( "SELECT * FROM {$wpdb->dmtable} WHERE blog_id = $blog_id;" ); foreach( $domains as $data ) { echo $blog_id.",".$blogname.",".$blogurl.",".$data->domain.",".$data->active."\n"; }'; done |
This file contains hidden or 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 maybe_flush_rules() { | |
global $wp_rewrite; | |
$rewrite_rules = get_option( 'rewrite_rules' ); | |
foreach( $rewrite_rules as $rule => $rewrite ) { | |
$rewrite_rules_array[$rule]['rewrite'] = $rewrite; | |
} | |
$maybe_missing = $wp_rewrite->rewrite_rules(); | |
$missing_rules = false; | |
$rewrite_rules_array = array_reverse( $rewrite_rules_array, true ); | |
foreach( $maybe_missing as $rule => $rewrite ) { |
This file contains hidden or 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 | |
/** | |
* Helper script that can be run in cron to bug you when you forgot to run a harvest timer. | |
* install terminal-notifier via: | |
* sudo gem install terminal-notifier | |
* Make sure to adjust your credentials. | |
* Schedule via crontab -e to run weekdays 9-5 | |
* <star>/10 09-17 * * 1-5 php <path-to-script> | |
* replace <star> with * | |
*/ |
This file contains hidden or 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
add_action( 'admin_init', 'deregister_autosuggest' ); | |
function deregister_autosuggest() { | |
if ( is_admin() ) { | |
wp_deregister_script( 'suggest' ); | |
} | |
} |
This file contains hidden or 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 (!Array.prototype.indexOf) { | |
Array.prototype.indexOf = function (searchElement, fromIndex) { | |
if ( this === undefined || this === null ) { | |
throw new TypeError( '"this" is null or not defined' ); | |
} | |
var length = this.length >>> 0; // Hack to convert object.length to a UInt32 | |
fromIndex = +fromIndex || 0; |