Skip to content

Instantly share code, notes, and snippets.

@jjeaton
jjeaton / .vimrc
Last active August 29, 2015 14:28 — forked from JeffreyWay/.vimrc
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
function Selector_Cache() {
var elementCache = {};
var get_from_cache = function( selector, $ctxt, reset ) {
if ( 'boolean' === typeof $ctxt ) { reset = $ctxt; }
var cacheKey = $ctxt ? $ctxt.selector + ' ' + selector : selector;
if ( undefined === elementCache[ cacheKey ] || reset ) {
elementCache[ cacheKey ] = $ctxt ? $ctxt.find( selector ) : jQuery( selector );
<?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 {
<?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
#!/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
/**
* Filter the comment author name for administrators
*
* @see wp_filter_comment(), sanitize_comment_cookies()
*
* @param string $name The comment author name.
* @return string The filtered author name.
*/
function filter_comment_author_name( $name ) {
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: SysBot
* Description: Creates and maintains the SysBot User (which has the role of "editor")
* Author: Franz Josef Kaiser
*/
# PUBLIC API #
function get_bot()
@jjeaton
jjeaton / is_blog.php
Last active December 18, 2015 15:59 — forked from wesbos/is_blog.php
WordPress' missing is_blog() function. Determines if the currently viewed page is one of the blog pages, including the blog home page, archive, category/tag, author, or single post pages.
/**
* WordPress' missing is_blog() function. Determines if the currently viewed page is
* one of the blog pages, including the blog home page, archive, category/tag, author, or single
* post pages.
*
* Doesn't include is_search(), if you only use search for the blog, then add that in or test separately
*
* @props grantnorwood
* @return bool
*/

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.