Tutorials Page 17

  • By
    Detect Changed Files with git

    There are numerous reasons to want to know which files have been added or modified in a git repository, one of which is your text editor highlighting those files. Another use case is running tasks against only files which are presently changed, like lint or...

  • By
    cookieStore: Async Cookie API

    One pattern in the JavaScript API world that web development veterans will notice is that we've been creating new methods to accomplish what older, grosser APIs once achieved. XMLHttpRequest became the fetch API, some APIs like Battery became async, and there are dozens of other examples.

  • By
    How to Prevent Pasting into an Input

    Every once in a while I get to a website that doesn't allow me to paste into a form input. In most cases it's something to do with login credentials (username and or password) and auth codes. So how are they preventing me from...

  • By
    Sports Data for Developers: SportdataAPI

    Most of the side projects I consider starting revolve around sports, since I'm a huge sports fan. I spend my Saturdays watching soccer, Sundays spent watching soccer and NFL, and of course the mid-week Champions League and Europa League matches. One problem I've...

  • By
    39 Shirts – Leaving Mozilla

    In 2001 I had just graduated from a small town high school and headed off to a small town college. I found myself in the quaint computer lab where the substandard computers featured two browsers: Internet Explorer and Mozilla. It was this lab where I fell...

  • By
    Curate Custom Content with mediastack

    I used to have a personal aggregator of sites I enjoyed but maintaining it was a nightmare. I needed to grab each site's RSS feed, categorize their contents, deal with errors and individual rate limits, etc. I had to tear the whole project down because it...

  • By
    How to Detect When a Sticky Element Gets Pinned

    The need for position: sticky was around for years before it was implemented natively, and I can boast that I implemented it with JavaScript and scroll events for ages. Eventually we got position: sticky, and it works well from a visual perspective, but I wondered how...

  • By
    Shoelace 2.0: A Forward-thinking Library of Web Components

    A few years ago, I released a lightweight alternative to Bootstrap affectionately named Shoelace. Shoelace was small and fast because of its minimal design and pure CSS approach to styling. It used CSS custom properties extensively to enable customizations, even when loaded via...

  • Media Temple Hosting
  • By
    How to Detect the Default Branch in a git Repository

    Over the past few years, many engineering teams have switched their default git branch name from master to a different, potentially less offensive term. I'm all for choosing to name your default branch whatever you'd like, but not having a universal default branch name can...

  • By
    How to Create an Async Function via “new Function”

    One thing I love about JavaScript is that there are many ways to accomplish the same task, one such example being creating functions. There are several patterns for functions; one of the last you see used is the new Function method:What if you want...