Skip to content

Instantly share code, notes, and snippets.

View nickebbutt's full-sized avatar

janick388 nickebbutt

View GitHub Profile
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active July 12, 2026 14:01
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount ✓ Constructor equivalent for createClass
render Create and return element(s)
componentDidMount ✓ ✓ DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps ✓ Update state based on changed props
@blendmaster
blendmaster / FancyLenses.java
Created December 2, 2015 08:19
van laarhoven lenses in java
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.*;
/**
* Fancy Lenses Like The Ones In Haskell
*/
class FancyLenses {
// You've got yourself some fine immutable JavaBeans™, and you're cool with that.
@mathieuancelin
mathieuancelin / Lens.java
Last active March 7, 2023 02:23
Lenses with Java 8
package bar.foo.lenses;
import java.util.function.BiFunction;
import java.util.function.Function;
public class Lens<A, B> {
private final Function<A, B> getter;
private final BiFunction<A, B, A> setter;