Skip to content

Instantly share code, notes, and snippets.

View joshrhoades's full-sized avatar

Josh Rhoades joshrhoades

View GitHub Profile
@joshrhoades
joshrhoades / getQueryString.js
Last active December 16, 2015 21:59
This function will qet all queryString elements available by name (key), if no matches are found, it returns `FALSE`. Revised for performance, drastically faster operation now, and using dependency injection for unit testing abilities. Typically this should be stored in a sub-namespace like `.utils`
/**
* This function will qet all queryString elements available by name (key), if no matches are found, it returns `FALSE`. Revised 3/18/13 for performance,
* drastically faster operation now, and using dependency injection for unit testing abilities. Typically this should be stored in a sub-namespace like `.utils`
* @version 0.0.3
* @method
* @name getQueryString
* @param {string} key - queryString parameter to match on
* @param {object} theContext The object to fetch against, allows for dependency injection/testability. If not passed in, function will default to use
* the global `window` object
* @returns {boolean} Returns `FALSE` if no match
@joshrhoades
joshrhoades / classAddRemoveCheck.js
Last active December 16, 2015 16:39 — forked from jelmerdemaat/gist:4107273
Functionality for checking and manipulating classes on DOM Elements (i.e., checking if an element has a class, removing a class from an element, and adding a class to an element. Updated to use better naming conventions, use array joins instead if string concats (operation speed), and boolean returns to more easily be able to tell when functions…
/**
* @file Functionality for checking and manipulating classes on DOM Elements (i.e., checking if an element has a class,
* removing a class from an element, and adding a class to an element. Updated to use better naming conventions,
* use array joins instead if string concats (operation speed), and boolean returns to more easily be able to tell when
* functions performed successfully within an app
* @author Josh Rhoades <http://joshuarhoades.com/>
* @added 04/25/13
* @version 1.0.0
* @see {@link https://gist.github.com/jelmerdemaat/4107273|Original before fork}
* @see {@link http://www.avoid.org/?p=78}