TypeScript string literal arrays
Read NoteA useful trick when working with tokenised values is that you can generate an "immutable tuple" within a "const context" (computer science gibberish overload 😂) and reference that. So if you have …
theAdhocracy
A useful trick when working with tokenised values is that you can generate an "immutable tuple" within a "const context" (computer science gibberish overload 😂) and reference that. So if you have …
The various array methods in JavaScript can be thought of on a scale of power, or really flexibility. At the top end you've got the for loop, at the bottom the highly-specific functions …
Solid reasoning – with a clear example – of the potential dangers of using an array index as the key value in ReactJS. Not something I'd ever considered (and something I do a lot) but …
Theo has some really interesting videos, but the more I dig into the archive the more I find little gems like this. It's the definition of a quick tip, and it helps explain Maps and Sets in …
We've just had the privilege of listening to the latest show put together by the Society of Strange and Ancient Instruments. Never heard of them? Well, neither had I. In fairness, had we not known …
Craft CMS has the ability to accept environment variables as well as aliases. It can be worthwhile understanding how these two seemingly similar concepts differ, and when you might want to use one over the other.
I keep running into the same problem: how to set a style attribute in the CMS and have that be dynamically rendered on the front-end, without relying on inline styles. Turns out it's a great use case for CSS variables!
I have a tendency to prefer the kind of "inside-out" control that Kent is advocating in this piece, though I've never head it called "inversion of control" before. The idea of giving your users the …
I finally made it to an IndieWebCamp meetup, even if it was remote only due to the increasingly restrictive implications of the coronavirus. I learnt a lot, I had a great time, and I'm ready to start implementing a whole bunch of new ideas right here. I also took a huge number of notes from the speakers and sessions throughout the day.
Static sites don't make search functionality easy, but luckily there are some excellent services that do. I've been messing around with Algolia and finally have it working with Craft and Gatsby the way I want it... on the backend, at least.
The search page is live, the index is populated, but it all looked a bit rubbish and it didn't quite work as well as I wanted. Now it's using custom-styled components, queries are tracked/stored via the URL for persistence, and you can filter results based on category.
Heydon has been working on Ga11ery, a neat image portfolio site generator that's ideal for webcomics. But it's built on the Jamstack using 11ty and Netlify, which means it isn't so simple to …
It turns out that there are a lot of gotchas to creating a clear category structure for media reviews. Well, after a year of messing around with various setups behind the scenes, I think I'm starting to get somewhere.
An overview of JS promises for all skill levels. Starts with an excellent analogy of thread-blocking as …
The new dominant layout methods in CSS – grid and flexbox – have solved a lot of issues. Still, sometimes the ideal layout is somewhere in the middle: a flexible grid-like mashup. With a bit of outside-the-box thinking, you can there from either angle.
I love books. I have a huge collection of them and I routinely add to it. But when it comes to the topic of spreading knowledge and information, I think the web wins. It may not be as nice to use, but it is more accessible, and that means it's more valuable.
Is an album's tracklist better suited for a table or a list? The answer may surprise you! (But it probably won't).
CraftCMS has a habit of imploding when running software updates, for which I have developed several coping strategies.
I use emoji quite a lot on this site, which means I'm already aware of some of the more unusual browser/OS quirks. Don't ever use flag emoji (except pirate 🏴☠️) because Microsoft refuses to …
A quick (and dirty) way to fetch local data from a JSON file and modify the look of a page in Astro, completely natively.
Chakra UI is a pretty solid base for a component system, but it's CSS post-processing can't always provide ideal fallbacks for modern CSS techniques.
Need to self-host your front end away from the "modern" services like Netlify or Vercel? As both continue to get a little sketchier with time, it's definitely something I'm having to …
How well does an iPad work as full code editing device; a veritable laptop replacement? That's what I wanted to find out.
Migrating content between fields in Craft is not as simple as it might be. In the wake of Craft 5, I've been getting a lot of practice, and wanted to write up some of the techniques I've been using.