Skip to content

Instantly share code, notes, and snippets.

David Sleight stuntbox

View GitHub Profile
View keybase.md

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:

View gist:d492e358f751598ca32b
/*- 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 = {};
View CSS-only-Flexible-Modal-w--Fixed-Header-and-Footer.markdown
@stuntbox
stuntbox / gist:4557917
Last active Oct 7, 2019
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 …
View gist:4557917
/**
* 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.)
*
You can’t perform that action at this time.