Chris Drifte
drifte.dev
Chris Drifte
@drifte.dev
Writing fast code. Living slow life.

💻 Typescript, React, NextJS
⛰️ Climbing, Running, Hiking
Reposted by Chris Drifte
PNG is back!

After over two decades, we released a new PNG spec.
www.programmax.net/articles/png...
PNG is back!Rec. 2020 and Rec. 709 comparison
After 20 years, PNG is back with renewed vigor! A new PNG spec was just released.
www.programmax.net
June 24, 2025 at 10:50 AM
Ensuring that cookie logic is interoperable between PHP, NextJS middleware, server, and client components, as well as vanilla react and JavaScript is an absolute nightmare.

Gotchas upon gotchas upon gotchas.
January 23, 2025 at 5:24 PM
Toying with the idea of telling my PO about document.designMode = “on”

Is this too much power for one man?
January 15, 2025 at 7:52 AM
If you get frustrated with the “magic” of nextjs, I highly recommend experimenting with building your own react server rendering framework.

All you need is webpack, ReactDOM.renderToString, and a couple of hours.

Probably the most effective activity for understanding why nextjs does what it does.
January 11, 2025 at 10:04 AM
My 2025 predictions:

- Globally, things will seem really, really bad
- There will still be opportunities to grow as an individual and contribute to our communities

My goal is to make the second thing more important than the first.

#HappyNewYear
December 31, 2024 at 5:25 PM
Playing Indiana Jones with an Xbox controller on a MacBook Pro via GeForce Now.

It works seamlessly. As a casual gamer this completely replaces the need for a gaming pc or console for a fraction of the cost.

Crazy
December 28, 2024 at 12:03 AM


I tend to think of the process of writing code over time as reaching a series of “tipping points” that require larger refactors in order to iterate effectively.

Miłosz’s pendulum model is an inversion of the same idea and the two go together quite well.
The Over-Engineering Pendulum
I used to picture my dream job as this: I work for an early-stage startup that recently raised a round. The business idea is promising, there’s much to build, everything seems possible, and we have ti...
threedots.tech
December 18, 2024 at 3:00 PM
TIL you can pass extra parameters to setTimeout. I guess it’s slightly more memory efficient, slightly less readable than the usual arrow function approach.
December 16, 2024 at 11:07 PM
LPT: if you’re a frontend dev and have to give a presentation, build your slides with your web framework of choice.

So much easier than fiddling with PowerPoint/Google Slides and lots of opportunities for interactive storytelling.
December 13, 2024 at 6:55 PM
Performance matters to users. Implementation matters to performance.

Yesterday I presented to #AlgoliaDevBit how we refactored Bike24’s Search Result Page to transform it into one of the fastest in e-commerce.

youtu.be/c8eZZSPADqA?...
Three steps to the fastest ecommerce search results in the universe
YouTube video by Algolia
youtu.be
December 12, 2024 at 1:18 PM
Reposted by Chris Drifte
What #CSS can prevent orphan icons from dropping to a new line?

Answer:
`text-wrap: pretty;`

Nice interactive demo at the end to compare `pretty` vs `balance` too

muffinman.io/blog/css-fix...
CSS fix to prevent orphan icons dropping to a new line
Kudos to whoever thought of including `text-wrap: balance` in the CSS specification.
muffinman.io
December 12, 2024 at 5:59 AM
Snowy sunset
December 10, 2024 at 10:05 PM
To prevent eye strain while coding, follow the 20/20/20 rule. Every 20 minutes look at an object 20 feet away and then spend 20 years in the mountains.
December 6, 2024 at 4:25 PM
Photo taken today from the summit of pedraforca, facing Montserrat in a sea of cloud. Within the next 48 hours this will all be covered in snow.
December 6, 2024 at 4:23 PM
I love reading pre-1980s sci-fi. Writers could imagine space travel but not the internet.

A character needs to learn some vital information? Off to the space library. 😂
December 5, 2024 at 4:08 AM
Almost everyone cares about writing code that is easy to understand.

But what does it actually look like?

For me:

1) Reads like a recipe, not a choose-your-own-adventure
2) One name per concept
3) Similar problems have similar solutions
4) Abstraction & inheritance is a last resort
When you write code, what do you care about most?

(a) Runs fast
(b) Easy to understand
(c) Time/space complexity
(d) Scalable/adaptable to probable future requirements
(e) Something else?
December 4, 2024 at 1:20 PM
What is a subtle sign that someone is a good developer?
December 3, 2024 at 8:11 AM
Sunrise silhouettes
December 2, 2024 at 7:50 AM
When you write code, what do you care about most?

(a) Runs fast
(b) Easy to understand
(c) Time/space complexity
(d) Scalable/adaptable to probable future requirements
(e) Something else?
December 1, 2024 at 10:27 AM
Reposted by Chris Drifte
If nobody told you that @drifte.dev is also has a cool remake of minesweeper game with react and nextjs yet, then let me mention it 😂

www.minesweeper.monster
Monster Minesweeper
A fully customizable minesweeper game with interactive tutorials
www.minesweeper.monster
December 1, 2024 at 2:32 AM
Having primarily lived within the conventions of react in the last five years, and nextjs the last two, it’s easy to forget that there are other ways.

infrequently.org/2024/11/if-n...
If Not React, Then What? - Infrequently Noted
Frameworkism is now the dominant creed of today's frontend discourse, and it's bullshit. We owe it to ourselves and to our users to reject dogma and embrace engineering as a discipline that strives to...
infrequently.org
November 30, 2024 at 11:59 AM
In Spain, every time two roads meet there is a slightly different (often quite esoteric) system to navigate. Driving in an unfamiliar area is stressful. The UK just puts roundabouts everywhere. It’s easy to drive in new places.
November 29, 2024 at 10:36 AM
Reposted by Chris Drifte
They really are amazing, folks. Perfect for paginating through API responses that return a cursor and/or have rate limits.
November 26, 2024 at 2:13 AM
What’s the lifespan of an average line of code you write?
November 28, 2024 at 7:54 PM
Hot take: AI imagery is currently somewhat high status as it is a novelty. But it will gradually become low status due to no barrier to entry. As long as it is possible to recognise it as AI-generated, brands will prefer human-created imagery to display legitimacy, authenticity, and quality.
November 27, 2024 at 10:45 PM