Skip to content

Instantly share code, notes, and snippets.

@aaroneaton
aaroneaton / php.snippets
Created March 10, 2011 20:08
CodeIgniter PHP snippets for the VIM plugin SnipMate
# SnipMate is required to use snippets
# Download SnipMate: http://www.vim.org/scripts/script.php?script_id=2540
# Put this file in ~/.vim/snippets/ then restart vim
# This snippet file includes many useful snippets for CodeIgniter. Please feel free to fork and contribute!
snippet php
<?php
${1}
?>
snippet ec
echo "${1:string}"${2};
<?php
/*
Section: People
Author: J. Aaron Eaton
Description: Enables the creation of people and how to display the posts
Version: 1.0.0
*/
@aaroneaton
aaroneaton / network-shared-media.php
Created September 13, 2011 14:32
WP:Share WP media libraries across multisite network
<?php
// Add filter that inserts our new tab
function nsm_menu($tabs) {
$newtab = array('shared_media' => __('Network Shared Media', 'networksharedmedia'));
return array_merge($tabs, $newtab);
}
add_filter('media_upload_tabs', 'nsm_menu');
// Load media_nsm_process() into the existing iframe
function nsm_menu_handle() {
@aaroneaton
aaroneaton / gist:1235631
Last active September 27, 2015 07:47
VIM:vim find and replace
%s/,//g
%s/edu/edu,/g
%s/,/\r/g
@aaroneaton
aaroneaton / index.php
Created August 17, 2012 21:54
WP:Post type and taxonomy registration
<?php
/*
Plugin Name: AgriLife Publications
Description: Publications Custom Post Type
Version: 1.0
Author: TAMU CIS (not agrilife)
License: GPL2
*/
// Begin - Publication Custom Post Type
add_action( 'init', 'publication_post_type' );
@aaroneaton
aaroneaton / gist:3489926
Last active October 9, 2015 10:37
WP:Include template files from plugin
<?php
// In this situation, template files for your custom post type will live in the root of your plugin directory.
// Ideally they would be in a subdirectory.
add_filter( 'archive_template', 'get_archive_template' );
function get_archive_template( $archive_template ) {
global $post;
$plugindir = dirname( __FILE__ );
@aaroneaton
aaroneaton / gist:3955554
Last active January 5, 2016 15:46
AppleScript:Do Not Disturb on Microsoft Link
-- Save the foreground application
tell application "System Events"
set currentApp to name of 1st process whose frontmost is true
end tell
-- Get Lync in the foreground so we can use the menu
tell application "Microsoft Lync"
activate
end tell
@aaroneaton
aaroneaton / gist:3955567
Last active October 12, 2015 02:08
AppleScript:Become avaliable on Microsoft Lync
-- Save your current application
tell application "System Events"
set currentApp to name of 1st process whose frontmost is true
end tell
-- Bring Lync to the front so we can use the menu
tell application "Microsoft Lync"
activate
end tell
@aaroneaton
aaroneaton / post-format-fix.php
Created January 18, 2013 20:32
WP:WP.com post-format fix
<?php
function wpcom_themes_url_grabber() {
global $post;
$first_url = '';
ob_start();
ob_end_clean();
$output = preg_match_all( '/<a.+href=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches );
$first_url = $matches[1][0];
if ( empty( $first_url ) )
return false;

Contract Killer 3

Revised date: 07/11/2012

Between me, James Aaron Eaton and you [customer name]

Summary:

I’ll always do my 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. I have no desire to trick you into signing something that you might later regret. What I do want is what’s best for both parties, now and in the future.