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
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
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
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
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
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
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
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
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
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
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
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
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
About programming, AI and devops | Continue reading
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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