- Homebrew should be installed (Command line tools for Xcode are included).
- Install
nvmvia Homebrew
| 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 |
nvm via Homebrew#Oh My Zsh - Git Cheat Sheet
g – git
gst – git status
gl – git pull
gup – git pull --rebase
This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x
The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/
| #!/bin/bash | |
| if [ "$#" -ne "1" ]; then | |
| echo "Usage: $0 package_list" | |
| exit 1 | |
| fi | |
| cat $1 | xargs -I {} bash -c "echo {}; brew deps {}" | sort | uniq > /tmp/brew_keep | |
| comm -23 <(brew list -1 | sort) <(cat /tmp/brew_keep) > /tmp/brew_rm | |
| lines=$(cat /tmp/brew_rm | wc -l | sed -e 's/ //g') |
| // borrowed from https://stackoverflow.com/questions/11616630/json-stringify-avoid-typeerror-converting-circular-structure-to-json/48254637#48254637 | |
| const safeStringify = v => { | |
| const cache = new Set(); | |
| return JSON.stringify(v, (key, value) => { | |
| if (typeof value === 'object' && value !== null) { | |
| if (cache.has(value)) { | |
| // Circular reference found, discard key | |
| return; | |
| } | |
| // Store value in our set |
| //Map Collect function | |
| // Since the builtin map-merge function in Sass only take 2 arguments, it can only merge 2 maps at a time. | |
| // The map-collect function below allows you to combine multiple maps together in a cleaner way. | |
| @function map-collect($maps...) { | |
| $collection: (); | |
| @each $map in $maps { | |
| $collection: map-merge($collection, $map); | |
| } |
| // borrowed from https://gist.github.com/Integralist/749153aa53fea7168e7e#gistcomment-1457123 | |
| const flatten = list => list.reduce( | |
| (accumulator, element) => accumulator.concat(Array.isArray(element) | |
| ? flatten(element) | |
| : element), | |
| [] | |
| ); |