Skip to content

Instantly share code, notes, and snippets.

<?php
if ( ! class_exists( 'WPCOM_VIP_CLI_Command' ) || ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
return;
}
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
davidsword / terminal-cheatsheet.md
Last active April 25, 2018 17:09
🔥🍺 Terminal Cheat Sheet
@davidsword
davidsword / mysql-cheat-sheet.md
Last active January 17, 2021 00:34
🔥🍺 MySQL cheat sheet
@davidsword
davidsword / htaccess-cheat-sheet.md
Last active April 14, 2018 04:44
🔥🍺 HTACCESS CHEAT SHEET
@davidsword
davidsword / lamp.md
Last active July 10, 2018 16:26
🔥🍺 CHEAT SHEETS 🍺🔥 - Opens on Alfred keyword: "help"
@davidsword
davidsword / WP-gravityformshiderecaptcha.php
Last active February 8, 2018 21:18
Hide the recaptcha field in a gravity form until the user has started entering text.
<?php
add_action( 'wp_footer', 'ds_gf_footer', 99);
function ds_gf_footer() {
?>
<script>
jQuery(window).load(function() {
jQuery('.gform_wrapper').each(function(){
var recaptcha = jQuery(this).find('.ginput_recaptcha');
if (recaptcha) {
recaptcha.parent().hide();
@cwhittl
cwhittl / fetch_plugin.js
Created April 13, 2017 14:42
Using Fetch with Wordpress Plugins Ajax
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"){
_this.setState({loaded:true,user:data.user});
@dverbovyi
dverbovyi / gulpfile.js
Last active January 19, 2021 12:41
ES6 project with Gulp, Sass, Babel & Browserify
/**
* 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
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 3, 2024 06:29
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

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.

Contents

@JustThomas
JustThomas / wordpress-multisite-internal-redirect-loop.md
Last active March 27, 2024 14:45
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