Skip to content

Instantly share code, notes, and snippets.


Richard Tape richardtape

View GitHub Profile
carlalexander / expect-header-fix.php
Last active Aug 13, 2021
WordPress "Expect" header fix
View expect-header-fix.php
* By default, cURL sends the "Expect" header all the time which severely impacts
* performance. Instead, we'll send it if the body is larger than 1 mb like
* Guzzle does.
function add_expect_header(array $arguments)
$arguments['headers']['expect'] = '';
keesiemeijer /
Last active May 22, 2022
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
# PHPUnit, curl wget, rsync, git, subversion and composer.
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
johnbillion /
Last active Nov 3, 2022
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here:

tomjn / behave.js
Last active Apr 17, 2018
Adds a shortcode to WordPress that lets you test escaping and sanitising functions on content
View behave.js
* Behave.js
* Copyright 2013, Jacob Kelley -
* Released under the MIT Licence
* Github:
* Version: 1.5
kevinelliott /
Last active Apr 10, 2022
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

View gist:4fa3c4228a8bb53cc71d
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
View gist:8fba357c97193633a66d
# Apache .htaccess
RedirectMatch 301 ^/wp-content/uploads/(.*)$1
# Nginx
location ~ ^/wp-content/uploads/(.*) {
rewrite ^/wp-content/uploads/(.*)$$1 redirect;
Globegitter /
Last active May 7, 2022
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src trusty nginx" | sudo tee -a /etc/apt/sources.list
Rarst /
Last active Feb 29, 2016
Exclude plugins and themes from update checks
BjornW / Setup WordPress Multi-tenant infrastructure
Last active Mar 16, 2021
A short description of how I've setup a WordPress Multi-Tenant architecture. This is based on the excellent post by Jason McCreary and the great ascii art explanations by Wes Koop ( & Mark Jaquith (…
View Setup WordPress Multi-tenant infrastructure
I'm using Ubuntu 12.04 and I'm following the Debian/Ubuntu way of dealing with config files. I presume you know how to work with sudo and such
- Install last stable version of WordPress (in my case 3.6) with Subversion into /opt/wordpress/3.6
- create a symlink /opt/wordpress/stable ==> /opt/wordpress/3.6
- create a directory sites in /var/www/sites
- create a directory specific for your site using the domain name e.g. /var/www/sites/
- create a directory wp-content in /var/www/sites/
- create a directory wordpress in /etc
- create a directory named as you site's domain name, e.g. in /etc/wordpress
- copy from /opt/wordpress/stable/wp-config-sample.php to /etc/wordpress/