View dev-plugins.php
<?php
/**
* Plugin Name: Dev Plugins
*/
add_action( 'muplugins_loaded', function() {
// Plugins to activate automatically.
$auto_activate = [
'debug-bar/debug-bar.php',
'debug-bar-extender/debug-bar-extender.php',
View mail-notice.md
<some-command> | tee some.log ; \
  ( [[ ${PIPESTATUS[0]} -eq 1 ]] \
  && (tail some.log | mail -s '<some-command> exited with error' you@example.com) \
  || (tail some.log | mail -s '<some-command> finished' you@example.com) )

breakdown:

<some-command> | tee some.log;

View bad-script.sh
#!/bin/bash
echo "mua hahah"
exit

# Uses an escape sequence to move the cursor up.
# So if you `cat` this file, it will hide the "bad" part
# But if you execute the file, the "bad" will be done.
# Try `cat -v` to expose the escape characters.
echo "gooooood file"
View backups.sh
#!/bin/bash
#
# Back up my files and databases
#
#
# backup_static_if <fullpath> <shortname>
# use directory fingerprint to avoid unnecessary backups
#
View auto-update.md

Moved

Update core (and db), plugins, and themes, logging status to syslog. Ideal for running on a cronjob

Example of syslog

Apr 26 04:07:56 vvv vagrant: [WPAutoUpdate] Local WordPress Dev | http://local.wordpress.dev
Apr 26 04:08:27 vvv vagrant: [WPAutoUpdate] Core update: WordPress updated successfully to 4.5
Apr 26 04:08:28 vvv vagrant: [WPAutoUpdate] DB update: WordPress database already at latest db version 36686
View wp-excerpt-change.php
<?php
// Plugin Name: Example. Change "Excerpt" meta box heading
namespace KDL\excerpt_change;
function filter_excerpt( $translations, $text, $domain ) {
if ( $text == 'Excerpt' ) {
return "New Excerpt";
}
View swap-admin-color.php
<?php
/**
* Plugin Name: Swap color scheme on local dev/stage
*/
/**
* Hotswap an alternate color scheme
*
* @param string $result Original value
* @param string $option Option name
View tarball-select-uploads.md

create tarball of only end of 2015 and 2016

cd wp-content/uploads/sites/
find 5/ -regextype sed -regex ".*/\(2015/1\|2016\).*" | tar -czvf uploads.tar.gz --files-from -
View meta-to-term-cli.php
<?php
if ( !defined( 'WP_CLI' ) ) return;
/**
* Migrate meta values to terms
*
* @package wp-cli
*/
class Meta_To_Term_Migration extends WP_CLI_Command {
View toggle-debug.php
<?php
/*
Plugin Name: Toggle Debug
Description: Proof-of-concept for an admin-bar debug mode toggle. Needs some UX love.
*/
/*
// In wp-config.php, wrap debug constants in a cookie conditional
if ( isset( $_COOKIE['wp-debug'] ) && $_COOKIE['wp-debug'] == 'on' ) {
define('WP_DEBUG', true);
}