Skip to content

Instantly share code, notes, and snippets.


Mark Jaquith markjaquith

View GitHub Profile
markjaquith / nginx.conf
Last active Sep 22, 2020
My WordPress Nginx setup
View nginx.conf
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
markjaquith / disable-plugins-when-doing-local-dev.php
Created Jun 24, 2011
Disables specified WordPress plugins when doing local development
View disable-plugins-when-doing-local-dev.php
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI:
markjaquith / gist:6225805
Last active Jul 22, 2020
WordPress multi-tenant directory structure sharing core files for opcode awesomeness, fast deployments, and low disk usage. With inspiration from @weskoop. "=>" indicates a symlink.
View gist:6225805
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
| |__ wp-config.php
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
View plugin.php
include( dirname( __FILE__ ) . '/lib/requirements-check.php' );
$your_plugin_requirements_check = new YOUR_PREFIX_Requirements_Check( array(
'title' => 'YOUR PLUGIN NAME',
'php' => '5.4',
markjaquith / gist:2653957
Created May 10, 2012
WordPress Fragment Caching convenience wrapper
View gist:2653957
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
// YOU CANNOT FORGET THIS. If you do, the site will break.
markjaquith / gist:7029068
Created Oct 17, 2013
How to get git-svn working in OS X Mavericks with Homebrew
View gist:7029068
sudo xcodebuild -license
xcode-select --install # There will be a GUI prompt
sudo cpan SVN::Core # use the "sudo" method when prompted
# Then add this to your ~/.profile:
# export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH
# Then probably:
brew reinstall git
brew reinstall subversion
# git-svn-diff originally by (
# modified by
# modified by aconway@[redacted] - handle diffs that introduce new files
# modified by - fixes diffs that introduce new files
# modified by - fix sed syntax issue in OS X
# Generate an SVN-compatible diff against the tip of the tracking branch
markjaquith / gist:7094389
Last active Jul 14, 2019 got very confused about my family relationships. I took to their Live Chat feature for help.
View gist:7094389

[10:18:00 pm]: Thanks for contacting Health Insurance Marketplace Live Chat. Please wait while we connect you to someone who can help.
[10:18:03 pm]: Please be patient while we're helping other people.
[10:18:07 pm]: Welcome! You're now connected to Health Insurance Marketplace Live Chat.

Thanks for contacting us. My name is Mark. To protect your privacy, please don't provide any personal information, like Social Security Number, or any other sensitive medical or personal information.
[10:19:37 pm]: Mark Do you have any questions that I can help you with?
[10:20:30 pm]: Mark I seem to be stuck in some sort of redneck family relationship loop.
[10:21:37 pm]: Mark It thinks my wife is my grandaughter, my second son is my first son's father, and that my wife is the sister of my sons. And now it thinks that one of my sons is his own brother. And also possibly his own legal guardian.
[10:23:53 pm]: Mark I'm also considering the possibility that you are actually me, from the fu

markjaquith /
Created Apr 11, 2019
Identify images that are displayed wider than their natural width (which results in them looking blurry)
  1. Paste this into your browser console.
  2. Start resizing the window.
  3. Any images that are ever displayed in a blurry fashion will throw an error and get faded out to 0.05 opacity.
markjaquith / suicidal-filter.php
Last active May 11, 2019
Version of `add_filter()` for WordPress that only runs once
View suicidal-filter.php
Use this just like `add_filter()`, and then run something that calls the filter (like
`new WP_Query`, maybe).
That's it. If the filter gets called again, your callback will not be.
This works around the common "filter sandwich" pattern where you have to remember to
call `remove_filter` again after your call.
You can’t perform that action at this time.