Quick Tips Tutorials

  • 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...

  • By
    Restart Mac From Command Line

    Restarting and shutting down a computer remotely is a frequent task for remote system administrators. As someone that writes many shell scripts, I also find myself automating system restarts. Let's look at a few ways to restart Mac systems from command line!Restart a Local MacTo...

  • By
    How to Get a Computer’s Hardware ID

    Cheating in online games is a huge issue these days -- just ask anyone playing PUBG. Cheaters aren't difficult for players to spot but vendors oftentimes don't do enough to punish these villains. Krafton recently announced they would start banning cheaters by hardware ID...

  • By
    How to Get Mac Battery Level from Command Line

    I'm a big fan of having as much information as I can get within the command line. I couldn't go without knowing which git branch I'm on, for example. Another important piece of information I like having is my current battery percentage.To get...