Quick Tips Tutorials

  • By
    Set Brave as Default Browser from Command Line

    I've been a huge fan of the Brave web browser for years. They're crypto-friendly, provide native ad-blocking features, and even provide Tor integration. Whenever I set up new systems, I automate Brave as the default browser.You can use the following shell command to set...

  • By
    CSS :autofill

    Autofilling HTML input elements is a frequent user action that can drastically improve user experience. Hell, we all autofill for our passwords and address information. But what control do we have when input elements have been autofilled?To add custom CSS styles to inputs whose...

  • By
    CSS :out-of-range

    One aspect of web development I've always loathed was working with forms. Form elements have been traditionally difficult to style due to OS and browser differences, and validation can be a nightmare. Luckily the native HTML APIs added methods for improving the form validation situation.With...

  • By
    git Force Push

    Rebasing is a frequent task for anyone using git. We sometimes use rebasing to branch our code from the last changes or even just to drop commits from a branch.Oftentimes when trying to push after a rebase, you'll see something like the following:Commonly developers...

  • By
    JavaScript Event.defaultPrevented

    Whether you started with the old on_____ property or addEventListener, you know that events drive user experiences in modern JavaScript. If you've worked with events, you know that preventDefault() and stopPropagation() are frequently used to handle events. One thing you probably didn't know: there's a defaultPrevented...

  • By
    How to Reverse an Animated GIF

    Modifying visual media via code has always been a fascination of mine. Probably because I'm not a designer and I tend to stick to what I'm good at. One visual effect I love is seeing video reversed -- it provides a sometimes hilarious perspective...

  • By
    CSS :optional

    A decade ago HTML and CSS added the ability to, at least signal, validation of form fields. The required attribute helped inform users which fields were required, while pattern allowed developers to provide a regular expression to match against an <input>'s value. Targeting required fields...

  • By
    Get a Random Array Item with JavaScript

    JavaScript Arrays are probably my favorite primitive in JavaScript. You can do all sorts of awesome things with arrays: get unique values, clone them, empty them, etc. What about getting a random value from an array?To get a random item from...

  • By
    Input valueAsNumber

    Every once in a while I learn about a JavaScript property that I wish I had known about years earlier -- valueAsNumber is one of them. The valueAsNumber provides the value of an input[type=number] as a Number type, instead of the traditional string representation when...

  • By
    Immediately Executing setInterval with JavaScript

    Employing setInterval for condition polling has really been useful over the years. Whether polling on the client or server sides, being reactive to specific conditions helps to improve user experience. One task I recently needed to complete required that my setInterval immediately execute and...