Linear gradients

How do we transition pixels' color along the direction of the gradient. The trick is to project the position of the pixel to the direction of the gradient. Pixels closer to the end of the gradient will have a larger magnitude. 9/10

Show thread


A complication is that rounded corners lead to jagged edges since the pixels don't fall squarely in the pixel grid. The solution is to gradually transition the pixel color across the boundary.


Show thread

Drawing rounded corners:

We use distance fields to describe rounded edges. Given a pixel, a distance field outputs its distance to the nearest edge of a shape. This is a useful API for fragment shaders, which only has access to one pixel at a time.


Show thread

Drawing borders:

While drawing borders, the rectangle stays the same size and shape. So we just have to edit the fragment shader. We infer which quadrant the pixel is in to calculate its corresponding border corner. Then we assign pixels outside it with the border color. 6/10

Show thread

We thus switched to GPU rendering. The GPU has more cores and so can perform data-parallel calculations like calculating pixel position and color very quickly. We wrote shaders for glyphs, icons, and styled rectangles. They form all of Warp's UI:

Show thread

For once, I feel hopeful that we can beat climate change in our lifetime.

I watched Netflix’s “Kiss the Ground.” We can capture all the excess carbon in the air, by regenerating our soil.

It’s refreshing to see hopeful content that offer solutions. Any recs?

To set up a new k8s cluster, it turns out I needed to click "EKS - Cluster" instead of "EKS" for step 3 of 50.

Show thread

When that was done, I saw that my post now had this section.

There is a button for readers to “Collect NFT”: where they get to buy an “Edition” of the essay. Top contributors are shown on the leadership board.

Show thread

Mirror allows all writers to publish their essays as NFTs just by clicking a checkbox and saving the article.

Show thread

Finally, after three weeks, we finished the loft. I now have space to work, do yoga, and host friends.

Huge thanks to,, and for the tireless woodworking.

Show thread

While assembling the loft, we realized that one of the legs was slanted.

That was how we realized our apartment floor is slanted! Just like that one 'How I Met Your Mother' episode.

I’d always longed for the classic New York twenty-something experience.

Show thread

At a high level, our task was to join planks together with 2-inch cylindrical wooden blocks called dowels. I learned how to use a hammer and power drill to create holes for the dowels.

We got our first noise complaint as well. My bad!

Show thread

Zack ( designed the loft in CAD and his dad cut the pieces from Home Depot wood.

Zack told me he had to design around a random stripper's pole in my room.

Show thread

In the post-covid summer of 2021, the Manhattan housing market had become a bloodbath. Almost every unit already had multiple rent applications. We took the first apartment that'd consider us.

My new room is tiny. Building a loft that elevates my bed would liberate my floor.

Show thread

Happy to break in my new apartment with a birthday celebration. Seeing my friends makes it feel like home.

My little brother only texts me when my crypto portfolio does well. 😾

Something that made me laugh today:

Fred Brooks called his book the Bible of Software Engineering because "everybody quotes it, some people read it, and only a few people go by it".

This photo illustrates the rationale. I'm standing next to a road in Alaska.

I had to walk along it to get groceries. It was scary when vehicles zoomed past me at 50mph.

But it also shows a glimpse of how beautiful the nature is. I want to visit beautiful sites whenever I want.

Show thread

Bought iPhone 12 the day before iPhone 13 came out. Thought I shat the bed.

Thankfully, Apple automatically reduced the price. Great customer service.

While it was anxiety-inducing, I learned a lot. For instance, I always thought it was wrong for cars turning right to move so close to the pedestrian crossing when I'm walking on it.

It turns out that this is encouraged to create space for vehicles behind.

Show thread
Show older

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!