Quick Tips Tutorials

  • By
    Case Insensitive CSS Attribute Selector

    CSS selectors never cease to amaze me in how powerful they can be in matching complex patterns. Most of that flexibility is in parent/child/sibling relationships, very seldomly in value matching. Consider my surprise when I learned that CSS allows matching attribute values regardless off...

  • By
    How to Set Date Time from Mac Command Line

    Working on a web extension that ships to an app store and isn't immediately modifiable, like a website, can be difficult. Since you cannot immediately deploy updates, you sometimes need to bake in hardcoded date-based logic. Testing future dates can be difficult if you...

  • By
    How to Fix: Windows WASD Keys Reversed with Arrow Keys

    This past weekend I had the opportunity to be what every father wants, if only for a moment: the "cool dad". My wife was out of town and my youngest son wanted to play PUBG. I caved in, taught him the basic FPS...

  • By
    Date.now()

    Ask any software engineer and they'll tell you that coding date logic can be a nightmare. Developers need to consider timezones, weird date defaults, and platform-specific date formats. The easiest way to work with dates is to reduce the date to the most simple...

  • By
    Extract a Number from a String with JavaScript

    User input from HTML form fields is generally provided to JavaScript as a string. We've lived with that fact for decades but sometimes developers need to extract numbers from that string. There are multiple ways to get those numbers but let's rely on regular...

  • By
    How to Get the Current Branch Name with git

    Most developers spoil themselves with fun command line utilities to make their work easier and more efficient. One such command line helper allows developers to always show the git branch in the command line. How can you get the current branch? With...

  • By
    AutoSave with VSCode

    Visual Studio Code has taken the crown of most used text editor, at least in JavaScript spheres. VSCode is fast, feature-filled, and supports thousands of plugins to boost productivity. Developers can also tweak hundreds of settings to enrich functionality. One such feature is...

  • By
    Sum an Array of Numbers with JavaScript

    It's rare that I'm disappointed by the JavaScript language not having a function that I need. One such case was summing an array of numbers -- I was expecting Math.sum or a likewise, baked in API. Fear not -- summing an array of numbers...

  • By
    JavaScript closest

    When it comes to finding relationships between elements, we traditionally think of a top-down approach. We can thank CSS and querySelector/querySelectorAll for that relationship in selectors. What if we want to find an element's parent based on selector?To look up the element tree and find...

  • By
    JavaScript: Reverse Arrays

    Manipulating data is core to any programming language. JavaScript is no exception, especially as JSON has token over as a prime data delivery format. One such data manipulation is reversing arrays. You may want to reverse an array to show most recent transactions, or...