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 / 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 / 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
Array
(
[0] => Array
(
[function] => {closure}
[args] => Array
(
[0] => https://sites.psu.edu/wp-admin/admin.php?page=jetpack
)
<% if ENV['TEXAS_STATE'] %>
// Texas state CSS over rides go here
<% end %>