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 | |
function run_cron_due_now { | |
for SITE_URL in $(wp --allow-root site list --fields=url --format=csv | tail -n +2 | sort); do | |
wp --allow-root cron event run --due-now --url="$SITE_URL" && echo -e "\t+ Completed Crons for $SITE_URL" & | |
done | |
wait $(jobs -p) | |
echo "Done" | |
} |
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 set_to_exact( $formatted_args, $args ) { | |
if ( ! empty( $formatted_args['query']['bool']['should'] ) ) { | |
$formatted_args['query']['bool']['must'] = $formatted_args['query']['bool']['should']; | |
$formatted_args['query']['bool']['must'][0]['multi_match']['operator'] = 'AND'; | |
unset( $formatted_args['query']['bool']['should'] ); | |
unset( $formatted_args["query"]["bool"]["must"][0]["multi_match"]["type"] ); | |
} | |
return $formatted_args; | |
} | |
add_filter( 'ep_formatted_args', 'set_to_exact', 10, 2 ); |
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
add_filter( | |
'ep_formatted_args', | |
function( $formatted_args ) { | |
if ( ! empty( $_GET['s'] ) ) { | |
foreach ( [ 'post_title', 'post_excerpt', 'author_name', 'terms.post_tag.name', 'terms.category.name' ] as $field ) { | |
$formatted_args['highlight']['fields'][ $field ] = [ | |
'pre_tags' => [ '<strong style="background:yellow">' ], | |
'post_tags' => [ '</strong>' ], | |
'type' => 'plain', | |
]; |
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: 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 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
#!/usr/bin/env python | |
import sys | |
import array | |
import usb.core | |
import usb.util | |
import os | |
path = "/tmp/backlight-value" | |
# decimal vendor and product values |
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
# Force www | |
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ | |
RewriteCond %{HTTPS}s ^on(s)| | |
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
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 | |
$to = "receipt@domain.com"; | |
$subject = "My Multipart test"; | |
$message = "I am the plain text message"; | |
$boundary = uniqid(rand(), true); | |
$header = "MIME-Version: 1.0\n" |
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 | |
OPTIND=1 | |
verbose=0 | |
dbuser="" | |
dbpasswd="" | |
while getopts "vh?U:P:H:" opt; do | |
case "$opt" in |
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 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 |