Skip to content

Instantly share code, notes, and snippets.

// function that runs when shortcode is called
function jruuc_themes_shortcode() {
$wcatTerms = get_terms('uu_service_topics', array('hide_empty' => 1, 'parent' =>0));
$message = '<ul class="uu_topics">';
foreach($wcatTerms as $wcatTerm) {
$wsubargs = array(
'hierarchical' => 1,
@cmcnulty
cmcnulty / unsubscribe-post-gazette.user.js
Last active August 29, 2015 14:00
Greasemonkey script to disabled the post-gazette.com subscription screen.
// ==UserScript==
// @name Pittsburgh Post-Gazette NonSubscribe
// @description Fix Post-Gazette
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @license (CC); http://creativecommons.org/licenses/by-nc-sa/3.0/
// @namespace NonSubscribe.me
// @include http://www.post-gazette.com/*
// @updateURL https://gist.githubusercontent.com/cmcnulty/11383138/raw/unsubscribe-post-gazette.user.js
// @downloadURL https://gist.githubusercontent.com/cmcnulty/11383138/raw/unsubscribe-post-gazette.user.js
// @version 0.0.3
@cmcnulty
cmcnulty / unsubscribe-madison-com.user.js
Last active October 10, 2019 04:26
Greasemonkey script to disable madison.com subscription redirect
// ==UserScript==
// @name Madison.com NonSubscribe
// @description Stops subscription redirect on madison.com articles
//
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @license (CC); http://creativecommons.org/licenses/by-nc-sa/3.0/
//
// @namespace NonSubscribe.me
// @include http://*.madison.com/*
// @updateURL https://gist.githubusercontent.com/cmcnulty/11194631/raw/unsubscribe-madison-com.user.js
@cmcnulty
cmcnulty / jquery.fireOnDisable.js
Last active July 26, 2019 07:48
Allows you to listen for propertychange on setting disabled to true on form elements. Very useful for resolving some select2 issues.
( function( $ ) {
"use strict";
$.fn.fireOnDisable = function( settings ) {
// Only perform this DOM change if we have to watch changes with propertychange
// Also only perform if getOwnPropertyDescriptor exists - IE>=8
// I suppose I could test for "propertychange fires, but not when form element is disabled" - but it would be overkill
if( !( 'onpropertychange' in document.createElement( 'input' ) ) || Object.getOwnPropertyDescriptor === undefined ) {
return this;
}