Skip to content

Instantly share code, notes, and snippets.

@norcross
norcross / norcross-debug-functions.php
Last active March 29, 2021 20:51
my list of debugging functions to keep in an MU file
<?php
/*
Plugin Name: Norcross Debug Functions
Plugin URI: https://gist.github.com/norcross/7864205/
Description: A set of functions I use on all sites while building
Author: Andrew Norcross
Version: 0.0.1
Requires at least: 3.0
Author URI: http://andrewnorcross.com
*/
<?php
/**
* Don't Update Plugin
*
* This prevents you being prompted to update if there's a public plugin
* with the same name.
*
* @since 1.0.0
* @author Mark Jaquith
<?php
// Disables sticky Strict Standards warnings. Good for poorly developed plugins.
// Put this file in mu-plugins
if ( WP_DEBUG ) {
error_reporting( E_ALL & ~E_STRICT );
}
@GaryJones
GaryJones / gist:5271998
Created March 29, 2013 16:41
Genesis workflow using GitFlow.

Genesis Framework workflow on GitHub

General procedure is to follow the established GitFlow model.

Initial Setup

Assuming the move happens right after 2.0.0 is released.

  • All SVN tags moved in as Git Tags.
  • Code SVN tagged as 2.0.0 moved to Git master branch
  • Git master branch is branched to develop.

If work after 2.0.0 has already been committed to SVN trunk, then SVN trunk is moved to Git develop branch instead.

@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@brichards
brichards / wp
Last active December 13, 2015 17:39
WP Commandline Local Install
#!/bin/bash
#
# WP Commandline Local Install, by Brian Richards (@rzen)
#
# Creates a new directory, downloads WordPress, creates a database, sets up wp-config,
# optionally empties wp-content, and deletes other misc files. This compliments my local
# dev setup, outlined here: http://rzen.net/development/local-develoment-in-osx/
#
# Credit:
# Based on WPBuildr (https://github.com/AaronHolbrook/wpbuildr/). Props to Aaron Holbrook
@trepmal
trepmal / gist:3308061
Created August 9, 2012 21:04
Checkboxes & Ajax
<?php
//Plugin Name: Checkboxes & Ajax
//Description: In re to http://wordpress.stackexchange.com/questions/61390/edit-post-meta-with-checkboxes-on-front-end
//add our test checkboxes
add_filter( 'the_content', 'cba_add_checkboxes');
function cba_add_checkboxes( $c ) {
$first = get_post_meta( get_the_ID(), 'first_item_key', true );
$second = get_post_meta( get_the_ID(), 'second_item_key', true );
@tqbf
tqbf / gist:3132713
Created July 17, 2012 22:58
Crypto syllabus #1
0e3647e8592d35514a081243582536ed3de6734059001e3f535ce6271032
334b041de124f73c18011a50e608097ac308ecee501337ec3e100854201d
40e127f51c10031d0133590b1e490f3514e05a54143d08222c2a4071e351
45440b171d5c1b21342e021c3a0eee7373215c4024f0eb733cf006e2040c
22015e420b07ef21164d5935e82338452f42282c1836e42536284c450de3
043b452e0268e7eb005a080b360f0642e6e342005217ef04a42f3e43113d
581e0829214202063d70030845e5301f5a5212ed0818e22f120b211b171b
ea0b342957394717132307133f143a1357e9ed1f5023034147465c052616
0c300b355c2051373a051851ee154a023723414c023a08171e1b4f17595e
550c3e13e80246320b0bec09362542243be42d1d5d060e203e1a0c66ef48
<?php
// Nav Menu Dropdown Class
include_once( CHILD_DIR . '/lib/classes/nav-menu-dropdown.php' );
/**
* Mobile Menu
*
*/
function be_mobile_menu() {
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/