Twig tip: Ternary operator with an undefined variable

You can use the default filter in combination with the ternary operator 😕 on a variable within a Slim Twig template when the variable is undefined: or in an if statement: When the variable is undefined and should not be an empty string:

Twig tip: How to access the query string

You can access the query string from a Slim Twig template by using the get_uri() method:

Use Proton Drive on Linux

You can use rclone to sync your data with Proton Drive and vice versa. But the chances are high, that you also have Proton VPN, which ironically will not let you use access your Proton Drive through VPN! But there is a simple solution. You can use rclone’s –bind argument with your local IP address …

Use esbuild instead of uglifyjs-folder and csso-cli

You can use the superfast esbuild instead of uglifyjs-folder and csso-cli to copy (and minify) your JavaScript and/or CSS files (without having to bundle the files) in your npm scripts.

Use Lightroom on a mapped network drive (on Linux with VirtualBox)

If you try to open a catalog stored on a network drive, Adobe Lightroom will complain about “Lightroom can not be opened on network volumes, removable storage or read on read only volumes.” You can easily overcome this by assigning the network drive to a drive letter using the subst command: This is especially useful …

Create responsive images on the fly with php and Imagick

To improve paging loading performance across multiple devices, web developers can provide each image in different resolutions using the srcset attribute and let the browser choose which one to load e.g.:

KEF LSX II on Linux: USB audio (IEC958) not loud enough

If the KEF LSX II speakers are connected to your Linux (Mint) PC via Digital Output (USB audio) instead of WiFi and the audio volume is not loud enough, it might be, that the gain of the internal sound card of the LSX II is set too low:

How to enable developer mode on a Samsung tablet

Vector tiles with PostGIS, PHP and OpenLayers

This is an example about how to create vector tiles with PostGIS 3.3 (and PostgreSQL 15.3), serve them with PHP 8.1 and use them in OpenLayers 7.5. In contrast to the few tutorials available on the internet, it not only uses the latest PostGIS version 3.3, which further simplified the generation of vector tiles by …

How to copy EXIF tags from XMP to NEF with ExifTool

Adobe Lightroom only writes changes to Metadata such as geolocation into the XMP sidecar files and not directly into the EXIF tags of the image. If you add coordinates via the map module, then you will need to copy that information from the sidecar files back into your raw files (in my case Nikon NEF). …