🔗 Spice up your LiveView app with a cool loading spinner!

When developing applications, it's common to encounter scenarios where a user's request takes longer than expected. This delay can result from various factors like data transformation, external API calls, or slow database queries. Fortunately, when constructing a Phoenix app that … | Continue reading


@yellowduck.be | 4 months ago

🐥 Rewriting links in a Phoenix LiveView app

Phoenix LiveView is a powerful library that enables real-time interactivity in web applications, without requiring complex JavaScript frameworks. It's especially loved for its ability to keep everything dynamic and maintainable in Elixir, while still allowing fine-tuned control w … | Continue reading


@yellowduck.be | 4 months ago

🔗 defer() function in Laravel

The new defer() function in Laravel can be really useful when you need to perform an action that the user does not care about or don't want to wait for it. This can be useful when you are logging user interactions in an analytical database that takes a couple milliseconds or even … | Continue reading


@yellowduck.be | 4 months ago

🐥 Implementing a Python Singleton with Decorators

Implementing a Python Singleton with Decorators In Python, a singleton is a design pattern that ensures a class has only one instance, and it provides a global point of access to that instance. This is useful when managing shared resources such as database connections, configurat … | Continue reading


@yellowduck.be | 4 months ago

🔗 GitHub trick to find the commit that deleted a file

A common problem in git is finding the commit that deleted a file. The mechanism for doing this in a local repo is well-known: git log -- path/to/deleted/file There are variations on this command to control how hard you want to look, and which branch you want to look in, but tha … | Continue reading


@yellowduck.be | 4 months ago

🔗 MySQL ORDER BY with nulls first or last (at bottom or top)

Want to create a MySQL query where a column is sorted in ascending order but with nulls last (at the bottom), or where a column is sorted in descending order but with nulls first (at the top)? You can use ISNULL(column) to do this. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 4 months ago

🐥 Fixing the gettext warning in Phoenix

If you've recently updated your Phoenix/Elixir application and encountered a warning related to the Gettext backend, you're not alone. With newer versions of the Phoenix framework and the Elixir ecosystem, some older ways of defining Gettext backends have been deprecated. In this … | Continue reading


@yellowduck.be | 4 months ago

🔗 De 11 leukste route-tips voor op de fiets

Elke fietser heeft een favoriet rondje. Dat vaste plekje waar je even gaat lopen boren, die serie bochten waar je hard doorheen wilt en dat mooie uitzicht waar je altijd van geniet terwijl je benen gedachteloos ronddraaien. Heerlijk! Maar zelfs dat vaste rondje gaat soms vervelen … | Continue reading


@yellowduck.be | 4 months ago

🔗 4 Software Design Principles I Learned the Hard Way

I recently built and designed a massive service that (finally) launched successfully last month. During the design and implementation process, I found that the following list of "rules" kept coming back up over and over in various scenarios. These rules are common enough that I d … | Continue reading


@yellowduck.be | 4 months ago

🔗 What happens when you touch a Pickle to an AM radio tower?

A few months ago, our AM radio hot dog experiment went mildly viral. That was a result of me asking my Dad 'what would happen if you ground a hot dog to one of your AM radio towers?' He didn't know, so one night on the way to my son's volleyball practice, we tested it. And it was … | Continue reading


@yellowduck.be | 4 months ago

🔗 PostgreSQL 17 Released!

The PostgreSQL Global Development Group today announced the release of PostgreSQL 17, the latest version of the world's most advanced open source database. PostgreSQL 17 builds on decades of open source development, improving its performance and scalability while adapting to emer … | Continue reading


@yellowduck.be | 4 months ago

🐥 Using zsh to batch change file extensions

When managing files on macOS, you might often need to batch rename multiple files, such as changing their extensions. While there are various ways to do this, using Zsh (Z Shell) is one of the most efficient, especially with the built-in zmv function. In this post, I'll guide you … | Continue reading


@yellowduck.be | 4 months ago

🔗 Good software development habits

This post is not advice, it's what's working for me. It's easy to pick up bad habits and hard to create good ones. Writing down what's working for me helps me maintain any good habits I've worked hard to develop. Here's an unordered list of 10 things that have helped me increase … | Continue reading


@yellowduck.be | 4 months ago

🔗 What happens when you type a Phoenix URL into your address bar and press "Enter"?

Here's a classic question that I've asked and been asked in many job interviews: "What happens when you type a URL into your browser's address bar and hit Enter?" A good answer includes a basic explanation of DNS, networking and the structure of an HTTP request and response. But … | Continue reading


@yellowduck.be | 4 months ago

🐥 Elixir can pack a lot into a little

I came across this example of how nice and concise Elixir can be. It's a simple Github API client that does quite a bit in a small space. I like it. Elixir can pack a lot into a little. I do have doubts if I'm over compacting it a bit but but frankly I like this. Here's a simple … | Continue reading


@yellowduck.be | 4 months ago

🔗 Small Batch Thinking in UX Improves Usability and Code Quality

I like how applying the lean concept of small batches to UX had a direct impact on software design and quality. The cherry on top is that the Edit/Save overhead seems to be negligible, which is another proof point that smaller batches, despite having higher overhead, lead to high … | Continue reading


@yellowduck.be | 4 months ago

🐥 Removing a commit from a remote git branch

Manipulating history is very common for developers who work with Git regularly. Indeed, developers often need to remove commits from the Git history. Luckily, Git provides many commands to make this operation possible. Let's get to it 😎. Step 0 - Preparation Before manipu … | Continue reading


@yellowduck.be | 4 months ago

🔗 10 Practical Tips for Better Vue Apps

Here are 10 practical tips to for better Vue applications ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 4 months ago

🐥 .gitignore files on GitHub

Super quick tip I use all the time but people may not be aware - @github maintains a list of gitignores (with 161k ⭐️!) for every single language and you can clone them into your project with a oneliner: npx gitignore Just in case someone here doesnt know, now you do. The git r … | Continue reading


@yellowduck.be | 4 months ago

🔗 VMware Fusion Pro: Now Available Free for Personal Use

VMware Desktop Hypervisor products Fusion and Workstation are used by millions of people every day to run virtual machines on their Windows, Linux and Mac computers. They give users the ability to quickly and easily build "local virtual" environments to install other operating sy … | Continue reading


@yellowduck.be | 4 months ago

🐥 A subtlety of Ecto.Query.preload

A subtlety of Ecto.Query.preload is that it makes an extra DB query. To avoid this you need to explicitly do the join yourself. E.g. see below how the first query loads the teams with a separate SELECT but the second loads the users and teams all at once. So, if you do this: 1Rep … | Continue reading


@yellowduck.be | 4 months ago

🐥 A subtlety of Ecto.Query.preload

A subtlety of Ecto.Query.preload is that it makes an extra DB query. To avoid this you need to explicitly do the join yourself. E.g. see below how the first query loads the teams with a separate SELECT but the second loads the users and teams all at once. So, if you do this: 1Rep … | Continue reading


@yellowduck.be | 4 months ago

🔗 Elixir Idioms for JavaScript Developers

When I set out to write this blog post, it was initially titled "Elixir Cheatsheet for JavaScript Developers." Halfway through writing the post, I realized I had more than seven pages worth of content — far from a cheatsheet. There were so many interesting points of comparison an … | Continue reading


@yellowduck.be | 4 months ago

🔗 Tackling ChatGPT's UX woes with optimistic updates in Phoenix LiveView

Part 2 of José Valim covering ChatGPT's new UI. "It's a paradox for a server-side framework to have so many affordances and abstractions on the client." ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 5 months ago

🔗 Why I Prefer Exceptions to Error Values

Exceptions are often a better way to handle errors than returning them as values. We argue that traditional exceptions provide better user and developer experience, and show that they even result in faster execution. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 5 months ago

🐥 Hide network requests from extensions

In @ChromeDevTools you can hide network requests from Chrome extensions! Great for focusing on just your code when performance profiling. source | Continue reading


@yellowduck.be | 5 months ago

🔗 SQLite is not a toy database

hether you are a developer, data analyst, QA engineer, DevOps person, or product manager - SQLite is a perfect tool for you. Here is why. A few well-known facts to get started: SQLite is the most common DBMS in the world, shipped with all popular operating systems. SQLite is serv … | Continue reading


@yellowduck.be | 5 months ago

🔗 New talk: Making Hard Things Easy

A few weeks ago I gave a keynote at Strange Loop called Making Hard Things Easy. It's about why I think some things are hard to learn and ideas for how we can make them easier. Here's the video, as well as the slides and a transcript of (roughly) what I said in the talk. ⚠️ This … | Continue reading


@yellowduck.be | 5 months ago

🔗 Why GitHub Actually Won

If you want a very short read, here is the quick version of why I believe GitHub won and why you're probably using the site to this day. I can boil it down to exactly two reasons that happened to resonate with each other at the perfect frequency. GitHub started at the right time … | Continue reading


@yellowduck.be | 5 months ago

🐥 How to get class constants with Reflection in PHP

PHP's reflection capabilities are powerful tools that allow you to inspect and manipulate class information at runtime. One handy use case is fetching class constants dynamically. However, if you're working with inheritance, you may want to filter out constants that come from a p … | Continue reading


@yellowduck.be | 5 months ago

🔗 Six Degrees of Kevin Bacon - Postgres Style

Back in the 1990s, before anything was cool (or so my children tell me) and at the dawn of the Age of the Meme, a couple of college students invented a game they called the "Six Degrees of Kevin Bacon". The conceit behind the Six Degrees of Kevin Bacon was that actor Kevin Bacon … | Continue reading


@yellowduck.be | 5 months ago

🐥 How to Build a Simple Cron Job in an Elixir Web App

When developing a web application in Elixir, you may occasionally need to schedule a task to run at regular intervals, like sending email notifications, cleaning up old records, or triggering a background process. While there are libraries like Quantum or Oban that make this task … | Continue reading


@yellowduck.be | 5 months ago

🔗 Your company needs Junior devs

Getting coffee with a bunch of local tech leaders, I surprised myself with how stridently I argued why companies should hire junior engineers. Lately, BigTech only wants elite squads of Staff devs that can "hit the ground running" on the big (often AI) initiative. It's been remar … | Continue reading


@yellowduck.be | 5 months ago

🔗 Is Linux collapsing under its own weight? On Rust for Linux

Recently, one of the developers of the Rust for Linux project, Wedson Almeida Filho, resigned from the project. In his parting message, he linked a video of a filesystem maintainer shouting at him. Afterward, Asahi Lina, developer of the Apple GPU drivers for Linux (which have no … | Continue reading


@yellowduck.be | 5 months ago

🔗 uv under discussion on Mastodon

Jacob Kaplan-Moss kicked off this fascinating conversation about uv on Mastodon recently. It's worth reading the whole thing, which includes input from a whole range of influential Python community members such as Jeff Triplett, Glyph Lefkowitz, Russell Keith-Magee, Seth Michael … | Continue reading


@yellowduck.be | 5 months ago

🔗 Vue 3.5 Released: New features and improvements

Vue 3.5 has just dropped this week, and it's packed with some nice features and improvements. I have been digging through the release notes and playing around with the new features, so let me glance over the highlights! ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 5 months ago

🔗 Do Macs need third-party antivirus for SOC 2 compliance?

This piece answers whether the built-in security of macOS is enough to forgo a third-party antivirus solution, and how admins can document that security for a SOC 2 audit. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 5 months ago

🐥 TIL: Preserving keys in Laravel resources

I've run into a problem where I've used an attribute casted as an array in a Laravel resource and I wanted to preserve the keys of that array. By default, Laravel will re-index the array, which is not what I wanted. To preserve the keys, you can use the preserveKeys method on the … | Continue reading


@yellowduck.be | 5 months ago

🔗 How we build forms in LiveView + LiveSvelte

We wrote previously about how much we enjoyed using LiveView with LiveSvelte. Since then, we've open sourced a lot of LiveView/LiveSvelte code. I thought it would be a good time to share the design patterns that have emerged with this stack so far. I'll focus primarily on how we … | Continue reading


@yellowduck.be | 5 months ago

🔗 LiveView is best with Svelte

Phoenix's LiveView has polarized our team. Compared to SPA, there are components and features that we're able to build 2-3x faster. Conversely, there are components and features that are frustrating to build or feel very counterintuitive. Said another way, LiveView makes a lot of … | Continue reading


@yellowduck.be | 5 months ago

🔗 Give me /events, not webhooks

Webhooks are a supplement to many APIs. With a webhook system in place, System B can register to receive notifications about certain changes to System A. When a change occurs, System A pushes the change to System B, usually in the form of making an HTTP POST request. Webhooks are … | Continue reading


@yellowduck.be | 5 months ago

🐥 Pinning packages in Homebrew

A while ago, MySQL version 9 was released and I wanted to keep using version 8 to stay in sync with our production systems. I found out that Homebrew allows you to pin packages to a specific version so that won't accidentally get upgraded when running brew upgrade. Here's how you … | Continue reading


@yellowduck.be | 5 months ago

🔗 Elixir Task.async_stream/3

Honestly, these three lines of code should be all you need to show somebody the immense power of Elixir. With just one function call, you can parallelise a task over all available CPUs. One! 1# Counts the characters in each word and returns the overall sum. 2# 3# Task.async_strea … | Continue reading


@yellowduck.be | 5 months ago

🔗 Build a Roles and Permissions System for Phoenix - Part 2

In the first post of this mini-series, we learned how to implement basic permissions for your schemas, how to group them into roles, and how to assign the roles to our users. We used the role to check a user's permissions in our Phoenix Controllers. Our controllers lie at the out … | Continue reading


@yellowduck.be | 5 months ago

🔗 Build a Roles and Permissions System for Phoenix - Part 1

Hey folks, before we begin: Salespeople can be persistent, can't they? The other day, one tried to sell me a coffin. I told him that's the last thing I need! Anyways. Today, we'll look into how to set up a basic roles and permissions (RAP) system with Phoenix and Ecto. I got this … | Continue reading


@yellowduck.be | 5 months ago

🔗 Add an use a JSONB field in Phoenix and Ecto

PostgreSQL has native support for objects stored as JSON as actually binary JSON (or JSONB). With JSONB format, you can add index do the column for faster and more efficient reads. Even though the format supports both storing arrays of maps and nested maps, I suggest making it si … | Continue reading


@yellowduck.be | 5 months ago

🔗 Doing Background Work Using a Native Elixir Approach

If you've used Ruby before, background job queues are a tool you might reflexively reach for when building applications in Elixir. While such solutions exist, you may find that they aren't used that much in Elixir, which might leave you wondering why. I mean, don't Elixir applica … | Continue reading


@yellowduck.be | 5 months ago

🔗 Departure Mono

Departure mono is a monospaced pixel font with a lo fi technical vibe. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 5 months ago