Skip to content

Instantly share code, notes, and snippets.

View diegohaz's full-sized avatar

Haz diegohaz

View GitHub Profile
@KurtGokhan
KurtGokhan / use-combined-refs-new.ts
Last active March 13, 2024 10:03
useCombinedRefs - Old and new
/**
* A combined ref implementation using the callback ref cleanups feature.
* Note that this won't work yet as callback ref cleanups feature isn't released yet and thought to be released in React 19
*/
import { ForwardedRef, useCallback } from 'react';
type OptionalRef<T> = ForwardedRef<T> | undefined;
type Cleanup = (() => void) | undefined | void;
@sibelius
sibelius / learning-path-web3.md
Last active June 18, 2024 17:52
Learning Path Web3
  • learn blockchain concepts
  • learn ethereum
  • learn how to use metamask
  • learn how to use hardhat (https://hardhat.org/)
  • learn how to deploy and interact with a smart contract
  • learn common smart contract standards like ERC20 (token), ERC721 (nft), ERC1155 (opensea)
  • learn ipfs
  • learn how to read blockchain explorers like https://etherscan.io/
  • learn how to use web3 and etherjs
  • learn solidity
@paulirish
paulirish / what-forces-layout.md
Last active July 22, 2024 06:32
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@cvrebert
cvrebert / survey.md
Last active May 8, 2024 16:13
Click and focus behavior across browsers & OSes

Test apparatus: http://jsfiddle.net/hRub4/

(Windows = Windows 8.1 desktop)

  • Windows Chrome 39
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click and via keyboard tabbing
  • Windows Firefox 30.0
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click and via keyboard tabbing
  • Windows Internet Explorer 11