🐥 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 | 6 months ago

🔗 Phoenix LiveView 1.0-rc is here! - Phoenix Blog

LiveView 1.0.0-rc.0 is out! This 1.0 milestone comes almost six years after the first LiveView commit. Much worth a read if you're into Elixir and Phoenix development. The LiveView library has come a long way since its inception, and it's now more stable and feature-rich than eve … | Continue reading


@yellowduck.be | 6 months ago

🐥 Fast import of CSV data into PostgreSQL

To quickly import a CSV file into a PostgreSQL table: 1SET DateStyle = 'ISO, DMY'; -- Set the correct date format 2copy mytable (column1, column2) from 'local-file.csv' delimiter ',' csv header; -- Import the files If you want, you can also stream from stdin: 1SET DateStyle = 'I … | Continue reading


@yellowduck.be | 6 months ago

🔗 Your Bike Tires Are Too Skinny. Riding on Fat, Supple Tires Is Just Better

I used to ride thin, high-pressure tires everywhere. But adhering to "the supple life" and cycling on wider, lower-pressure tires boosted my comfort and stability without slowing me down. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 6 months ago

🐥 Laravel collections and first call callables

I'm quite a fan of using PHP first class callables, but combining them with Laravel collections can be a bit tricky. Imagine you have a collection with header names you want to convert to snake case. 1$headers = collect(["First Name", "Last Name", "Zip Code", "City"]); With firs … | Continue reading


@yellowduck.be | 6 months ago

🐥 Using a cookie jar with the Laravel HTTP client

If you want to do multiple HTTP requests in a row using the HTTP client from Laravel and persist cookies between them, you can use a cookie jar. This is a class that stores cookies and sends them back to the server when needed. Here's how you can use it: 1use GuzzleHttp\Cookie\C … | Continue reading


@yellowduck.be | 6 months ago

🔗 VSCode: Setting line lengths in the Black Python code formatter

The docs for the Black Python code formatter say that the formatter "is not configurable". This is largely true, but if you have Black set up > to work in VSCode, you can configure the line length. In VSCode, go 'Code -> Preferences -> Settings' and search for "python formatting … | Continue reading


@yellowduck.be | 6 months ago

🔗 GitHub - integrations/slack: Bring your code to the conversations you care about with the GitHub and Slack integration

The GitHub integration for Slack gives you and your teams full visibility into your GitHub projects right in Slack channels, where you can generate ideas, triage issues and collaborate with other teams to move projects forward. This integration is an open source project, built an … | Continue reading


@yellowduck.be | 6 months ago

🐥 Caveat with MySQL full-text search and testing

Today, I was writing a test for a Laravel application that uses MySQL full-text search. I was testing a search query that uses the MATCH and AGAINST operators. The test was failing as no results were returned from the search. Running the same code outside the context of the test … | Continue reading


@yellowduck.be | 6 months ago

🔗 Rotating one or more pages in a PDF in linux

Had to rotate a single page of a PDF. Here's how to do it using pdftk. rotate page 1 by 90 degrees clockwise: pdftk in.pdf cat 1east output out.pdf To rotate all pages clockwise: pdftk in.pdf cat 1-endeast output out.pdf The east etc. is meaningful if you want other rotations. … | Continue reading


@yellowduck.be | 6 months ago

🔗 Force JSON response on all API routes in Laravel

Laravel often returns an HTML response or redirect response on API routes, mostly if the response is an error one. However, it is quite easy to force Laravel to return JSON response in those cases. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 6 months ago

🔗 Modern Advances in Prompt Engineering

Due to their ease of use, large language models (LLMs) have seen an explosive rise to popularity. By just crafting a textual prompt, even those who are completely unfamiliar with deep learning can leverage massive neural networks to quickly solve a wide variety of complex problem … | Continue reading


@yellowduck.be | 6 months ago

🔗 The ultimate guide to technical due diligence

Technical due diligence (TDD) helps investors and companies uncover the tech strengths and weaknesses of startups. TDD plays a crucial role in revealing risks and opportunities tied to technology, allowing for a thorough assessment that aids in making better business decisions. ⚠ … | Continue reading


@yellowduck.be | 6 months ago

🐥 Fixing GPG errors when installing apt packages

I was experiencing GPG errors when trying to install packages using apt when using GitHub Actions. The errors I was seeing were similar to the following: Err:16 http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease The following signatures were invalid: ERRSIG 4F4EA0AAE526 … | Continue reading


@yellowduck.be | 6 months ago

🔗 Testing Patterns

While building tempest/highlight, I came across an interesting design problem. One of its core components is a concept called "patterns"; these are classes that match a very specific part of code-to-be-highlighted using regex. Part of my test suite's responsibility is to test eac … | Continue reading


@yellowduck.be | 7 months ago

🔗 The Problem With LangChain

If you've been following the explosion of AI hype in the past few months, you've probably heard of LangChain. LangChain, developed by Harrison Chase, is a Python and JavaScript library for interfacing with [OpenAI(https://openai.com/)]'s GPT APIs (later expanding to more models) … | Continue reading


@yellowduck.be | 7 months ago

🔗 How to send progress updates

If you work on anything worthwhile, sooner or later people will care about it and will want you to send progress updates. These could be quarterly investor updates, weekly updates to your boss, emails to adjacent teams, etc. Here are tips on how to do this well. ⚠️ This post link … | Continue reading


@yellowduck.be | 7 months ago

🔗 Fast Full-text Search with PGroonga, Postgres, and Elixir

We're Indie Courses, the video course platform for indie creators. We help you sell your online courses quickly and give you the tools and knowledge to make more sales than you would elsewhere. No marketing degree needed. Our goal at Indie Courses is to offer creators the most ad … | Continue reading


@yellowduck.be | 7 months ago

🔗 Healthy Code Reviews

I worked with a client in the early days of my career building social media sentiment analysis platform when Twitter was still called Twitter. We were a team of seven and I was a junior-level developer back then. We were young and enthusiastic and full of ourselves. "We're agile, … | Continue reading


@yellowduck.be | 7 months ago

🔗 Tips on Adding JSON Output to Your CLI App

A couple of years ago I wrote a somewhat controversial article on the topic of Bringing the Unix Philosophy to the 21st Century by adding a JSON output option to CLI tools. This allows easier parsing in scripts by using JSON parsing tools like jq, jello, jp, etc. without arcane a … | Continue reading


@yellowduck.be | 7 months ago

🔗 Developing Rapidly with Generative AI

Generative AI is attracting attention as the technology has progressed in leaps and bounds in recent years, offering fresh ways to solve user problems. Since it's a relatively new area in terms of its practical application, figuring out how to start building with LLMs (large lang … | Continue reading


@yellowduck.be | 7 months ago

🔗 Build A Route Planner For Maps Using Python

In this article I use the metric system, where 1 meter = 3.28 feet. I also talk about highways. Here I use the definition in British English, where highway refers to any path with a public right of access. We are all familiar with the existence of route planners like google maps … | Continue reading


@yellowduck.be | 7 months ago

🔗 OpenStreetMaps, Overpass API And Python

OpenStreetMaps (OSM) is known for being an open source project that allows people to browse the world map and to plan routes. However it is more than that. Among others it provides a read-only API that allows users to query for very diverse map data: Overpass API ⚠️ This post lin … | Continue reading


@yellowduck.be | 7 months ago

🔗 Lessons after a half-billion GPT tokens

My startup Truss (gettruss.io) released a few LLM-heavy features in the last six months, and the narrative around LLMs that I read on Hacker News is now starting to diverge from my reality, so I thought I'd share some of the more "surprising" lessons after churning through just n … | Continue reading


@yellowduck.be | 7 months ago

🔗 Email DNS Records Cheatsheet

Every so often, I need to chase down some aspect of email validation. This involves a number of DNS records and queries, but I may forget just which ones. So here's a quick cheatsheet for future me to pull up the next time I don't remember which records are used to validate SPF, … | Continue reading


@yellowduck.be | 7 months ago

🔗 Here is why vim uses hjkl keys as arrow keys

I was reading about vim the other day and found out why it used hjkl keys as arrow keys. When Bill Joy created the vi text editor he used the ADM-3A terminal, which had the arrows on hjkl keys. Naturally he reused the same keys and the rest is history. ⚠️ This post links to an ex … | Continue reading


@yellowduck.be | 7 months ago

🔗 Jeffrey Way's PhpStorm Setup in 2024

Call it age. Call it apathy, if you must. I call it contentment. Much of my twenties were spent endlessly experimenting and searching for the perfect editor and workflow. As I read these words back to myself, I'm somewhat embarrassed. "Really? That's what you spent your twenties … | Continue reading


@yellowduck.be | 7 months ago

🔗 Laravel Read / Write Connections use multi-database

Sometimes you may wish to use backup database and live database for handling maximum user interaction Out of the box Laravel always you to have read/write database connections. This will allow you to have different database connections for SELECT queries and INSERT, UPDATE and DE … | Continue reading


@yellowduck.be | 8 months ago

🔗 Offload the majority of requests to your database with our newest update to Standby Nodes

Standby Nodes have always been a great failsafe—if your database fails for any reason, a constantly replicated and completely up-to-date Standby Node is there, ready and waiting, to take its place. But what about when your database is functioning fine? In addition to replication, … | Continue reading


@yellowduck.be | 8 months ago

🐥 Customizing email titles in Laravel console kernel scheduled tasks

Laravel provides a convenient way to schedule tasks. Scheduled tasks are vital for automating repetitive tasks like sending emails, generating reports, or performing database maintenance. By using the standard functionality, it's very easy to email the output of these commands. H … | Continue reading


@yellowduck.be | 8 months ago

🔗 Setting Up a Multi-tenant Phoenix App for Elixir

Apps built with Elixir can support massive scalability, real-time interactivity, great fault tolerance, and the language's syntax is actually a joy to use. Elixir is a natural fit for applications such as chat apps, data dashboard apps, and anything needed to support a large user … | Continue reading


@yellowduck.be | 8 months ago

🔗 The Developer's Guide to SSO — WorkOS

Adding SSO to your app is a common requirement for selling to enterprise customers. Here's a guide that will help you understand SSO and choose the best way to add it to your app. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 8 months ago

🔗 Vector Similarity Search with PostgreSQL's pgvector

As the AI revolution surges forward, promising significant innovations, it also introduced new types of vector databases. A vector database stores data as high-dimensional vectors called embeddings, which are mathematical representations of features or attributes of the data. The … | Continue reading


@yellowduck.be | 8 months ago

🔗 The 2038 Problem

Remember the "Year 2000" problem (or Y2K) in the late 90s? This referred to the fact that many older computer systems represented years using only two digits. This meant that when the year 2000 arrived, many systems would incorrectly display it as "00" instead of "2000", causing … | Continue reading


@yellowduck.be | 8 months ago

🔗 The Mac Admins Podcast team explain how to secure Apple devices at work and home

Joined by the popular Mac Admins podcast cast, we dive into Apple security and privacy, and how Macs are being integrated into workplaces everywhere. Find out whether an Apple product on its own keeps you secure and safe from viruses, or if you need additional security apps to pr … | Continue reading


@yellowduck.be | 8 months ago

🔗 Language Policy at Google: Let's Go!

Last week, I wrote a post that was largely about how Google decides whether to support a programming language for general use. I mentioned that languages developed by Google, like Go and Dart, and languages advocated by Google, like Kotlin, were special cases. Sameer Ajmani (who … | Continue reading


@yellowduck.be | 8 months ago

🔗 Go, Python, Rust, and production AI applications

In this article, I'll talk about Go, Python, and Rust, and each language's role in building AI-powered applications. ⚠️ This post links to an external website. ⚠️ | Continue reading


@yellowduck.be | 8 months ago

Generative AI for Contracts

Continue reading


@yellowduck.be | 8 months ago

System-wide text summarization using Ollama and AppleScript

Continue reading


@yellowduck.be | 8 months ago

Laravel 11: the upgrade guide from version 10

Continue reading


@yellowduck.be | 8 months ago

Checking your packages for Laravel 11 compatibility

Continue reading


@yellowduck.be | 8 months ago

I made a mistake

Continue reading


@yellowduck.be | 8 months ago

I don't get the point of Golang - That's why I need help

Continue reading


@yellowduck.be | 8 months ago

goqite - persistent message queue

Continue reading


@yellowduck.be | 8 months ago

Get consistent data from your LLM with JSON Schema

Continue reading


@yellowduck.be | 8 months ago

Get Started with Milvus Vector DB in .NET

Continue reading


@yellowduck.be | 8 months ago

Using non-integer primary keys in Eloquent

Continue reading


@yellowduck.be | 8 months ago

Distributed Systems Horror Stories: Kubernetes Deep Health Checks

Continue reading


@yellowduck.be | 8 months ago