Skip to content

Instantly share code, notes, and snippets.

View stuntbox's full-sized avatar

David Sleight stuntbox

View GitHub Profile

Keybase proof

I hereby claim:

  • I am stuntbox on github.
  • I am stuntbox (https://keybase.io/stuntbox) on keybase.
  • I have a public key ASC_4-UlALbpG-_4rRidDT43sJaIxAr9YPdDIYgrqBSamAo

To claim this, I am signing this object:

@stuntbox
stuntbox / gist:d492e358f751598ca32b
Created November 14, 2014 21:30
Query String Catcher
/*- Query String Values ------------------------------------------------------*/
//
// Retrieves, parses URL query string values into an object using JS.
// See "JavaScript: The Definitive Guide", 5th ed, p.272, example 14-1.
var queryStringValues = getQueryStringValues();
function getQueryStringValues() {
// var args = new Object();
var args = {};
@stuntbox
stuntbox / gist:4557917
Last active March 23, 2023 03:32
Slightly smarter filtering to remove hard-coded width and height attributes from *all* images in WordPress (post thumbnails, images inserted into posts, and gravatars). Handy for responsive designs. Add the code below to the functions.php file in your theme's folder (/wp-content/themes/theme-name/ ). Remember to rename the function as needed to …
/**
* Filter out hard-coded width, height attributes on all images in WordPress.
* https://gist.github.com/4557917
*
* This version applies the function as a filter to the_content rather than send_to_editor.
* Changes made by filtering send_to_editor will be lost if you update the image or associated post
* and you will slowly lose your grip on sanity if you don't know to keep an eye out for it.
* the_content applies to the content of a post after it is retrieved from the database and is "theme-safe".
* (i.e., Your changes will not be stored permanently or impact the HTML output in other themes.)
*