Reading List

The most recent articles from a list of feeds I subscribe to.

Cracking a “Developer Tools Killer” script…

The other day I got an email from somebody who took one of my developer tools courses and he said he found a website that cannot be debugged. So I looked, found a nasty script and show you how to work around that one. You can watch the video on YouTube or read on… I […]

Remove falsy values from a Laravel collection or array in PHP

The native array_filter() in PHP and collect()->filter() in Laravel also work without providing a filter callback.

array_filter([0, 1, '', 'a', false, true, []]);
// [1, 'a', true]
 
collect([0, 1, '', 'a', false, true, []])->filter();
// [1, 'a', true]

If you don't provide a callback, PHP will remove all empty values from the array.

Cosmic Latte

A team of astronomers have calculated the average color of the universe and named it cosmic latte. I'd love to have a cosmiclatte CSS color one day.

en.wikipedia.org

Adding stale while revalidate functionality to Laravel's cache

A stale while revalidate cache macro by Rias Van der Veken. With stale while revalidate, expired cache items will still be used when requested, but the data will be revalidated right after. That means the current request will be handled faster than if the cache would have to be revalidated, and the next request will receive fresh data.

Stale while revalidate is often used in web applications, popularized by Vercel's SWR React library.

rias.be

How to use lists in Talon