Skip to content

Instantly share code, notes, and snippets.

View bfillmer's full-sized avatar

Bryan Fillmer bfillmer

View GitHub Profile
@bfillmer
bfillmer / tiny-pubsub-listener.js
Last active August 29, 2015 14:01
Generic Page Listener for Tiny PubSub
/**
* Quick and simple wrapper for Tiny PubSub (https://github.com/cowboy/jquery-tiny-pubsub).
* Wanted to be able to simply update an array with various events/classes/ids to watch for
* and have a single function fired. Also leverages Underscore.js (http://underscorejs.org/).
*/
// What we want to watch for: key = event to listen for, value array = class/ids to watch for.
var eventsAndElementsToWatch = {
click: ['.btn','.link'],
change: ['.input'],
@bfillmer
bfillmer / admin-options.php
Created May 14, 2014 18:47
Generic WP Option Page Functions
<?php
/**
* Generic WordPress Options Panel
*
* A good starting point for a simple options panel, just
* loops through defined options and creates input[type=text]
* for each with the value and lets you update.
*
* Replace namespace- and namespace_ with either your plugin