Skip to content

Instantly share code, notes, and snippets.

View macmaster's full-sized avatar
😴
Dreaming

Ronald MacMaster macmaster

😴
Dreaming
  • Bloomberg
  • New York, NY
View GitHub Profile
@moshmage
moshmage / readme.md
Last active February 1, 2020 21:00
Simple SCSS Typography

Simple Typography SCSS

Because I was tired of writing them too.

Elements

Heading 1 through 6 will be styled with @mixin typo($opts) (line 39)

Created classes

just for font-size

  • .font-
  • h1...6
@slikts
slikts / advanced-memo.md
Last active February 25, 2025 15:19
Advanced memoization and effects in React

nelabs.dev

Advanced memoization and effects in React

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