Skip to content

Instantly share code, notes, and snippets.

View peterchester's full-sized avatar

Peter Chester peterchester

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style>
.char {
padding: 0;
margin: 0;
display: block;
float: left;
@peterchester
peterchester / iching-random-walk.html
Created October 26, 2012 23:17
I Ching Random Walk
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style>
.ichingchar {
padding: 0;
margin: 0;
height: 24px;
width: 19px;
@peterchester
peterchester / twitter-cards.php.diff
Created July 4, 2012 00:19
Updates to the twiter-cards WordPress plugin to include filters
diff --git a/twitter-cards.php b/twitter-cards.php
index 06f6c00..6aa751c 100644
--- a/twitter-cards.php
+++ b/twitter-cards.php
@@ -22,9 +22,8 @@ class Twitter_Cards {
* @since 1.0
*/
public static function init() {
- if ( apply_filters( 'twitter_cards_display', is_single() ) ) {
+ if ( is_single() )
@peterchester
peterchester / filter_time_format.js
Created June 24, 2012 01:18
Javascript to convert string time entries to float values
/*
* Javascript time conversion script
* version 1.0
* @requires jQuery
* @author Modern Tribe, Inc. (Peter Chester)
*
* Converts several formats to a 2 point float. Accepted formats include:
* 1.3333333333
* 1h 10m
* 1:10
// Do not edit any further.
var $do = false;
var $genlock = false;
@peterchester
peterchester / hyper-cache-site-option.diff
Created June 6, 2012 08:47
Hyper Cache Site Option
diff --git a/wp-content/plugins/hyper-cache/options.php b/wp-content/plugins/hyper-cache/options.php
index 9daa572..cbc1e7e 100644
--- a/wp-content/plugins/hyper-cache/options.php
+++ b/wp-content/plugins/hyper-cache/options.php
@@ -1,6 +1,6 @@
<?php
-$options = get_option('hyper');
+$options = hyper_get_options();
@peterchester
peterchester / hyper-cache-php-notice-fix.diff
Created June 6, 2012 04:49
Fix php notices in WordPress Hyper Cache
diff --git a/wp-content/plugins/hyper-cache/cache.php b/wp-content/plugins/hyper-cache/cache.php
index e3e1dbf..647fa55 100644
--- a/wp-content/plugins/hyper-cache/cache.php
+++ b/wp-content/plugins/hyper-cache/cache.php
@@ -125,7 +125,7 @@ if ($hyper_data['type'] == 'home' || $hyper_data['type'] == 'archive') {
// Valid cache file check ends here
-if ($hyper_data['location']) {
+if (isset($hyper_data['location']) && $hyper_data['location']) {
@peterchester
peterchester / wp-cache-phase2.php.diff
Created May 29, 2012 23:21
More wp-super-cache notice fixes
diff --git a/wp-content/plugins/wp-super-cache/wp-cache-phase2.php b/wp-content/plugins/wp-super-cache/wp-cache-phase2.php
index 739512e..86f6086 100644
--- a/wp-content/plugins/wp-super-cache/wp-cache-phase2.php
+++ b/wp-content/plugins/wp-super-cache/wp-cache-phase2.php
@@ -59,7 +59,7 @@ function wp_cache_phase2() {
return false;
}
- if ( $wp_cache_object_cache && !empty( $_GET ) ) {
+ if ( isset( $wp_cache_object_cache ) && $wp_cache_object_cache && !empty( $_GET ) ) {
@peterchester
peterchester / wp-supercache.diff
Created May 28, 2012 06:02
Wp-supercache fixes to various PHP Notices
diff --git a/wp-content/plugins/wp-super-cache/plugins/badbehaviour.php b/wp-content/plugins/wp-super-cache/plugins/badbehaviour.php
index 6c07488..478dd85 100644
--- a/wp-content/plugins/wp-super-cache/plugins/badbehaviour.php
+++ b/wp-content/plugins/wp-super-cache/plugins/badbehaviour.php
@@ -66,7 +66,7 @@ function wp_supercache_badbehaviour_admin() {
<label><input type="radio" name="cache_badbehaviour" value="0" <?php if( !$cache_badbehaviour ) { echo 'checked="checked" '; } ?>/> <?php _e( 'Disabled', 'wp-super-cache' ); ?></label>
<p><?php _e( '', 'wp-super-cache' ); ?></p><?php
echo '<p>' . sprintf( __( '(Only legacy caching supported, disabled compression and requires <a href="http://www.bad-behavior.ioerror.us/">Bad Behavior</a> in "%s/plugins/bad-behavior/") ', 'wp-super-cache' ), WP_CONTENT_DIR ) . '</p>';
- if ($changed) {
+ if ( isset( $changed ) && $changed ) {
@peterchester
peterchester / object-cache.php.diff
Created May 27, 2012 23:49
Xcache Object Cache update to account for versions of Xcache prior to 1.3
Index: object-cache.php
===================================================================
--- object-cache.php (revision 548800)
+++ object-cache.php (working copy)
@@ -92,8 +92,8 @@
public function __construct() {
global $table_prefix;
- if ( !function_exists( 'xcache_get' ) ) {
- wp_die( 'You do not have XCache installed, so you cannot use the XCache object cache backend. Please remove the <code>object-cache.php</code> file from your content directory.' );