Skip to content

Instantly share code, notes, and snippets.

View hugows's full-sized avatar
🏠
Working from home

Hugo Schmitt hugows

🏠
Working from home
View GitHub Profile
@hugows
hugows / component.js
Created December 10, 2021 17:00
A trick to detect re-renders in React
// Add a random background to the component
// On a re-render, the component gets a new color
// Source of this snippet: https://kyleshevlin.com/using-react-memo-to-avoid-unnecessary-rerenders
const random255 = () => Math.floor(Math.random() * 255)
const randomRGBA = () => {
const r = random255()
const g = random255()
const b = random255()
@hugows
hugows / dropover.markdown
Last active September 10, 2023 11:00
Add file to Dropover from command line / terminal