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 | |
error_reporting(E_ALL); | |
$opts = getopt('f:d:rb:', ['ext:', 'php:', 'diff::']); | |
if ((int)isset($opts['d']) + (int)isset($opts['f']) !== 1) { | |
$self = basename(__FILE__); | |
echo <<<EOF | |
Usage: | |
php $self -f<php_script> [-b] [--php <path_to_php>] [ --diff [<file>]] |
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 | |
// Client: Pings server, gets reply. Exits. | |
$zmq = new ZMQContext; | |
$sock = new ZMQSocket( $zmq, ZMQ::SOCKET_REQ ); | |
$sock->connect('tcp://localhost:5555'); | |
echo "Pinging..\n"; | |
$sock->send('Ping'); |
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 | |
# Rotates disk image backups inside working directory | |
# Maintains a rolling window of 4 hourly snapshots (uncompressed) | |
# Plus 7xdays and 6xmonths of older compressed archives | |
# config | |
HOURS=4 | |
DAYS=7 | |
MONTHS=6 |
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 | |
function runTest( MongoDB\Driver\WriteConcern $writeConcern ){ | |
$bulk = new MongoDB\Driver\BulkWrite(['ordered'=>false]); | |
for( $i = 0; $i < 10000; $i++ ){ | |
$bulk->insert( [ | |
'time' => new MongoDB\BSON\UTCDateTime, | |
] ); | |
} |
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: Loco Webhook | |
Description: Monitors changes to PO files during save operations | |
Author: Tim Whitlock | |
*/ | |
class LocoWebhook { | |
private $path; |
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: Valencia variant | |
Description: Makes "ca" locale appear like "ca-valencia" in Loco Translate | |
Author: Tim Whitlock | |
Version: 1.0.0 | |
*/ | |
// Only running for admin screens |
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
#, fuzzy | |
msgid "" | |
msgstr "" | |
"Project-Id-Version: BuddyPress 2.9.3\n" | |
"Report-Msgid-Bugs-To: \n" | |
"POT-Creation-Date: 2018-02-10 15:18+0000\n" | |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | |
"Language-Team: \n" | |
"Language: \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
<?php | |
/* | |
Plugin Name: Preload SSH class | |
Plugin URI: https://wordpress.org/support/topic/conflict-with-ssh-sftp-updater-support-ssh2-fs_method/ | |
Description: Ensures custom SSH2 class is loaded before autoloader is triggered by class_exists | |
Author: Tim Whitlock | |
*/ | |
function filter_filesystem_method( $method = '' ){ | |
if( 'ssh2' === $method && ! class_exists('WP_Filesystem_SSH2',false) ){ |
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: Disable auto translation updates | |
Description: Prevents WordPress from automatically updating translation files in the global languages directory. | |
Author: Tim Whitlock | |
Version: 1.0 | |
*/ | |
/** |
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: Loco Standalone Loader | |
Description: Mimics Loco_hooks_LoadHelper without dependency on the main plugin | |
Author: Tim Whitlock | |
Version: 1.0 | |
*/ | |
new LocoStandaloneLoadHelper; |
NewerOlder