Looking at my browser tabs, I can't believe that we collectively have still not standardized on page title vs site title formats in 2024. I've seen SITE - PAGE, PAGE / SITE, PAGE | SITE, SITE: PAGE, PAGE etc. I'd prefer it if we had a sitetitle tag in head and let the browser figure it out. #technology #html
Sander van Dragt's Notes
-
-
Content vs crap.
#technology -
Use an expression to select an array value in PHP. It's handy for quick output logic. Update: it's a bit too clever, perhaps, versus using the tenary operator.
$classes .= [ ' sort-default', ' sort-custom' ][ has_custom_sort( $post ) ]; -
Why do web-browsers not have a dedicated "Back to top" button? #technology
-
I replaced my cold half finished coffee with a hot half finished coffee.... because the machine ran out of water ๐
-
Finally updated my #WordPress Blocks In Plain English page with the WordPress 6.3 change in naming from Reusable Blocks to Synced Patterns. #technology
-
Created a HTMX PHP sandbox to get started really easily. Feedback welcome. Might add some convenience functions https://github.com/svandragt/htmx-php-sandbox #projects
-
I've updated my one stop system update script to remove unused Flatpaks. #linux #projects
-
What would it take to make writing vanilla JavaScript more pleasant? After reviewing the code for my blogging engine Lamb I concluded:
Most of the code adding interactivity to personal websites comes down to running code after the page has loaded; niceties to query the DOM and hook into events. There's probably more but this is a start. The result is shorthand.js. Hint: it's not dissimilar to jQuery, but you can fully learn it in 5 minutes.
Which simplifies code to:
onLoaded(() => { const forms = $$('form.form-delete') forms?.forEach($form => $form.on('submit', ev => { cancel(ev) let confirmed = confirm(`Really delete status ${ev.target.dataset.id}?`) if (!confirmed) return ev.target.submit() })) })This is just a prototype and will evolve.
-
If you're using the Anytype (current version at the time of writing: 0.37.3) AppImage and made a .desktop file to launch it, here are a few tweaks that integrate it into your system better.
You may want to use a program like Desktopius to edit the .desktop file.

Prevent two dock icons
If you see one item for the AppImage and one for the application window in the Dock, add
StartupWMClass=anytypeand these will be combined. This value is the result of runningxprop WM_CLASSand clicking on the Anytype main window.Fix the icon
If you see the generic icon, extract the icon to a path and update
Icon=/path/to/anytype.png(replacing the path to the directory where you will extract the icon).To extract the icon from the AppImage do the following:
$ cd /tmp $ mkdir anytype && cd anytype $ /path/to/Anytype.AppImage --appimage-extract .... $ cp squashfs-root/usr/share/icons/hicolor/1024x1024/apps/anytype.png /path/to/anytype.png