David Walsh

Mercurial Tips

While most of the world seems to be using git for version control, Mozilla continues to use Mercurial (hg) to manage the Firefox source code. As a git and GitHub lover, it took me a while to get used to Mercurial. I don’t consider myself a hg expert but I know enough to complete 99% […]

The post Mercurial Tips appeared first on David Walsh Blog.

Data URIs

We’re all familiar with traditional URI protocols like https, http, ftp, and file, but data URIs have become a large part of our online strategy. We can use them to display images, the Mac camera and webcams, and more. But what if we simply want to use a data URI to convey basic data? Typing […]

The post Data URIs appeared first on David Walsh Blog.

How to Crop Videos

During a recent episode of the Script and Style podcast, I had noticed that the video recording had showed a bit of our internal chat that wasn’t necessary for our viewers to see. While there’s nothing wrong with giving viewers a peek into the show preparation, presenting the best possible video is our priority. So […]

The post How to Crop Videos appeared first on David Walsh Blog.

then on Objects

Promises were a revelation in JavaScript development, allowing us to enjoy async processing and avoid callback hell. Many new APIs like Battery API, Cache API, and others use the promise API. One fact you may not know is that you can add a then method to any object to make it Promise-like! Let’s create a […]

The post then on Objects appeared first on David Walsh Blog.

Optional Chaining

For all of the improvements that the JavaScript language has added over the past few years, like the spread operator, default argument values, and arrow functions, there are still a few features I’d love to see implemented. One such feature is optional chaining. Optional chaining allows developers to reference object properties which may or may […]

The post Optional Chaining appeared first on David Walsh Blog.

JavaScript Proxy with Storage

The JavaScript Proxy API provides a wealth of “magic” within JavaScript, allowing you to use any object as sort of an alias that allows a wall of validation, formatting, and error throwing. Did you know that you could also employ the Proxy API as an abstraction to different types of storage? Whether it’s sessionStorage, localStorage, […]

The post JavaScript Proxy with Storage appeared first on David Walsh Blog.