Skip to content

Instantly share code, notes, and snippets.

View markjaquith's full-sized avatar

Mark Jaquith markjaquith

View GitHub Profile
@markjaquith
markjaquith / Disable-ACF-UI.php
Created January 12, 2021 08:28
Disable ACF UI
<?php
// Block the ACF settings UI entirely, except on local dev.
if (! defined('WP_LOCAL_DEV') || ! WP_LOCAL_DEV) {
add_filter('acf/settings/show_admin', '__return_false');
add_filter('acf/settings/capability', function () { return 'do_not_allow'; });
}
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
# modified by aconway@[redacted] - handle diffs that introduce new files
# modified by t.broyer@ltgt.net - fixes diffs that introduce new files
# modified by m@rkj.me - fix sed syntax issue in OS X
#
# Generate an SVN-compatible diff against the tip of the tracking branch
@markjaquith
markjaquith / gist:7094389
Last active July 14, 2019 20:46
Healthcare.gov got very confused about my family relationships. I took to their Live Chat feature for help.

[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
markjaquith / README.md
Created April 11, 2019 17:29
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
markjaquith / nginx.erb
Created April 19, 2014 17:21
Nginx setup
server {
listen 80;
<% if @use_ssl %>
listen 443 ssl spdy;
ssl_certificate ssl/<%= @domain %>/server.crt;
ssl_certificate_key ssl/<%= @domain %>/server.key;
<% end %>
server_name <%= @domain %><% if @also_www %> www.<%= @domain %><% end %>;
access_log /var/log/nginx/access.log main;
@markjaquith
markjaquith / .all
Last active October 10, 2018 15:38
Bash stuff
for f in ~/Dropbox/bash/*; do source $f; done
@markjaquith
markjaquith / plugin-deploy.sh
Created November 16, 2012 05:04 — forked from scribu/plugin-deploy.sh
Plugin deploy script
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH
//* Add the site tagline section
add_action( 'genesis_after_header', 'minimum_site_tagline');
function minimum_site_tagline() {
if ( !is_page( 'ಠ_ಠ' ) )
printf( '<div %s>', genesis_attr( 'site-tagline' ) );
genesis_structural_wrap( 'site-tagline' );
printf( '<div %s>', genesis_attr( 'site-tagline-left' ) );
printf( '<p %s>%s</p>', genesis_attr( 'site-description' ), esc_html( get_bloginfo( 'description' ) ) );
echo '</div>';
@markjaquith
markjaquith / gform-stripe-use-older-api.php
Created February 25, 2018 01:56
Force Gravity Forms Stripe add-on to use an older version of the Stripe API, so subscriptions work
<?php
add_action( 'gform_stripe_post_include_api', function() {
if ( method_exists( '\Stripe\Stripe', 'setApiVersion' ) ) {
\Stripe\Stripe::setApiVersion( '2016-07-06' );
}
});
<?php
/*
Plugin Name: Block WordPress attachment queries
Description: Blocks MySQL queries for WordPress attachments that are on domains we know will never resolve to a local WordPress attachment ID.
Author: Mark Jaquith
*/
add_filter( 'query', function( $query ) {
global $wpdb;