category / Code
Writing code is like writing poetry – do it right or you’ll end up in some anthology of shame.
PHP class properties can't be type-hinted as callable, even though method parameters can be. Here's what you can do to get around this limitation.
Displaying an absolute date is factual, but sometimes a relative amount of time units between now and that date gives the reader a better understanding of the scale of time.
When writing Laravel API tests, postJson() is indispensable. For sending image data as a payload, there is no postRaw(). This shows how to test your API with image data as a payload in Laravel.
When a file is uploaded as part of a form submission, its MIME is included. I've discovered that Firefox on Windows has an inconvenient way of determining this MIME.
The unstyled appearance of the WordPress comment box leaves much to be desired. Some CSS magic can make it look great on mobile and take advantage of available real estate on larger screens.
The Barcode Detection Web API greatly facilitates writing a versatile Barcode or QR reader with a few lines of JavaScript.