Quick Tips Tutorials

  • By
    Serve SVG as an Image on Apache with .htaccess

    I've been a massive fan of SVG since my days creating charts and animations with the Dojo Toolkit.  SVG has been around forever, it even has IE support now, and it's ultra-flexible.  When creating this site's redesign, I used SVG within an IMG tag and...

  • By
    Display Images as Grayscale with CSS Filters

    CSS filters aren't yet widely supported but they are indeed impressive and a modern need for web imagery.  CSS filters allow you to modify the display of images in a variety of ways, one of those ways being displaying images as grayscale. Doing so requires the...

  • By
    Wrapping Code Samples on Mobile Devices

    One part of being a technical blogger that I've had to come to grips with is code samples and small mobile device screens.  I was amazed when I saw a double-digit percentage of visits to this blog were from mobile phones -- mental!  I started paying more attention to...

  • By
    Shaving Bytes with JavaScript Booleans

    Developers are always search for ultimate way to create something with the least amount of code.  This, of course, is one of the reasons we use minifiers: to serve code as small as possible.  Of course this practice has numerous benefits, like faster download time, less storage...

  • By
    Prevent XSS “on” Attribute Attacks in CKEditor 3.x

    CKEditor 3.x had issues with XSS /security issues with on attributes.  For example, you could trigger malicious code via an onerror attribute -- ouch!  Of course the problem has been fixed in CKEditor 4 but upgrading can be an issue if you have custom plugins.  Here's how the issue...

  • By
    Install NPM from Command Line

    I was trying to update my version of NPM using NPM but long story short, a permissions issue allowed NPM to be removed but not re-installed, and thus I was hosed -- NPM was nowhere to be found on "Walshbook Pro."  Eeeek.  Well, you can install NPM via...

  • By
    Get the Git Commit ID via Command Line

    I know just enough git to be dangerous.  I'm not doing advanced bisecting but I can stash, rebase, and reset with the best of them.  One new trick I learned from my boss, Luke Crouch, saves me loads of time:  getting the commit ID via command...

  • By
    How to Open a Website from Terminal

    Every once in a while I want to open a website from the terminal ... just because.  Maybe it's because it makes me feel just a bit more hardcore, you know, not clicking a GUI icon.  Anyways, opening a browser via the command line is dead...

  • By
    Lazy Load Resources Based on Element Presence

    Fans of AMD JavaScript will probably tell you that they love loading only what they need, when they need them.  I am one of those people.  Let's take a site like mine for example: some pages require a syntax highlighter, some do not.  Why make the...

  • By
    JavaScript FrameBuster Snippet

    Oftentimes you want to make sure your site isn't being IFRAME'd.  Sometimes it's for security reasons, other times it's so your site's content isn't being skimmed else, and other times it's...oh, who cares, you just want to do it.  Here's a short way to escape frames: Uglify...