The PHP configuration directive serialize_precision can cause hard to debug issues.
When deviated from its default value, it can lead to inexpected behavior in common functions like json_encode() and serialize().
…dev, tech problems and solutions.
The PHP configuration directive serialize_precision can cause hard to debug issues.
When deviated from its default value, it can lead to inexpected behavior in common functions like json_encode() and serialize().
When migrating from WordPress to Astro, one encounters various challenges.
One is handling the WordPress “More” tag, which originates from the More Element in the WordPress Block Editor.
After converting the WordPress export to Markdown, you will find `<!– more –>` tags in your content. These tags serve as delimiters in WordPress, allowing you to define where the excerpt ends on listing pages.
Continue reading “A WordPress-like More Tag in Astro”If you’ve ever shared a link on social media, you know how critical OpenGraph (OG) images are. They’re the first thing people see – often before they even click.
Static OG images are fine as a start, but what if you want custom images for every blog post or content collection item?
For Astro there is astro-og-canvas, a nice and useful Astro plugin that utilizes Canvas to create dynamic OG images.
In this post, I’ll walk you through how to generate dynamic OG images for your Astro site, inspired by Aidan Kinzett’s excellent post.
I’ll also share some odds and learned lessons.
Yazi is my preferred terminal file manager, and these are my five essential plugins that improve my workflow.
The Yazi package manager ya will be used to install the plugins mentioned below, which is shipped with Yazi.
For the installation of necessary terminal tools, I will use brew, since I am currently on OSX. For Linux use the equivalents like apt.
Continue reading “5 Essential Plugins for Yazi File Manager”
Small Service Post:
The default timeout of the Symfony HTTP Client is 60s (seconds)!
Sure, it is mentioned in the Symfony HTTP Client docs, that PHP’s default_socket_timeout is taken as default value.
So what is the default_socket_timeout then, you might wonder?
One click away in PHP Runtime Configuration docs you will find that in the php.ini the default value is “60”.
In case you wonder what unit these “60” is, you will find (in seconds) a bit down below the config table.
– Yeah, seconds was my first guess, but I need to assure it is not microseconds by any chance. –
And thats it! Thats the post.
P.S: It is funny how scattered information sometimes is, although is all there.
AI did know, but did not name a source.
And since AI is not to trust, I still had to look it up via Search.
I have this old, super-cheap laptop: Lenovo E145, which I use as my travel and breakfast laptop. It has 8GB of RAM and a very weak CPU (AMD E1-2500 APU). Any modern mobile phone probably has more resources these days.
For surfing the web, checking mails, editing and uploading some fotos it is sufficient and I prefer using a laptop for this.
I used to run Xubuntu on it, but lately it had performance issues and all programs and actions were lagging very significantly. So I decided to reinstall the OS and try Lubuntu, since it should be even more lean.
I grabbed the current Lubuntu image (25.04 Plucky Puffin), created a bootable USB stick, and installed Lubuntu. So far, so good. And indeed, everything felt much smoother and faster.
But, as usual, there are some post-installation hiccups which needed a bit more tuning.
Continue reading “From Xubuntu to Lubuntu”Yazi is a terminal-based file manager (TUI) that I use heavily because it’s fast and lets me navigate files and folders without needing a mouse. (…and I really dislike the OSX Finder)
Yazi can render previews for images and PDF files, but in my case, PDF previews weren’t showing up. Yazi requires Poppler for PDF previewing–and it was already installed on my system–the previews still didn’t work.
So I began debugging by running yazi --debug, which provides detailed information about your Yazi installation. Under the Dependencies section, I noticed a suspicious message:
pdftoppm : ExitStatus(unix_wait_status(25344)),"pdftoppm version 4.0...Continue reading “Yazi PDF preview not working”
Sometimes, you may encounter a bug or an unwanted functionality in a PHP vendor dependency, and forking the package and maintaining upstream changes can be too cumbersome. In such cases, using composer-patches is a good solution.
Composer-patches is a handy Composer plugin that applies diff patches to specific packages during installation.
Basically, you store a diff patch in your project, specify which vendor package it should be applied to in your composer.json, and the plugin will apply the patch to the original code of the vendor package after it got installed by composer.
Using Web Components in Astro wasn’t as straightforward as expected. Here’s an example showing how to integrate the obfuscate-link web component into an Astro project.
First, add the Obfuscate-Link web component to the project:
npm install obfuscate-link-web-component
Continue reading “ObfuscateLink Web Component in Astro” Since I stumbled across this the other day, here’s how you build an SQL query with a WHERE IN condition for an array of integers.
This is surprisingly not intuitive, as you cannot simply pass an array of integers to a prepared statement. Instead, you need to add special binding types to inform Doctrine that this is indeed an array of integers.
It’s very well explained in the documentation under the Parameters Conversion section:
https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/data-retrieval-and-manipulation.html#list-of-parameters-conversion
But it is rather hard to find and it took me a while.
The trick is to add the array binding types to the the types parameters to the query method. In the case of integers, it is \Doctrine\DBAL\ArrayParameterType::INTEGER.
Now Doctrine knows how to handle the types in the array while binding the values.