Skip to content

Instantly share code, notes, and snippets.

SKU Stock
002100 10
015626 16
015771 8
015774 34
015775 20
015776 56
015777 42
015778 48
024051 1
#!/bin/sh
# Watch for cloudflared failures and restart the service.
#
# This is necessary due to a known issue between cloudflared and Raspberry Pis:
# https://github.com/cloudflare/cloudflared/issues/23
#
# Script based on reddit thread:
# https://www.reddit.com/r/pihole/comments/b94dcr/cloudflare_dns_over_https_doesnt_work_after_a/err2rbj/
#
<?php
// Drop this file into wp-content/mu-plugins.
// Test 1 - Remove Feedback callbacks from data export/erasure tools.
// Uncomment the next two lines to test.
//add_filter( 'wp_privacy_personal_data_exporters', 'remove_feedback_callback', 20 );
//add_filter( 'wp_privacy_personal_data_erasers', 'remove_feedback_callback', 20 );
function remove_feedback_callback( $callbacks ) {
unset( $callbacks['jetpack-feedback'] );
@coreymckrill
coreymckrill / wordpress
Created May 9, 2018 21:55
Bash functions for contributing to WordPress
# !/bin/bash
# Apply a Trac patch.
#
# See http://scribu.net/wordpress/contributing-to-wordpress-using-github.html
#
# $1 - The URL of the patch.
# $2 - Optional. Number of leading slashes in the prefix to strip. Default 0.
# $3 - Optional. The VCS to use. 'svn' or 'git'. Default 'svn'.
function tracpatch() {
@coreymckrill
coreymckrill / environment-flag.php
Created May 30, 2013 05:48
If your WordPress deployment has multiple stages (ie local, staging, production), it can be helpful to have a visual reminder of which stage you are currently viewing in the browser. This adds a colorful box to the Admin Bar displaying the current environment, based on the value of WP_ENV defined in the wp-config file. Drop it into mu-plugins.
<?php
/**
* Plugin Name: Environment Flag
* Description: Show the current environment (ie. local, staging, production) in the Admin Bar.
* Version: 1.0
* Author: Corey McKrill
* Author URI: http://coreymckrill.com/
* License: GNU General Public License v2.0
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
@coreymckrill
coreymckrill / wp-cli-custom.php
Created April 25, 2013 18:43
Custom command for wp-cli, based on `wp core init-tests`. For some reason, `\WP_CLI\Utils\run_mysql_query()` comes up as 'undefined'
<?php
/**
* Custom WP-CLI commands
*
* Usage (from within a WP directory):
* $ wp --require=/path/to/wp-cli-custom.php vvv [function name] [parameters]
*
* @package wp-cli
*/