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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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