start new:
tmux
start new with session name:
tmux new -s myname
| const cache = {} | |
| export default function useGlobalMemo (key, fn, deps) { | |
| if (!cache[key]) { | |
| cache[key] = { | |
| subs: 0, | |
| deps, | |
| value: fn(), | |
| } |
| import * as React from "react"; | |
| import { useMousePosition } from "~/hooks/useMousePosition"; | |
| /** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
| export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
| const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
| const [mouseX, mouseY] = useMousePosition(); | |
| const positions = { x, y, h, w, mouseX, mouseY }; | |
| return ( | |
| <div |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| // If the script does not work, you may need to allow same site scripting https://stackoverflow.com/a/50902950 | |
| Linkedin = { | |
| config: { | |
| scrollDelay: 3000, | |
| actionDelay: 200, | |
| nextPageDelay: 5000, | |
| // set to -1 for no limit | |
| maxRequests: 190, | |
| totalRequestsSent: 0, |