Node EADDRINUSE (Address Already in Use) Error

Every once in a while my Macbook Pro freaks out and a process goes rogue.  This oftentimes happens when I’m working on the excellent debugger.html project; I attempt to start the server side of the debugger and suddenly I’m hit with an error that resembles the following, leading to the process not starting from that […]
The post Node EADDRINUSE (Address Already in Use) Error appeared first on David Walsh Blog.

Link: https://davidwalsh.name/node-eaddrinuse

Detect Supported Audio Formats with JavaScript

As streaming becomes our main entertainment source and vendors fight to create the best video format, it’s going to be more and more important that we detect device and browser video support before posting videos on our websites.  We think less about audio but the same principle applies:  detect whether or not a given audio format […]
The post Detect Supported Audio Formats with JavaScript appeared first on David Walsh Blog.

Link: https://davidwalsh.name/detect-supported-audio-formats-javascript

Split Files Into Smaller Files

As fast as internet connections have gotten over the years, it seems the size of files we want to share has grown faster.  Whether it’s archive (ZIP), video, or any other host of potentially large file types, it’s still tricky to put these large files somewhere to download since many storage providers have file size […]
The post Split Files Into Smaller Files appeared first on David Walsh Blog.

Link: https://davidwalsh.name/split-files

Show git Branch from Command Line

Whether it’s simply submitting pull requests or being snobby enough to use vim as a text editor, web developers and designers spend an awful lot of time working from command line.  If you do work with git, you know it’s important to keep track of your branches, especially when it comes to knowing which branch you’re […]
The post Show git Branch from Command Line appeared first on David Walsh Blog.

Link: https://davidwalsh.name/show-git-branch-command-line

Detect Supported Video Formats with JavaScript

Over the past few years we’ve been seeing new audio, video, and image formats take shape to challenge the legacy formats that we’ve used since the web’s inception.  This is a great development as we have more processing power and better compression algorithms have been developed, leading to faster load times and rendering.  Hooray for […]
The post Detect Supported Video Formats with JavaScript appeared first on David Walsh Blog.

Link: https://davidwalsh.name/detect-supported-video-formats-javascript

Object.create(null)

One of the funnest parts of JavaScript, or any programming language really, is that there are loads of tiny tricks and quirks that make the language that much more interesting.  I recently learned a nice fact about Object.create:  using null as the only argument to create an ultra-vanilla dictionary! Object.create has been an awesome utility for prototype […]
The post Object.create(null) appeared first on David Walsh Blog.

Link: https://davidwalsh.name/object-create-null

Match Special Letters with PHP Regular Expressions

Regular expressions come with all sorts of peculiarities, one of which I recently ran into when creating a regex within PHP and preg_match.  I was trying to parse strings with the format “Real Name (:username)” when I ran into a problem I would see a lot at Mozilla:  my regular expression wasn’t properly catching “special” […]
The post Match Special Letters with PHP Regular Expressions appeared first on David Walsh Blog.

Link: https://davidwalsh.name/letters-regex

Fill an Array with Sequential Values

I’ve been contributing to Mozilla’s awesome DevTools debugger because, well, I want to give back to the Firefox Engineers and all the developers who have stayed loyal to Firefox.  Having my hand in loads of Mozilla projects is really satisfying, especially for my ego. In any event, one task required me to fill an array […]
The post Fill an Array with Sequential Values appeared first on David Walsh Blog.

Link: https://davidwalsh.name/fill-array-javascript

Create a Waveform Image with ffmpeg

Waveform images have a variety of uses and I’ve started seeing waveform images overlaying at the bottom of videos.  That type of feature seems useful if you want to see identify music in a video or specific spaces in a video which feature action.  If you’re creating an audio-centric app, you may have a dozen […]
The post Create a Waveform Image with ffmpeg appeared first on David Walsh Blog.

Link: https://davidwalsh.name/waveform

Undo File Changes with Git

One of my favorite features in modern text editors is their ability to integrate tools to format code upon every save.  When you’re working on legacy projects, however, auto-formatting can be a problem; if you open a file that you don’t explicitly change, the file may still get modified by the formatter.  This all leads […]
The post Undo File Changes with Git appeared first on David Walsh Blog.

Link: https://davidwalsh.name/git-undo