Thu, 23 Jun 2022 13:37:08 +0000

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 on a given event. Take this reversed water effect for example: […] The post How to Reverse an Animated GIF appeared first on David Walsh Blog.

Sun, 22 May 2022 21:58:05 +0000

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 and validation values with just CSS and HTML was very […] The post CSS :optional appeared first on David Walsh Blog.

Mon, 09 May 2022 10:59:17 +0000

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 an array, you can employ Math.random: const arr = [ "one", "two", "three", […] The post Get a Random Array Item with JavaScript appeared first on David Walsh Blog.

Tue, 26 Apr 2022 11:04:50 +0000

I’m always really excited to see new methods on JavaScript primitives. These additions are acknowledgement that the language needs to evolve and that we’re doing exciting new things. That being said, I somehow just discovered some legacy String methods that you probably shouldn’t use but have existed forever. Let’s take a look! These legacy string […] The post Legacy String Methods for Generating HTML appeared first on David Walsh Blog.

Mon, 25 Apr 2022 11:24:54 +0000

I was recently re-reading my Interview with a PornHub Web Developer and one bit I started thinking about was the VR question and the idea of making users not just see but feel` something. The haptic feedback of VR games is what really sets them apart from your standard PC or console game. So when […] The post Interview with an Intiface Haptics Engineer appeared first on David Walsh Blog.

Tue, 05 Apr 2022 10:42:58 +0000

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 you get the value: /* Assuming an <input type="number" value="1.234" […] The post Input valueAsNumber appeared first on David Walsh Blog.

Mon, 04 Apr 2022 11:25:00 +0000

Web apps are accepting numerous types of inputs, from basic text to code to imagery, files, and more. It’s important that we validate the contents we receive but if you do allow arbitrary text, it’s good to know what exactly has been submitted so you can present it properly. Enter the Code Detection API — […] The post Advanced Code Display with Code Detection API (Sponsored) appeared first on David Walsh Blog.

Mon, 28 Mar 2022 10:03:15 +0000

For as long as developers have written CSS code, we’ve been desperate to have a method to allow styling a parent element based child characteristics. That’s not been possible until now. CSS has introduced the :has pseudo-class which allows styling a parent based on a relative CSS selector! Let’s have a look at a few […] The post CSS :has appeared first on David Walsh Blog.

Thu, 10 Mar 2022 12:17:39 +0000

Many of the web functionalities that we rely on once lived within individual desktop applications. From office suites, games, and financial tools, all of them are now web applications; they’re just as feature packed as their desktop counterparts. In the past I’ve used a variety of JavaScript grid widgets on client sites, and each had […] The post Flexible, Powerful DataGrad from Sencha (Sponsored) appeared first on David Walsh Blog.

Mon, 07 Mar 2022 12:23:13 +0000

It’s been a while since I’ve gotten a few things off of my chest and since I’m always full of peeves and annoyances I thought it was time to unleash: Due to the immensely negative response to any tweet about crypto from my blog account, I created a second account just for crypto musings. I’ll […] The post Confessions of a Web Developer XIX appeared first on David Walsh Blog.

Sun, 06 Mar 2022 10:21:21 +0000

Automation is a really important skill for engineers, especially when it comes to working with various file types. The more you accept for input, and the more you automate, the better end output you can offer. Filestack’s workflows allow developers to define automated tasks using a their specialized UI. With no coding required, it’s easy […] The post Simplify Your File Handling With Filestack Workflows (Sponsored) appeared first on David Walsh Blog.

Mon, 21 Feb 2022 10:42:25 +0000

Seemingly every website, dapp, and app offers a dark mode preference, and thank goodness. Dark mode is especially useful when I’m doing late night coding, or even worse, trading into altcoins. I’m presently working on implementing a dark theme on MetaMask and it got me to thinking: is there a way we can default to […] The post Detect Dark Mode Preference with JavaScript appeared first on David Walsh Blog.

Tue, 01 Feb 2022 10:54:21 +0000

One of my aspects of JavaScript that drew me to it as a young developers was that its syntax was loose and I could code quickly. As you gain experience as an engineer, you start to realize that some traditional coding structure is a good thing, even if it slows you down. Using Jest or […] The post JavaScript Class Privates appeared first on David Walsh Blog.

Mon, 31 Jan 2022 10:12:38 +0000

Readers of my blog will know that I’ve been banging the Cloudinary drum for years. Their awesome media capabilities allow users to optimally deliver images, video, and audio in any format and to any device. Performance, customization, flexibility, optimized delivery… Cloudinary makes media better for everyone. Another aspect of Cloudinary that I like? Their commitment […] The post Easy Asset Access with the Cloudinary Media Library Browser Extension appeared first on David Walsh Blog.

Thu, 27 Jan 2022 11:32:58 +0000

Some things happen in your life at exactly the right time. It could be meeting the right person, discovering an open source project you go on to join, or even starting a blog when you’re bored with a job you don’t enjoy. All of those things happened to me at the right time and brought […] The post I Love You, Ringo appeared first on David Walsh Blog.

Wed, 19 Jan 2022 10:05:39 +0000

There’s a common saying that adults spend more time with coworkers than family; for us software engineers, we spend more time with our text editor than our families. And why shouldn’t we? They’re our main tool to do a variety of things, and as these editors evolve, they’re capable of doing even more. UltraEdit, a […] The post Amazing Text Editing Experiences with UltraEdit (Sponsored) appeared first on David Walsh Blog.

Mon, 17 Jan 2022 09:57:30 +0000

In the last article in this series, Awesome Git Aliases, we took a look at some awesome aliases for Git. However, the true power of Git aliases comes from writing custom scripts. These allow you to build Git commands that can do anything you can imagine. In this article, I’ll show you how you can […] The post More Awesome Git Aliases appeared first on David Walsh Blog.

Fri, 14 Jan 2022 02:53:15 +0000

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 then continue executing. The conventional and best way to immediately call […] The post Immediately Executing setInterval with JavaScript appeared first on David Walsh Blog.

Fri, 07 Jan 2022 02:05:04 +0000

One of my least favorite tasks as a software engineer is resolving merge conflicts. A simple rebase is a frequent occurrence but the rare massive conflict is inevitable when many engineers work in a single codebase. One thing that helps me deal with large rebases with many merge conflicts is flattening a branch’s commits before […] The post How to Flatten git Commits appeared first on David Walsh Blog.

Mon, 27 Dec 2021 22:10:20 +0000

Replacing a substring of text within a larger string has always been misleading in JavaScript. I wrote Replace All Occurrences of a String in JavaScript years ago and it’s still one of my most read articles. The confusion lies in that replace only replaces the first occurrence of a substring, not all occurrences. For example: […] The post JavaScript String replaceAll appeared first on David Walsh Blog.