Skip to content

Instantly share code, notes, and snippets.

#!/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
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@jjeaton
jjeaton / Triangle-border-cutout.markdown
Last active December 25, 2015 01:29
A Pen by Josh Eaton.

Triangle border cutout

Cutout a triangle from the border of an element and show the background through.

A Pen by Josh Eaton on CodePen.

License.

Keybase proof

I hereby claim:

  • I am jjeaton on github.
  • I am jjeaton (https://keybase.io/jjeaton) on keybase.
  • I have a public key whose fingerprint is D60F 9699 1C9B 6C64 E244 5E81 AAC7 AA3A 832A 97B4

To claim this, I am signing this object:

@jjeaton
jjeaton / advanced-menu-widget.php
Created April 25, 2014 19:59
Modify Walker subclass signatures to fix PHP 5.4 Strict notices
<?php
/*
* Plugin Name: Advanced Menu Widget
* Plugin URI: http://www.techforum.sk/
* Description: Enhanced Navigation Menu Widget
* Version: 0.3
* Author: Ján Bočínec
* Author URI: http://johnnypea.wp.sk/
* License: GPL2+
*/
<?php
# Implements a recursive null object pattern.
#
# Implemented as a trait so any object can make it's properties use
# the null pattern without resorting to inheritance.
#
# The goal is so you can pull data off a partially populated object
# without excessive existance checks.
trait NullPattern {
@jjeaton
jjeaton / disable-heartbeat-api.php
Created May 5, 2014 21:28
Small plugin to disable Heartbeat API
<?php
/**
* Disable heartbeat API on all admin pages except post.php and post-new.php
*
* Plugin Name: Disable Heartbeat API
* Plugin URI: http://www.josheaton.org/
* Description: Disables the heartbeat API on all admin pages except post.php and post-new.php
* Version: 0.1
* Author: Josh Eaton
* Author URI: http://www.josheaton.org/
<?php
// ...<snip>...
<span class="milestone"><# wp.hooks.doAction('milestonerevs.metadata', data) #></span>
// ...<snip>...
add_action( 'admin_footer-revision.php', 'wpse151630_test' );
function wpse151630_test() {
?>
<script>