Quick Tips Tutorials
CSS Clear Fix
Clearing CSS floats is just as important to creating CSS structures as anything could be. For years we would clear our floated elements by adding one element with the clear: both; style simple to perform the clear. This practice was fine but it introduced elements into...
Using Font Awesome Icons without <i> Tags
If you've not used glyph icon libraries like Font Awesome before, you're really missing out. They're incredibly useful, flexible, and are easy to implement via markup. The normal method for using font awesome is by using an <i> element with an icon-specific CSS class: This...
Font Awesome Text-Decoration and Link Underline
If I were to describe Font Awesome in a word, I think it would be...awesome. The icon font library is massively helpful in using quality vector glyphs instead of separate images. I tend to use a lot of icons within links, as they help users...
Python html5lib Skipped Elements
I've been working on some interesting python stuff at Mozilla and one task recently called for called for rending a page and then finding elements with a URL attribute value (like img[src] or a[href]) and ensuring they become absolute URLs. One problem I encountered when using...
:valid, :invalid, and :required CSS Pseudo Classes
Let's be honest, form validation with JavaScript can be a real bitch. On a real basic level, however, it's not that bad. HTML5 has jumped in to some extent, providing a few attributes to allow us to mark fields as required or only valid if matching...
Mobile and Desktop Event Normalization with pointer.js
The mobile revolution brought in a variety of new challenges, one being interaction and event handling. We have a set of new touch events and the traditional desktop events, and click events work on both devices, but mousemove and touchmove aren't always in sync, and there...
Remove a Submodule within git
For many git-based projects, submodules are useful in avoiding duplicate work and easing utility library updates. There are times, however, when a submodule needs to be removed from a project. Submodules aren't removed with git rm submoduledir, they must be removed in a more tedious, manual...
Immediately Executing Functions
JavaScript is full of nifty little tricks to accomplish tasks with less code. One of those tricks is immediately executing functions. We oftentimes see this pattern for executing anonymous functions to limit variable scope: What many developers don't know is that this code can be shorted by...
Shaving Bytes on JavaScript Conditionals
Whenever you work with JavaScript code, it's as though there's always a shorter way to code something. You thought that a code set was basic until you found out that something was basic...er. One of those code shortcuts can be found with conditions, specifically short if...
Get a Python Package Version
Part of maintaining a Django-based application like MDN's kuma is ensuring Python packages are up to date. I was recently testing an upgrade on a remote system and needed to ensure that a given Python package was at the version number it should be.