Skip to content

Instantly share code, notes, and snippets.

@jjeaton
jjeaton / awesome-wp-config-file.php
Created August 16, 2012 23:30 — forked from ashfame/awesome-wp-config-file.php
awesome-wp-config-file
<?php
/**
* Define type of server
*
* Depending on the type other stuff can be configured
* Note: Define them all, don't skip one if other is already defined
*/
define( 'DB_CREDENTIALS_PATH', dirname( ABSPATH ) ); // cache it for multiple use

Date: [date]

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

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

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.

@jjeaton
jjeaton / ToggleLocalDev.scpt
Last active December 17, 2015 00:29
Wrapper Applescript for toggling Mark Jaquith's Localdev script: https://github.com/markjaquith/Localdev on and off. Can be used with FastScripts: http://www.red-sweater.com/fastscripts/ and set to a global keyboard shortcut. (I used Cmd+Shift+L). Also provides a growl notification of the updated status.
# Toggle Localdev On/Off
# Fetch the status of localdev
set localdevStatus to do shell script "/usr/local/bin/localdev status | awk '{print $3}'"
if localdevStatus is equal to "on" then
toggleLocaldev("off")
else
toggleLocaldev("on")
end if
@jjeaton
jjeaton / functions.php
Created May 5, 2013 20:06
Remove current_page_parent class from Blog menu item when using custom post types and add class for the post type menu item. Hardcodes the menu-item title for each.
<?php
add_filter( 'nav_menu_css_class', 'je_portfolio_menu_item_classes', 10, 2 );
/**
* Add css classes to Portfolio CPT menu item, remove from Blog item
*
* Enables menu classes for CPTs.
* Pretty fragile, as it depends on the item titles for each menu item, change as required
*
* @param array $classes CSS classes for the menu item
@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
*/
<?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()
<?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 ) {
@jjeaton
jjeaton / staging-tweaks.php
Created July 26, 2013 21:44
A plugin that modifies the `admin_email` and `blogname` and `blog_public` options for staging sites.
<?php
/**
* Plugin Name: Staging Option Tweaks
* Plugin URI: http://www.josheaton.org/
* Description: Checks the health of your WordPress install
* Author: Josh Eaton
* Version: 0.1
* Author URI: http://www.josheaton.org/
*
* A plugin that modifies the `admin_email` and `blogname` and `blog_public` options for staging sites.