Martin Lefebvre's blog

Posts

HTMX: Simple AJAX

We all remember AJAX (Asynchronous JavaScript and XML). I’ve spent many hours and many days creating XMLHttpRequest objects and using jQuery’s .get and .post methods to connect HTML to a PHP backend to achieve that true “no full page load” magic. That’s still possible today… It’s also even simpler with HTMX, a small library that makes HTML dynamic. At its most basic, HTMX queries endpoints and updates HTML elements with the returned content (usually text or HTML).

Software Development is dead... Long live software development!

Software development is dead. We’ve all heard it. But is it true? My opinion is that it depends on how you define software development. If for you software development means sitting down with Vim or Visual Studio Code and writing APIs from scratch with ExpressJS, then yes, it’s dead. AI can do that. Better? Unlikely, but just as good as you. Faster? Way faster than you. Today, you tell an AI tool that you need an API to query and manage customer profiles.

SOLID -- Single Responsibility Principle

Ever since I started looking for work, something has become extremely clear – while I am familiar with the practical aspects of software design and development, a lot of the theoretical patterns are beyond fuzzy. To address this, I have gone back to studying some of the basic design patterns and principles, starting with SOLID, which came to light in the early 2000s. Single Responsibility Principle The first of these five software design principles is the “Single Responsibility Principle”.

How to publish my Obsidian-based blog

$ rsync -a --delete --info=NAME <path to blog subdir in Obsidian vault> <path to hugo-managed site>/content/posts/ $ cd <hugo-managed site> $ hugo $ git add . $ git commit -m "<Commit Message>" $ git push $ git subtree split --prefix public -b public_site $ git push origin public_site:public_site --force $ git branch -D public_site

The Singleton

Handling MySQL Connections in TypeScript: The Good, the Bad, and the “Too Many Connections” Error When building a TypeScript application that talks to MySQL, how you manage database connections matters more than it might initially appear. A seemingly harmless pattern can quietly work its way into production and, under load, bring your application down with the dreaded: Error: Too many connections In this post, we will look at a bad but common approach to handling MySQL connections, why it causes problems, and then contrast it with a simple, effective approach that leverages ES modules and the Singleton pattern—without classes.

From Dial-Up to Docker... A Developer's Journey

Hello and welcome to my personal blog! My name is Martin Lefebvre, and I’m a full-stack software developer with a passion for technology that has spanned over two decades. With 20 years in software development and 30 years of experience with Linux, I’ve had a front-row seat to the incredible evolution of our industry. This blog is where I’ll be sharing my insights, experiences, and thoughts on the ever-changing world of tech.