7 Ways to Optimize Performance for Your WordPress Site (Sponsored)

The vast majority of blogs, news websites, and information websites run on WordPress. While the WordPress developer team and community do their best to ensure wordPress is performant, there are a number of practices you can implement to keep your site blazing fast. Let’s look at some of them! Use Cloudinary WordPress Plugin for Media Cloudinary is the most dynamic media transformation, delivery, and optimization service on the internet. With Cloudinary you can: Deliver optimized images, audio, and video per device, platform, and browser Use the Cloudinary API or querystring parameters to customize media on the fly Take advantage of client side JavaScript libraries to create image viewers,... more →
Posted in: JavaScript

An example of Algolia Search with Alpine.js

As my readers know, I’ve been falling in love with Alpine.js lately and am always on the hunt for more ways to practice using the framework. I thought I’d share an example of how you could use it with Algolia’s JavaScript client. I use that on my search page here with Vue.js, so it wasn’t a terribly difficult thing to rebuild a similar interface in Alpine.js. Here’s how I did it. Raymond Camden… more →
Posted in: JavaScript

How to Get Extension Manifest Information

Working on a web extension can be kinda wild — on one side you’re essentially just coding a website, on the other side you’re limited to what the browser says you can do in the extension execution environment. One change in that environment is coming January 2023 — pushing extensions to move to manifest version 3. I recently got curious about whether other popular extensions had completed the version 3 update. Executing the following command in the background page (manifest version 2) or service worker (version 3) will provide you the extension’s manifest: chrome.runtime.getManifest() The getManifest call returns a large object detailing the extension’s... more →
Posted in: JavaScript

JavaScript String replaceAll

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: 'yayayayayaya'.replace('ya', 'na'); // nayayayayaya To replace all instances of a substring, you’ve needed to use a regular expression: 'yayayayayaya'.replace(/ya/g, 'na'); // nananananana Using regular expressions is certainly powerful but let’s be honest — oftentimes we simply want to replace all instances of a simple substring that shouldn’t... more →
Posted in: JavaScript

How to Reverse an Animated GIF

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: To reverse an animated GIF or video, you can use the ImageMagick library: convert water-forward.gif -coalesce -reverse -quiet -layers OptimizePlus -loop 0 water-reversed.gif If you’re interested in media engineering, check out my previous ImageMagick tutorials. These awesome media libraries are as close to an artist I will ever get! The post How to Reverse an... more →
Posted in: JavaScript

Related Content by Day of Year in Eleventy

Ok, chalk this up to something that is probably useful to one out of ten of my readers, but the idea’s been bouncing around my brain for a few months now and I finally took the time to build it out. Imagine a content site that’s been around for a while, for example, this blog (twenty years next February). It may be interesting to tie articles to content written in the past, specifically, on the same day in previous years. This requires a site with years of content and enough content such that there would actually be a decent chance of that happening, but I could see newspaper sites or other news organizations being able to meet that criteria. For... more →
Posted in: JavaScript

Testing the Netlify Cache Plugin with Eleventy

For months now I’ve been meaning to check out, and try, the Netlify Caching plugin. This plugin lets you cache resources between builds saving you time when doing builds. I didn’t doubt it worked, but I needed to give it a try myself to see it in action. To test it out, I used Eleventy, but note that you can use any static site generator with the plugin. (It just won’t be as cool.) Raymond Camden… more →
Posted in: JavaScript
1 30 31 32 33 34 87