RSSAmplifier

Blog

Caleb Olojo's Blog

Articles around software engineering (Typescript, JavaScript, React, Next.js, Rust, TanStack, the open web and more), what i'm learning, and or reading, life, sometimes

meje.devRSS feed ↗64 posts

Latest posts

an interface can actually extend multiple interfaces

today i learned that an interface can extend a shit ton of interfaces if you want it to

tuples can be unambiguous

code should be as clear as possible. that's why i'm in love with the concept of named tuples

On strings and characters in Haskell

String is a type alias for [Char] in Haskell. GHCi will tell you that, but only once you look closely enough.

Bits, bytes and pieces

understanding bits and bytes from first principles — binary, storage, ASCII, and why computers speak in powers of two.

Remotes

My mental model around git remotes, and how to push to multiple at once.

An up-close look at UCANs in the wild

Space DIDs, account DIDs, proof chains. What I learned building a delegation tool for myself and indirectly for people building upon Storacha's Hot Storage Network

Content-deterministic CIDs?

How do you tell if a CID points to a file or a directory? And can you get the original name back?

A reward for thinking

the thrill that comes from actually sitting down, thinking about something, a solution to a problem, and then actualize it.

This frailty

take care of yourself, while you still can

a thrum of defiance

an excerpt of what i've been up to since 2023

On Buffers, Binary Serialization and Endianness

Buffers/Array Buffers in JavaScript are actually interesting — for now, at least. I share a little about the stuff I learned about endianness and binary object serialization.

React performance: Memoization

Some stuff/learnings on basic Memoization in React

How to move FIL out of MetaMask: My Experience

In this article, I share how you can move FIL from your MetaMask wallet

Building a proximity feature into maps with React

In this guide, I walk you through how to build something a little bit similar to the "Gym near me" feature on Google Maps.

Adding image info/metadata to Zed

In this article, I share how I made my first contribution to the Zed editor and the stuff I learned from doing so.

Blog posts don't show up immediately with GhostCMS

Blog posts with GhostCMS don't show up immediately with Next.js in production but works fine on localhost. Here's how to fix it

How I fixed a UX issue with a Polling mechanism

Because we can't exactly pinpoint when a request is complete or successful, the approach above will be inefficient

I opened three Next.js projects with Zed and my PC did not prepare for liftoff

Trying Zed for the first time

Monkey patching: refresh token mechanism in React

Intercept network requests by monkey patching the native fetch API

OAuth with Supabase in a Vite React app

For starters, if you want to enable OAuth in your app with Supabase, you would need to use a snippet similar...

How to use react-spring with Chakra UI

Here's how you can use react-spring in a ChakraUI project

Moving husky pre-commit hook into Github Actions

And to even improve the experience of devs on the team, it is better to move this process into a CI environment.

Blur images onLoad with Next.js

Learn how to blur images onLoad with Next.js Image component

Querying a MongoDB collection

How to query a MongoDB collection in a Next.js app with API routes and SWR

2023 — Outside the four walls of a classroom

Last year, I was poor, became broke, and now I'm preaching the gospel of pepper.

Edge function timeouts of next/image on Netlify

You might run into a serverless/edge function timeout error with a 502 status code, causing your images to be broken in production. This is how to fix it.

Building a pagination feature with SWR

It is quite easier to build a pagination feature into React app with SWR

Next.js supports styled-components now?

Next.js has default support for styled-components now

Persisting auth state in Next.js, React Context and cookie wrappers

persisting auth state, choosing the right cookie wrapper based on your project needs. React Context isn't the de facto solution to state management in React apps.

pageExtensions in Next.js

configuring page extensions in Next.js

Confirm email with Djoser in a Next.js app

Implementing a confirm email auth flow with Djoser in a Next.js app

Active nested routes in Next.js — How I figured it out.

check if the current path is the same as what I'm mapping through in my array of navItems

TypeScript Unions — How I used it.

This comparison appears to be unintentional because the types `"admin"` and `"owner"` have no overlap.ts(2367)

Fixing href interpolation errors in Next.js

In the error modal where the information about the error lies, was a link to a page on how to fix this href interpolation error

Here's how to use React Suspense in Next.js

Using suspense in Next.js can be tricky sometimes...

Authentication in Next.js with cookies and getServerSideProps

Here's how authentication works, in general, The user sends a request through the client — a web browser mostly — to a resource...

You Might not need a state-management Library

it is possible to actually keep state in the browser's URL. I mean... that's how Google's search manages the UI state of your search results.

Masking endpoints with Next.js API routes

One of the most common issues with keeping API urls or endpoints in environment variables is that anyone can still access this variable

Adding post controllers to my blog

A tiny detail can appear tiny at times, but can be frustrating as time goes on

Optional props in TypeScript

Sometimes, JavaScript will be JavaScript, and you may not even catch any error

useRef instead of querySelector in React

You should not use the querySelector method to access DOM nodes in React. Instead, use the ref hook

How to fix styled-components server mismatch error in Next.js

This error causes the styles you've written to break on initial render, but when you navigate to another route, it'll behave as normal.

The perils of building a Table of Content component

The idea behind this feature is to give the reader a 'heads-up' about the information/article they're trying to consume.

handleChange in TypeScript

listening to the onChange event is different in TypeScript-based React form components.

Add a preloader to a Next.js site — the right way

A loading component should, in itself, be able to inform the user about the status of their action, it shouldn't show the text 'loading', or a spinner that keeps on going till God knows when.

JavaScript in CSS — A subtle approach

how we can use custom CSS properties (variables) to store state.

Preventing the default scroll event with Next.js useRouter

The router.push method is from the Next.js useRouter hook, which is used to navigate to a new URL.

Type-checking with TypeScript in React

I've never been a fan of TypeScript. But, here I am, writing about it

2022 — you evasive psycho!

I've had so many experiences with failure, but this one was just too much!

Building a real-time views component with Next.js and MongoDB

There aren't so many resources around integrating a static site like mine with MongoDB. I had no idea about what I was doing