Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Tom Medema tommedema

🎯
Focusing
View GitHub Profile
@andywer
andywer / _readme.md
Last active November 30, 2022 16:03
React - Functional error boundaries
View _readme.md

React - Functional error boundaries

Thanks to React hooks you have now happily turned all your classes into functional components.

Wait, all your components? Not quite. There is one thing that can still only be implemented using classes: Error boundaries.

There is just no functional equivalent for componentDidCatch and deriveStateFromError yet.

Proposed solution

@spemer
spemer / customize-scrollbar.css
Last active March 9, 2023 08:25
Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
View customize-scrollbar.css
/* Customize website's scrollbar like Mac OS
Not supports in Firefox and IE */
/* total width */
body::-webkit-scrollbar {
background-color: #fff;
width: 16px;
}
/* background of the scrollbar except button or resizer */
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active March 23, 2023 20:29
Serverless Lifecycle Cheat Sheet
View lifecycle-cheat-sheet.md

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,