Following a recent observation on interview questions like pull-ups.
Knowledge Updates
Observations while developing web applications and creating great software.
-
1Password CLI and .env files ↗
From NSHipster:
We’ve touched on
.env
files in past articles about xcconfig files and secret management on iOS. But this week on NSHipster we’re taking a deeper look, exploring how the lesser-known 1Password CLI (op
) can solve some problems many of us face managing secrets day-to-day.In case you’re not familiar with Twelve-Factor Apps:
Around 2011, Adam Wiggins published “The Twelve-Factor App”, a methodology for building modern web applications that has since become canon in our industry.
The third of those twelve factors, “Config”, prescribes storing configuration in environment variables:
“Apps sometimes store config as constants in the code. This is a violation of twelve-factor, which requires strict separation of config from code. Config varies substantially across deploys, code does not.”
This core insight — that configuration should be separate from code — led to the widespread adoption of
.env
files. -
Fastfetch ↗
Fastfetch is a Neofetch-like tool for fetching system information and displaying it prettily. It is written mainly in C, with performance and customizability in mind.
brew install fastfetch
Why Fastfetch?
From the README:
- Fastfetch is actively maintained.
- Fastfetch is faster. As the name suggests.
- Fastfetch has a greater number of features, though by default fastfetch only has a few modules enabled; use
fastfetch -c all
to find what you want. - Fastfetch is more configurable. You can find more information in the Wiki: https://github.com/fastfetch-cli/fastfetch/wiki/Configuration.
- Fastfetch is more polished. For example, neofetch prints
555 MiB
in the Memory module and23 G
in the Disk module, whereas fastfetch prints555.00 MiB
and22.97 GiB
respectively. - Fastfetch is more accurate. For example, neofetch never actually supports the Wayland protocol.
Discovered from looking at this Ghostty post on X:
-
DOOM CAPTCHA
-
React Fibers, Scan, and Bippy ↗
You may have heard of React Scan for automatically detecting performance issues. It uses Bippy internally. From the README:
a react fiber is a “unit of execution.” this means react will do something based on the data in a fiber. each fiber either represents a composite (function/class component) or a host (dom element).
fibers are useful because they contain information about the react app (component props, state, contexts, etc.). a simplified version of a fiber looks roughly like this:
interface Fiber { // component type (function/class) type: any; child: Fiber | null; sibling: Fiber | null; // stateNode is the host fiber (e.g. DOM element) stateNode: Node | null; // parent fiber return: Fiber | null; // the previous or current version of the fiber alternate: Fiber | null; // saved props input memoizedProps: any; // state (useState, useReducer, useSES, etc.) memoizedState: any; // contexts (useContext) dependencies: Dependencies | null; // effects (useEffect, useLayoutEffect, etc.) updateQueue: any; }
Further reading and watching:
- Why does React have “Rules of Hooks?”
- How does React re-render internally?
- Live visualization of a fiber tree