I love this warm color scheme from Steph Ango (kepano, CEO of Obsidian) based on printing inks and warm paper. It's my new default theme in Sublime Text—which is still my preferred editor when I'm not slogging through large PHP codebases.
John Drexler shares an easy to implement prioritization scheme when working with a client.
It's a gift when another team gives you a wishlist of product improvements. Ask them to put their lists in order of importance, and then focus the conversation just on the top 5. This saves you loads of time. But it also brings them into the prioritization discussion and gets them to think like Product Managers too.
(I suppose it'd defeat to point to add a comment here.)
Writing about the symbiosis between trees and mushrooms? Don’t start talking about how humanity has depended on trees since the blah blah blah. Just jump right in! Talking about new features in your app? Don’t start with the fluffy stuff about how excited you are to announce yada yada ya – just tell me what improved.
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.
Stefan Zweifel explains how he stores user preferences in a Laravel application using spatie/laravel-data. With the data package, you can store user settings as a blog of JSON in your database—so you don't need to update your table schema for every change—and have a typed object to work with in code.
He mentions poor query performance as a possible tradeoff if you need to query the database for a specific value.
One thing to keep in mind is that querying for specific settings can lead to performance issues and should probably be avoided.
If your app regularly needs to query for users who have selected a particular date_format , it's better to promote this setting to its own column. This makes the work of your database and possible indexing much easier.
If this is something you need, you could solve it with a virtual column mapped to a JSON value of the settings object. There's a nice tutorial on that on the Kirschbaum blog
This week, I released Svelte by Example, a tutorial/resource/whatever-you- want-to-call-it introduction to Svelte.
The goal of Svelte by Example is not to turn you into an expert Svelte consultant after reading it through, but to introduce you to the framework's main concepts, and hopefully peak your curiosity and have you dig deeper.
If you've been curious about Svelte but haven't had time to give it a look yet, it's for you!
Keep reading if you want to learn more about how the site is built.
I love this description of the Go programming language from Rob Napier:
Go feels under-engineered because it only solves real problems. If you've ever worked in a wood shop, you've probably made a jig at some point. They're little pieces of wood that help you hold plywood while you cut it, or spacers that tell you where to put the guide bar for a specific tool, or hold-downs that keep a board in place while you're working on it. They're not always pretty. They often solve hyper-specific problems and work only with your specific tools. And when you look at ones that have been used a lot, they sometimes seem a little weird. There might be a random cutout in the middle. Or some little piece that sticks off at an angle. Or the corner might be missing a piece. And when you compare them to “real” tools, “general” tools like you'd buy from a catalog, they're pretty homey or homely depending on how you're thinking about it.
But when you use one of them in your shop, you learn that the random cutout is because you store it against the wall and it would block the light switch otherwise. And if you put your hand on that little extra piece that sticks out, then the board won't fall at the end of the cut. And the corner… well the corner is where you messed up when you were first making it and it's kind of ugly, but it never actually matters when you use it. And that's Go.
Grandpa loved craft. […] He fixed things often and silently. Grandpa just cared about things working. He had an instinct for not just broken things but soon to be broken things. He would point out risky work, bad decision making in the form of shoddy materials or shifting angles.
As software developers, we often consider our trade to be unique. But what we (should) have in common with others is the mindset of respecting our craft—of producing solid and lasting work.
I have read a lot of long spiels about craft that frequently end in something like, software work isn’t like other work, and we shouldn’t be judged the same way. We are entirely unique. We are the special ones. I find this both saddening and unconvincing. I think that all labor is skilled labor. I think about the factories and the fields and the ways that demands for speed instead of cadence can hurt people. I think we should seek to understand and value our skills and see effort. But I don’t think we are going to fix anything about how software work is valued by refusing to let it belong to the rest of the world.
I love Laravel Forge's quick deploy scripts. Forge allows you to set up a deploy script in their web interface and run it when you push to a git branch. However, I generally prefer to keep orchestration in the git repository. It's nice to have history, and I don't want to visit Forge whenever I want to make a change to the deploy script.
An elegant solution: move the script to a file. I created a deploy.sh and call it from Forge.