Skip to content

Instantly share code, notes, and snippets.

View jwenerd's full-sized avatar
workin'

Jared Wenerd jwenerd

workin'
View GitHub Profile
@jwenerd
jwenerd / .bash_profile
Created March 5, 2013 16:00
Put current git branch in shell prompt
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}") "
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
WHITE='\e[47m'
RESET='\e[0m'
@jwenerd
jwenerd / upgrade.php
Last active August 29, 2015 14:01
WP multisite upgrade script
<?php
/**
* WordPress Multisite upgrade script
*
* IMPORTANT: While a simple safeguard has been added to the script,
* you'll want to add another layer that prevents this script from
* being called via the browser.
*
* Usage:
* 1) Place in the root of your install (or another place, but modify the wp-load.php path to match)
@jwenerd
jwenerd / page-navigation.php
Last active December 4, 2023 06:44
Page navigation shortcode for WordPress
<?php
/**
* @package Page Navigation Shortcode
* @version 0.1
*/
/*
Plugin Name: Page Navigation Shortcode
Description: This plugin automatically adds links to the previous and next pages at the bottom of page content. User's may disable for select pages as well on the page edit screen.
Author: TLT Studio
Version: 0.1
@jwenerd
jwenerd / debug-db-cache.php
Last active August 29, 2015 14:02
WordPress debug queries and memcached
<?php
if(defined('WP_DEBUG') && WP_DEBUG ){
add_action('wp_footer','debug_print_queries');
add_action('admin_footer','debug_print_queries');
function debug_print_queries(){
global $wpdb;
global $wp_object_cache;
<?php
/*
* The site wide tags tag that we use on the explore blog
* will save revisions into the explore blog - we don't want that since
* it useless data replication
*/
add_filter('sitewide_tags_allowed_post_types',function ($post_types){
$post_types['revision'] = false;
// var_dump($post_types);
@jwenerd
jwenerd / gist:ce9b5b5939c4065994dc
Created October 3, 2014 18:28
CIC member school domains
psu.edu
uchicago.edu
illinois.edu
iub.edu
uiowa.edu
umd.edu
umich.edu
msu.edu
umn.edu
unl.edu
@jwenerd
jwenerd / show-all-categorys.php
Created December 9, 2014 23:45
The following PHP is a plugin that shows all categories (including non-empty categories) in the Jetpack Widget Visibility dropdown. It typically hides empty by default...
<?php
if( ! defined('ABSPATH') ) {
exit;
}
// inlcude this seperately from the other jetpack fixes
// because of widget visiability being loaded independently
// of actual jetpack
<?php
/*
Plugin Name: PageLines Security Patcher
Description: Blocks the recent exploits for legacy themes in the event you cant update the themes.
Version: 1.0
Author: PageLines
*/
class Fix_Pagelines_Legacy {
function __construct() {
@jwenerd
jwenerd / foo.rb
Created February 23, 2015 15:53
testing out instance define methods for models
class Foo
def self.set_foo
@foo = 1
end
def self.print_foo
puts "class isntance foo = #{@foo}"
end
$(document).on('tk:thing-start', function() {
$('#something').addClass('whatever');
});
function start_thing() {
$(document).trigger('tk:thing-start');
/// do the computing