Skip to content

Instantly share code, notes, and snippets.


David Sword davidsword

View GitHub Profile
View vip-remove-old-revisions-command.php
if ( ! class_exists( 'WPCOM_VIP_CLI_Command' ) || ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
WP_CLI::add_command( 'vip-remove-old-revisions', 'VIP_Remove_Old_Revisions_Command' );
class VIP_Remove_Old_Revisions_Command extends WPCOM_VIP_CLI_Command {
davidsword /
Last active Apr 25, 2018
🔥🍺 Terminal Cheat Sheet
davidsword /
Last active Jan 17, 2021
🔥🍺 MySQL cheat sheet
davidsword /
Last active Apr 14, 2018
davidsword /
Last active Jul 10, 2018
🔥🍺 CHEAT SHEETS 🍺🔥 - Opens on Alfred keyword: "help"
davidsword / WP-gravityformshiderecaptcha.php
Last active Feb 8, 2018
Hide the recaptcha field in a gravity form until the user has started entering text.
View WP-gravityformshiderecaptcha.php
add_action( 'wp_footer', 'ds_gf_footer', 99);
function ds_gf_footer() {
jQuery(window).load(function() {
var recaptcha = jQuery(this).find('.ginput_recaptcha');
if (recaptcha) {
cwhittl / fetch_plugin.js
Created Apr 13, 2017
Using Fetch with Wordpress Plugins Ajax
View fetch_plugin.js
fetch(ajax_url, {
method: 'POST',
credentials: 'same-origin',
headers: new Headers({'Content-Type': 'application/x-www-form-urlencoded'}),
body: 'action=zget_profile_user'
.then((resp) => resp.json())
.then(function(data) {
if(data.status == "success"){
dverbovyi / gulpfile.js
Last active Jan 19, 2021
ES6 project with Gulp, Sass, Babel & Browserify
View gulpfile.js
* Created by Dmytro on 3/27/2016.
var browserify = require('browserify'),
gulp = require('gulp'),
sourcemaps = require('gulp-sourcemaps'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
source = require('vinyl-source-stream'),
buffer = require('vinyl-buffer'),
Nilpo / Using Git to Manage a Live Web
Last active Jun 10, 2021
Using Git to Manage a Live Web Site
View Using Git to Manage a Live Web

Using Git to Manage a Live Web Site


As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.


JustThomas /
Last active May 7, 2021
WordPress Multisite: How to fix error "too many redirects"

WordPress Multisite: How to fix error "Request exceeded the limit of 10 internal redirects"

I am running a WordPress multisite network with sub-directory setup. When I check my error.log file, it is full of entries like this one:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'Limit InternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

The problem was, in my case, one specific rewrite rule in the .htaccess file.

Problem description