πŸ”— Zo word je sterker met minder training

'Ik ben niet goed, ik denk dat ik gewoon harder moet trainen.' Dat is zo'n beetje de standaard zin van iedere fietser die niet tevreden is met zijn of haar vorm. Was het inderdaad maar zo simpel dat je gewoon harder moet trainen, want vaak is dat helemaal niet het geval. Veel fie … | Continue reading


@yellowduck.be | 1 year ago

πŸ₯ Reversing a list using Elixir

To efficiently work with and transform lists in Elixir, you will likely need utilize a list reversing function from time to time. Your best bet is to reach for the Erlang implementation which is available as part of the lists module. Here are a couple examples of how to use it: 1 … | Continue reading


@yellowduck.be | 1 year ago

πŸ”— Interview with Jan Heine of RenΓ© Herse: Low Resistance

Inspired by randonneurs of a past era, Jan Heine revived the RenΓ© Herse brand 13 years ago to focus on building tires suitable for his favourite adventures in the Cascade Mountains, while also saying true to the brands nearly century-old legacy. ⚠️ This post links to an external … | Continue reading


@yellowduck.be | 1 year ago

πŸ₯ Get git details from Elixir

The following snippet allows you to extract the SHA1 of the git commit from within elixir. It is useful to attach the SHA1 to your release or code so that if therea are any issues you can quickly checkout the commit and look into it. You can also get the branch name if required. … | Continue reading


@yellowduck.be | 1 year ago

πŸ”— The RAG Engineer's Guide to Document Parsing

I made a post with my buddy Daniel Warfield breaking down why parsing matters so much for RAG and comparing some of the different approaches based on our experience working with Air France, Dartmouth a big online publisher and dozens of other projects with real data ⚠️ This post … | Continue reading


@yellowduck.be | 1 year ago

πŸ₯ One quick way to find out which functions you're executing

When running tests, we sometimes want to know which functions are being executed. You could write custom dbg/1 statements in each of the functions: 1def function_a do 2 dbg(:function_a) 3end 4 5def function_b do 6 dbg(:function_b) 7end 8 9... 10 11def function_z do 12 … | Continue reading


@yellowduck.be | 1 year ago

πŸ”— CSS One-Liners to Improve (Almost) Every Project

A collection of simple one-line CSS solutions to add little improvements to any web page. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 1 year ago

πŸ₯ Quick Access to Repo Config in Elixir

Sometimes you want to find out information about your Repo configuration. You can dive into the config files and ENV variables to sort out what's being used… or you can take the easier path! In an iex session (that has your Repo available), access the configuration via Repo.confi … | Continue reading


@yellowduck.be | 1 year ago

πŸ”— Checking Efx - testable effects for Elixir

Mocking in Elixir is always a hot topic, mainly because of people coming from different other technologies having different expectation. The most "cannonical" solution, Mox, gives a lot of security with regard to what the fake implementation returns, but requires a bit of a cerem … | Continue reading


@yellowduck.be | 1 year ago

πŸ₯ Testing streamed dowloads in Laravel

Imagine you are using streamed downloads in your Laravel controllers like this: 1use App\Services\GitHub; 2 3return response()->streamDownload(function () { 4 echo GitHub::api('repo') 5 ->contents() 6 ->readme('laravel', 'laravel')['contents']; 7} … | Continue reading


@yellowduck.be | 1 year ago

πŸ”— Setting up Laravel Valet in 2024 | Undocumented Docs

During my long relationship with PHP I've tried many ways of organizing my local development environment, from Denwer in 2004, WAMP/MAMP/LAMP, to Vagrant and Docker in 2010s. However, for the last few years, I have primarily used the excellent Laravel Valet. But I found that the … | Continue reading


@yellowduck.be | 1 year ago

πŸ”— Igniter - Rethinking code generation with project patching

Ash Framework is ~4 years old, and we've only just now introduced the ability to generate resources, or new Elixir projects with Ash installed using a CLI. We've added these thanks to our latest project Igniter. Before I talk about our new generators, however, I'd like to talk ab … | Continue reading


@yellowduck.be | 1 year ago

πŸ”— How to respond to channel broadcasts in a Phoenix LiveView app layout (global broadcasts)

In a project I'm working on, I have a menu in my app layout that displays a number of unread messages. Because this is in the app layout, it does not belong to any one LiveView instance, but to all of them. When a new message comes in, or a message is marked as read, there is a b … | Continue reading


@yellowduck.be | 1 year ago

πŸ”— Building Real-Time Features with Phoenix Live View and PubSub

Integrate Phoenix PubSub with LiveView to build real-time features capable of broadcasting updates across a set of clients. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 1 year ago

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