You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Sam Potts
sampotts
Design Engineer. Currently at Released.so. Previously: Amazon, Search.io, Selz.
Remix Deferred is currently implemented on top of React's Suspense model but is not limited to React. This will be a quick dive into how "promise over the wire" is accomplished.
SSR + Hydration
It isn't rocket science, but a quick recap of how frameworks such as react do SSR:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A macOS shell and developer toolchain setup script updated for Big Sur (Aug 2021)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A macOS software install script updated for a Big Sur install (Aug 2021)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
Use ESM yourself. (preferred)
Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
Stay on the existing version of the package until you can move to ESM.
Memoization is a somewhat fraught topic in the React world, meaning that it's easy to go wrong with it, for example, by [making memo() do nothing][memo-pitfall] by passing in children to a component. The general advice is to avoid memoization until the profiler tells you to optimize, but not all use cases are general, and even in the general use case you can find tricky nuances.
Discussing this topic requires some groundwork about the technical terms, and I'm placing these in once place so that it's easy to skim and skip over:
Memoization means caching the output based on the input; in the case of functions, it means caching the return value based on the arguments.
Values and references are unfortunately overloaded terms that can refer to the low-level implementation details of assignments in a language like C++, for example, or to memory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I prefer to bond multiple network interfaces for redundancy, however viewing and configuring the bond interface can be a bit tricky.
Bonding mode: active-backup
Multiple network links can be bonded using "active-backup" mode so that if one NIC goes down, another will take its place. This mode does not require a managed switch, however it has trouble prioritizing one interface over another. For example if you have a 1 Gbps NIC and a 10 Gbps NIC, unRAID is not smart enough to prefer the 10 Gbps NIC.
Viewing Network Interface Status
View overall bond status:
cat /proc/net/bonding/bond0