🔗 Creating an RSS feed in Elixir and Phoenix

Hand-rolling an RSS feed with Elixir and Phoenix is pretty straightforward. You just need a list of feed items, a controller, a template, and a view. In this article, I'll assume the list of items is a list of blog articles. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 4 months ago

🔗 Why RSS Content Module is Popular - Including HTML Contents

RSS has long had the element that can be used to include the contents of an . For example, you could use it to include the entire contents of a blog post; or just a summary of it. However, the RSS element is only suppose to be used to include plain text data. This obviously lim … | Continue reading


@yellowduck.be | 4 months ago

🔗 Fine Tuning Full Text Search with PostgreSQL 12

Full Text Indexing in PostgreSQL is easy... and it's not. It's not difficult to do simple keyword searches, but fine-tuning your index with weighting and parsing rules takes some effort. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 4 months ago

🔗 An ORDER BY statement improved our query times by 100x

PostgreSQL queries can be sped up by creating the right indices, and making sure that the indices are being used. It's a tale as old as SQL databases - there's a critical code path being hit many times per second, but its queries are inexplicably slow. ⚠️ This post links to an ex … | Continue reading


@yellowduck.be | 4 months ago

🔗 Retrieval Augmented Generation: What It Is and How to Start Using It

If you've spent any time in working with Large Language Models (LLMs) over the past two years, you've almost certainly heard of Retrieval Augmented Generation (RAG). RAG combines the strengths of information retrieval with the language capabilities of LLMs. RAG as a concept is re … | Continue reading


@yellowduck.be | 4 months ago

🔗 Dependabot's dependency grouping is awesome

I've been using GitHub's Dependabot since it was released around 4 years ago, and to a large extent, it's been great. Except for one thing: the sheer amount of pull requests Dependabot would open for dependency updates. For some of my repositories it became more of a chore to kee … | Continue reading


@yellowduck.be | 4 months ago

🔗 Just Use Postgres for Everything

TLDR; just Postgres for everything. We have invited complexity through the door. But it will not leave as easily. There is Radical Simplicity though. One way to simplify your stack and reduce the moving parts, speed up development, lower the risk and deliver more features in your … | Continue reading


@yellowduck.be | 4 months ago

🔗 Serving a billion web requests with boring code

When I worked as a contractor to the US government at ad hoc, I was fortunate enough to get the opportunity to design large parts of a relaunch of medicare plan compare, the US government site through which hundreds of thousands of medicare recipients purchase their health care p … | Continue reading


@yellowduck.be | 4 months ago

🔗 TIL: 8 versions of UUID and when to use them

About a month ago1, I was onboarding a friend into one of my side project codebases and she asked me why I was using a particular type of UUID. I'd heard about this type while working on that project, and it's really neat. So instead of hogging that knowledge for just us, here it … | Continue reading


@yellowduck.be | 4 months ago

🔗 Erlang | mise-en-place

The following are instructions for using the erlang core plugin. This is used when there isn't a git plugin installed named "erlang". The code for this is inside the mise repository at ./src/plugins/core/erlang.rs. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 4 months ago

🔗 Installing Elixir and Erlang using Asdf In Ubuntu

During my 13th week of internship , I was assigned the task of cloning a project from GitLab. The project was built using Elixir and ran on a Phoenix server, introducing me to new challenges. To start, I installed Elixir, Erlang, and other essential dependencies on my local machi … | Continue reading


@yellowduck.be | 4 months ago

🔗 FakerPHP / Faker - Numbers and Strings

Documentation for FakerPHP / Faker randomDigit# Generates a random integer from 0 until 9. echo $faker->randomDigit(); // an integer between 0 and 9 randomDigitNot# Generates a random integer from 0 until 9, excluding a given number. echo $faker->randomDigitNot(2); // 0, 1, 3, 4, … | Continue reading


@yellowduck.be | 4 months ago

🔗 Postgres is Enough

An index showing that a lot of things can be done with just Postgres, without needing to add on a lot of other tools. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 4 months ago

🔗 I Probably Hate Writing Code in Your Favorite Language

I probably hate writing code in your favorite programming language, whatever it may be. This is because I get frustrated by basically all of the top 10 languages you'll find listed anywhere for various reasons. Do I hate programming in Python? You bet I do. "But it's Python! Pyth … | Continue reading


@yellowduck.be | 4 months ago

🔗 How to integrate Tabler Icons into your Phoenix project

Tabler Icons is one of the most popular icon libraries. This article shows how to integrate the icon library into Phoenix projects. We will track the Tabler Icons source repository using Mix and use the Tailwind CSS plugin feature to create an icon component. ⚠️ This post links t … | Continue reading


@yellowduck.be | 4 months ago

🔗 Startup Playbook (Sam Altman)

We spend a lot of time advising startups. Though one-on-one advice will always be crucial, we thought it might help us scale Y Combinator if we could distill the most generalizable parts of this advice into a sort of playbook we could give YC and YC Fellowship companies. Then we … | Continue reading


@yellowduck.be | 4 months ago

🔗 Learning Elixir as a frontend developer

Oliwer Iwanicki reflects on his journey of learning Elixir and Phoenix to enhance his backend development skills, detailing his experiences, challenges, and the benefits he found in using the language. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 4 months ago

🔗 2-Page Login Pattern, And How To Fix It

The 2-page login pattern is becoming pervasive. Here are the reasons behind this design choice and alternative solutions to create a more efficient and user-friendly authentication experience. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 4 months ago

🔗 Cookie-based authentication with Laravel Sanctum

This is a detailed step-by-step guide for setting up Laravel Sanctum with cookie-based authentication. It explains the logic behind each step and how to set up Postman. We also tackle the most common CORs issues. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 4 months ago

🔗 Leverage Concurrency Efficiently When Managing Multiple Tasks in Elixir

When working on multiple tasks, it's important to consider performing them concurrently. However, when using concurrency, we need to be careful not to overload our system resources. In this article, we will cover the following: What is concurrency? How can we use concurrency in E … | Continue reading


@yellowduck.be | 4 months ago

🔗 An end-to-end ES/CQRS example with EventStoreDB and Phoenix/LiveView

Greetings to all Elixir enthusiasts! I'm happy to present my take on implementing ES/CQRS systems with Phoenix/LiveView and EventStoreDB. I believe those pieces of technology grew from the same conceptual root and are a great match. If you have ever felt joy from expressing a dim … | Continue reading


@yellowduck.be | 4 months ago

🔗 Why we no longer use LangChain for building our AI agents

At Octomind, we use AI agents with multiple LLMs to automatically create and fix end-to-end tests in Playwright. Until just a few months ago, we did it with the LangChain framework. In this post I'll share our struggles with LangChain and why replacing its rigid high-level abstra … | Continue reading


@yellowduck.be | 4 months ago

🔗 Why does SQLite (in production) have such a bad rep?

Why? Most people see it from a web workload perspective. Typically, we use Client-Server databases like PostgreSQL. But, SQLite absolutely shines in many other cases like mobile or embedded devices. For a long time, SQLite did not allow concurrent writes along with readers. This … | Continue reading


@yellowduck.be | 5 months ago

🐥 PHP & PostgreSQL: Resource temporarily unavailable

Today, I was having issues connecting from a Laravel app to a PostgreSQL database on Digital Ocean. The error message I was getting was the following: SQLSTATE[08006] [7] could not connect to server: Resource temporarily unavailable. The weird thing was that it was not happening … | Continue reading


@yellowduck.be | 5 months ago

🔗 Litestream - Streaming SQLite Replication

Stop building slow, complex, fragile software systems. Safely run your application on a single server. Fully-replicated database with no pain and little cost. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 5 months ago

🐥 Using Laravel to format SQL statements

I was doing performance testing on a Laravel application and wanted to see the SQL queries that were being executed. As I was running the tests in a terminal, I wanted to see the queries in a nicely formatted way. I found a package that does this, but it's not Laravel-specific. I … | Continue reading


@yellowduck.be | 5 months ago

🔗 Elixir, Phoenix, and the OWASP Top 10

The OWASP Top 10 is a well known application security awareness document. When a developer working on internet-facing web applications decides to learn about security, OWASP is a frequently recommended source of information, with the Top 10 as the most famous project. The point o … | Continue reading


@yellowduck.be | 5 months ago

🐥 TIL: Unpacking a .pkg file on macOS

Sometimes, you have these .pkg installer files on macOS. Today, I needed to extract them to see what's inside. Here's how you can do it: 1xar -xf MyInstaller.pkg If there is a file called Payload in there, you need to unpack it again: 1cat Payload | gunzip -dc | cpio -i Inspira … | Continue reading


@yellowduck.be | 5 months ago

🔗 Modern SQLite

Short notes about handy SQLite features you might not have heard about. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 5 months ago

🔗 How to uninstall Panda Security

You can uninstall the Panda Adaptive Defense or Endpoint Protection software manually from the operating system?s control panel, or remotely from the Computers area or from the Computer protection status and Licenses lists. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 5 months ago

🔗 UUIDv7 in 31 languages

UUIDv7 is a 128-bit unique identifier like it's older siblings, such as the widely used UUIDv4. But unlike v4, UUIDv7 is time-sortable with 1 ms precision. By combining the timestamp and the random parts, UUIDv7 becomes an excellent choice for record identifiers in databases, inc … | Continue reading


@yellowduck.be | 5 months ago

🔗 Many yes/no attributes: table design study

I wanted to demonstrate the relationship between the logical model and a physical model. We're going to design a commonly seen use case: many yes/no attributes of a single anchor (in our case, Restaurant). Then we'll discuss how the physical tables would be designed. We'll see th … | Continue reading


@yellowduck.be | 5 months ago

🔗 Web apps have client and server state (plus realtime and LiveView)

Recent discussions around client-side and server-side frameworks have brought up some misconceptions about state handling in web applications. This article aims to address them with some examples, and go a bit more into detail about how LiveView, in particular, deals with state a … | Continue reading


@yellowduck.be | 5 months ago

🐥 Importing CSV files into SQLite

To import CSV files into SQLite, you can do this in your terminal: 1sqlite3 mydatabase.db 2SQLite version 3.43.2 2023-10-10 13:08:14 3Enter ".help" for usage hints. 4sqlite> .import --csv mydata.csv table_name If the table already exists and the field names don't match the heade … | Continue reading


@yellowduck.be | 5 months ago

🔗 LiveView Is Not a Zero-JS Framework, It's a Zero-Boring-JS Framework

A recent Twitter discussion about the "ceiling" of server-side rendered frameworks like Phoenix LiveView has caused quite a stir. Most of it was in good faith, and many devs have responded with some great takes on the matter. One from Jose Valim particularly resonated with me: Th … | Continue reading


@yellowduck.be | 5 months ago

🔗 The decline of the user interface

When we first got the personal computer, we didn't worry much about how things worked. We were, frankly, stunned that we even had such a thing. You had to learn some arcane lingo to type into a DOS prompt. That the computer might be difficult or awkward to use didn't occur to us. … | Continue reading


@yellowduck.be | 5 months ago

🔗 Laravel Typed Collection

A collection in Laravel is a powerful tool that provides a fluent, convenient wrapper for working with arrays of data. However, standard collections don't restrict the type of data they hold, which can sometimes lead to unexpected behaviors or bugs. Typed Collections — a feature … | Continue reading


@yellowduck.be | 5 months ago

🔗 A quote from Russ Cox

Most people think that we format Go code with gofmt to make code look nicer or to end debates among team members about program layout. But the most important reason for gofmt is that if an algorithm defines how Go source code is formatted, then programs, like goimports or gorenam … | Continue reading


@yellowduck.be | 5 months ago

🔗 How to scale document question answering using LLMs

At Sensible we've used large language models (LLMs) to transform documents into structured data since the developer preview of GPT-3. In that time we've developed a set of best practices for document question answering that complement the basic chunking and embedding scoring appr … | Continue reading


@yellowduck.be | 5 months ago

🔗 Database Design for Google Calendar: a tutorial

In this database design tutorial (~9000 words) I'm going to show how to design the database tables for a real-world project of substantial complexity. We'll design a clone of Google Calendar. We will model as much as possible of the functionality that is directly related to the c … | Continue reading


@yellowduck.be | 5 months ago

🔗 Breaking up is hard to do: Chunking in RAG applications

As you go deeper down the rabbit hole building LLM-based applications, you may find that you need to root your LLM responses in your source data. Fine-tuning an LLM with your custom data may get you a generative AI model that understands your particular domain, but it may still b … | Continue reading


@yellowduck.be | 5 months ago

🔗 Custom Retriever | 🦜️🔗 LangChain

Many LLM applications involve retrieving information from external data sources using a Retriever. A retriever is responsible for retrieving a list of relevant Documents to a given user query. The retrieved documents are often formatted into prompts that are fed into an LLM, allo … | Continue reading


@yellowduck.be | 5 months ago

🔗 From $erverless to Elixir

I recently rewrote a service that was on AWS API Gateway and Lambda in Elixir and apparently that intrigued some people, so I decided to do a small write up. This post is going to be about our motivations for the move and what the replacement implementation looks like. This post … | Continue reading


@yellowduck.be | 5 months ago

🐥 Using Laravel migration with different databases

At work, I recently had the need to use the Laravel migrations for multiple databases. Long story short, our main database is MySQL but we also use PostgreSQL as an AI vector store. I wanted to use the Laravel migrations to create the tables in both databases. It turns out to be … | Continue reading


@yellowduck.be | 5 months ago

🔗 Essays on programming I think about a lot

Every so often I read an essay that I end up thinking about, and citing in conversation, over and over again. Here's my index of all the ones of those I can remember! I'll try to keep it up to date as I think of more. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 5 months ago

🐥 Purging the MySQL binlogs

Today, I learned how to purge the binlogs from MySQL: 1PURGE BINARY LOGS BEFORE now(); You can read more about it in the MySQL documentation: 1PURGE { BINARY | MASTER } LOGS { 2 TO 'log_name' 3 | BEFORE datetime_expr 4} The binary log is a set of files that contain informat … | Continue reading


@yellowduck.be | 5 months ago

🔗 iyaja/llama-fs: A self-organizing file system with llama 3

LlamaFS is a self-organizing file manager. It automatically renames and organizes your files based on their contents and well-known conventions (e.g., time). It supports many kinds of file, and even images (through Moondream) and audio (through Whisper). LlamaFS runs in two "mode … | Continue reading


@yellowduck.be | 5 months ago

🐥 Streaming a download to a file using the Laravel HTTP client

If you want to stream a HTTP download to a file when using the Laravel HTTP client, you can do this: 1$resource = \GuzzleHttp\Psr7\Utils::tryFopen('/path/to/file', 'w'); 2 3Http::withOptions(['sink' => $resource])->get('url'); You can read more about the sink option in the Guzzl … | Continue reading


@yellowduck.be | 5 months ago