Journal entries categorized “Web Development”
Helper function (in vanilla js) to find a GET query parameter
var parseQueryParameters = function(){ var queryString = window.location.search; var queries = {}; if(queryString==”) return queries; var q = queryString.replace(‘?’,”).split(‘&’); q.forEach(function(pair){ var a = pair.split(‘=’); if(typeof a[1]===’undefined’) a.push(”); queries[a[0]] = a[1]; }); return queries; }; var getQueryStringValue = function(param){ var queries = parseQueryParameters(); if(typeof queries[param] == ‘undefined’) return false; else return queries[param]; };
Perils of Working with a Third Party Application
At my current employer we use a third party application/service called           . Their CSS framework is full of “suck” and where they decide to employ classes (and not) in their HTML is absolutely mystifying. Some places you have heirarchies like: <body id=”MainBody”> <form id=”MainForm”> <div id=”content-wrap”> <div id=”content”> <div class=”body-area”> <div id=”ContentMiddle”> <!–stuff you […]
Design + Tech = Win!
It’s not all the time that my experience as a fine artist has a direct impact on my coding. This time it did — I ran into a strange optical illusion in an interface I was building.
Debugging WordPress Rewrite Rules
If you’ve ever tried to use WordPress’ rewriting functions, let alone debug them, you know pain. The terror that this experience visited on me spurred me to create this drop-in function which prints a list of all the current rewrite rules (in order), and highlights which rule was matched for the current view. You could […]
Breakpoint Helper with SASS/SCSS
When I’m building a new site, I usually spend a fair amount of time showing and hiding things at various breakpoints. This code defines the major breakpoints in use, then prints out a bunch of helper classes to make the showing/hiding easier. First create a sass map of all the breakpoints. $breakpoints: ( small:550px, medium:800px, […]
Using AJAX in WordPress
Most of the work of setting up an ajax action in the WordPress environment happens in php-land. The PHP File Register & enqueue your script. In this example, I’ll assume the script has already been registered. wp_enqueue_script( ‘myscript’ ); *I’ve had trouble when I’ve tried to enqueue the script at the wp_enqueue_scripts action and added […]
Javascript Media Query Hack
I’ve seen this somewhere before… HTML <span id=”smScreenIndicator”></span> CSS #smScreenIndicator { float: left; } @media (min-width: 400px) { /* whatever width suits the project */ #smScreenIndicator { float: none; } } JQuery function isMobile() { if ( $(‘#smScreenIndicator’).css(‘float’) == ‘left’ ) return true; else return false; }
Paul Irish and Me!
This is a photo of Paul Irish and I at An Event Apart 2014. This is just after he asked my advice on site performance. I told him, “Well, Paul, it’s complicated…”
WordPress Beginner’s Guide
I made this for a client, but others who are just starting might find it useful. What is WordPress? WordPress is a popular content management system. It began as blog publishing software and is perhaps still best known as such. Â It is used by over a million websites, including notables such as Yahoo, CNN, Flickr, […]