πŸ₯ Setting up a firewall on your VPS

Running your SaaS on a budget VPS might seem like a smart, cost-effective choice, but it's a bit like leaving your front door wide open in a sketchy neighborhood. Most budget VPS providers come with zero security configurations by default. That means unless you take action, you'r … | Continue reading


@yellowduck.be | 26 days ago

πŸ”— Streamline Your Laravel Models with Stringable Attributes

Laravel's AsStringable cast is a powerful tool that can significantly enhance how you work with string attributes in your Eloquent models. By transforming your string attributes into Stringable objects, you gain access to a wide array of string manipulation methods, leading to cl … | Continue reading


@yellowduck.be | 27 days ago

πŸ”— Context maintainability & guidelines in Elixir & Phoenix

The concept of Phoenix Context may appear straightforward, yet its potential for significantly boosting Phoenix app maintainability is profound. However, the truth is many developers grapple with its effective implementation. In this blog post, I will unveil a strategic solution … | Continue reading


@yellowduck.be | 28 days ago

πŸ”— Understanding Hooks in the Phoenix Framework

In the current piece, we will focus our attention on the concept of hooks in the Phoneix app. Phoenix Framework Hooks are a great extension of LiveView improvements by executing custom JavaScript on the client side. It enables you to use JavaScript directly, which isn't feasible … | Continue reading


@yellowduck.be | 29 days ago

πŸ₯ Use Logger metadata in Elixir to spruce up your logs

If you're like me, a light sprinkling of color helps make your log output clearer and more engaging. Fortunately, Elixir's Logger module allows you to easily add color to your log messages using the ansi_color metadata option. Adding color to log messages The ansi_color option le … | Continue reading


@yellowduck.be | 29 days ago

πŸ”— Does it scale (down)?

It's 2024, and software is in a ridiculous state. Microservices, Kubernetes, Kafka, ElasticSearch, load balancers, sharded databases, Redis caching… for everything. Everything's being built like it's about to hit a billion users overnight. Guess what? You don't need all that stuf … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Optimizing Postgres table layout for maximum efficiency

When modeling a Postgres database, you probably don't give much thought to the order of columns in your tables. After all, it seems like the kind of thing that wouldn't affect storage or performance. But what if I told you that simply reordering your columns could reduce the size … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— What is the history of the use of "foo" and "bar" in source code examples?

The terms "foo" and "bar" in code examples originated from the WWII military acronym "FUBAR" (F**ked Up Beyond All Recognition). The popularity of "foo" and "bar" in code likely stems from their association with this military jargon. Continue reading on softwareengineering.stacke … | Continue reading


@yellowduck.be | 1 month ago

πŸ₯ How to properly annotate a custom Laravel Eloquent Builder

When working with Eloquent models in Laravel, customizing the query builder can greatly improve code readability and flexibility. However, maintaining type safety and providing accurate autocompletion in IDEs (like PHPStorm or VSCode) can be challenging, especially when dealing w … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— What happens when you visit a LiveView URL?

A classic job interview question is: "What happens when you type a URL into your browser's address bar and hit Enter?" In my last post, I explained how it works in a Phoenix app: Phoenix initializes a %Plug.Conn{} representing the incoming HTTP request, then passes it through a c … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— LiveView JS: The Comprehensive Guide

Unlock the full potential of Phoenix LiveView with this comprehensive guide to LiveView JS commands! In this video, I'll cover: All 19 LiveView JS commands in detail Examples and use cases for each command Tips for combining commands to create powerful interactions Best practices … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Papercups: Customer Service Platform

We are living in an interesting time, where large language models are reshaping the way we interact with the world. One of the areas where this impact is most noticeable is in communication with real people, such as in customer support. It used to be necessary to have a team hand … | Continue reading


@yellowduck.be | 1 month ago

πŸ₯ Measuring code performance with console.time and console.timeEnd in JavaScript

As developers, we often need to optimize the performance of our code, and one of the first steps in this process is measuring how long certain pieces of code take to run. In JavaScript, the console.time and console.timeEnd methods provide an easy way to measure execution time dir … | Continue reading


@yellowduck.be | 1 month ago

πŸ₯ Measuring code performance with the console in JavaScript

About programming, AI and devops | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Serialization is the Secret

If a value mutates in the forest with no one to see it, does it really mutate? One of the major elements that sets Elixir apart from most other programming languages is immutability. But what does that actually mean? What does it do for us? Continue reading on zachdaniel.dev ⚠️ T … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Building Multiplayer Tetris from scratch with OTP, Elixir, and Phoenix

Let's play Tetris together! In this talk we'll play a live game of Tetris battles together, and then have a look at how it works under the hood. We'll take a tour through the code and show how a multi-participant browser based game or tool can be built using only Elixir and Phoen … | Continue reading


@yellowduck.be | 1 month ago

πŸ₯ TIL: Deleting duplicate rows in a database

Today I learned a neat trick for deleting duplicate rows in a database with a single query… MySQL 1WITH duplicates AS ( 2 SELECT id, ROW_NUMBER() OVER( 3 PARTITION BY firstname, lastname, email 4 ORDER BY age DESC 5 ) AS rownum 6 FROM contacts 7) 8DELETE contacts … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Proposal to make MariaDB the default MySQL variant in Ubuntu 25.04

The MariaDB Server, a fork of MySQL created in response to it being acquired by Oracle, has been the default MySQL variant in Debian since 2016. Starting from Debian 9 "Stretch" in 2017, MariaDB has been the only MySQL variant in stable Debian releases. The situation has been sim … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— PostgreSQL: Full text search with the "websearch" syntax

PostgreSQL's powerful full text search feature supports several query syntaxes. Of these, a website search feature should typically pick the websearch syntax. websearch copies some features from popular search engines, as covered below, offering familiar short syntax to users. It … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Note: Alias for fast testing in Elixir

In my previous note Shorter feedback loops with Elixir tests I already described how to run tests in Elixir, where it only runs the failed tests. Below is what I put in my mix.exs file to have faster feedback loops when testing: 1defp aliases do 2 [ 3 ... 4 " … | Continue reading


@yellowduck.be | 1 month ago

πŸ₯ Backing up a PostgreSQL database

When it comes to managing PostgreSQL databases, creating backups is essential to ensuring the safety and integrity of your data. One common way to back up a PostgreSQL database is by using the pg_dump command. In this post, we will dive into an example command: 1pg_dump -O -x --b … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— PostgreSQL and UUID as primary key

UUIDs are often used as database table primary keys. They are easy to generate, easy to share between distributed systems and guarantee uniqueness. Considering the size of UUID it is questionable if it is a right choice, but often it is not up to us to decide. This article does n … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Tools - What and When to use

There is a dozen of tools me and my friends use daily. We save time, effort and automate safety. CI works for us. We have better sleep and more time for fun work. Yet, you might have missed them. I made this tiny page to put them all in single place and make it easy to use for ev … | Continue reading


@yellowduck.be | 1 month ago

πŸ₯ Showing Elixir server logs in the browser console

When you are developing a Phoenix application, you might want to see the server logs in the browser console. This can be useful to debug issues that only happen in the server side. There are two changes you need to make to your Phoenix application to achieve this: You need to ena … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Building LLM-powered applications in Go - The Go Programming Language

As the capabilities of LLMs (Large Language Models) and adjacent tools like embedding models grew significantly over the past year, more and more developers are considering integrating LLMs into their applications. Since LLMs often require dedicated hardware and significant compu … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— OpenFreeMap

OpenFreeMap lets you display custom maps on your website and apps for free. You can either self-host or use our public instance. Everything is open-source, including the full production setup β€” there's no "open-core" model here. Check out our GitHub. The map data comes from OpenS … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Stop using SERIAL in Postgres

Internally, Postgres generates a sequence for both serial and identity columns, using the convention __seq. But the way it manages these sequences is where things get interesting. We'll uncover these differences as we explore the issues with serial and how identity columns solve … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Getting Started with Ash Framework in Elixir

Are you looking for a powerful and flexible way to build Elixir applications? Look no further than the Ash framework! In this blog post, we'll introduce you to Ash, explain why it's great for building applications, and show you how to get started. ⚠️ This post links to an externa … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Wonderful vi

The speed of change in technology often appears to be the industry's defining characteristic. Nothing highlights that perception more than the recent and relentless march of AI advancements. But for as much as some things in technology change, many other things stay the same. Lik … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Types vs No Types - How Types Allow Code to Scale across Developers, Organizations, and Lines of Code

Static vs dynamic types is one of the many evergreen arguments in the software engineering community. I'm not going to argue static vs dynamic - they both have their pros / cons and largely this is a false dichotomoy, there's a whole matrix of strict -> loose, static -> inferred … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Read Easier With our Free Font

Is this font easy for you to read? Goodβ€”that's the idea. Our font, Atkinson Hyperlegible was carefully developed by the Braille Institute to help low-vision readers. It improves legibility and readability through clear, and distinctive letters and numbers. Our award-winning font … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— The Saga Pattern in Elixir

If you build software long enough, you will eventually encounter use cases that require multiple steps to succeed before the overall process can be considered "complete". If any of the steps fail, you'll want to abort any further steps, roll back the state, and inform someone abo … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Building RAG with Postgres

A step by step guide to building a RAG system with Postgres Postgres is a powerful tool for implementing Retrieval-Augmented Generation (RAG) systems. Its versatility and robustness make it an excellent choice for this task. By diving deep into a technology you're already familia … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Personal Elixir Code Aesthetics

With my side project Flick hitting an MVP milestone and inspired by some conversations during Elixir Book Club, I thought I'd take a moment to document some code aesthetic choices I made in this project. The order below is not ranked in importance. In fact most of this is nitpick … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Request for developer feedback: customizable select

Styling form controls like the element has been reported as a top developer pain point for years, and we've been working on a solution. While this work is complex and has taken a long time to get right, we're getting very close to landing this feature. A customizable version of t … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Tree hierarchies in Laravel

Oftentimes when building a website or web application you will encounter the need for a hierarchical structure. It can be for menus, simulating a folder structure or a category hierarchy. Usually, for a tree structure to be useful A node (item in the tree) can have a parent - or … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— Start with unit tests on LiveView modules

I have been working with Phoenix and LiveView in a full-time position for around 18 months now, and most recently LiveView started to become something that I do often. At the beginning I was unsure about my coding and whether I was doing it correctly on the LiveView modules. Shou … | Continue reading


@yellowduck.be | 1 month ago

πŸ”— 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 | 1 month 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 | 1 month 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 | 1 month 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 | 1 month 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 | 1 month 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 | 1 month 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 | 1 month 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 | 1 month 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 | 1 month 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 | 1 month 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 | 1 month ago