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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Short notes about handy SQLite features you might not have heard about. ⚠️ This post links to an external website. ⚠️ | Continue reading
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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