BBEdit docs https://www.barebones.com/support/bbedit/lsp-notes.html
Volta https://docs.volta.sh/reference/
curl https://get.volta.sh | bash -s -- --skip-setup
BBEdit docs https://www.barebones.com/support/bbedit/lsp-notes.html
Volta https://docs.volta.sh/reference/
curl https://get.volta.sh | bash -s -- --skip-setup
Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.
If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.
| /* Ultra lightweight Github REST Client */ | |
| // original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
| const token = 'github-token-here' | |
| const githubClient = generateAPI('https://api.github.com', { | |
| headers: { | |
| 'User-Agent': 'xyz', | |
| 'Authorization': `bearer ${token}` | |
| } | |
| }) |
| const fetch = (...args) => console.log(...args) // mock | |
| function httpRequest(url, method, data) { | |
| const init = { method } | |
| switch (method) { | |
| case 'GET': | |
| if (data) url = `${url}?${new URLSearchParams(data)}` | |
| break | |
| case 'POST': | |
| case 'PUT': | |
| case 'PATCH': |
| import { debounce as _debounce, throttle as _throttle } from '@ember/runloop'; | |
| function timingDecorator(fn) { | |
| return function (delay) { | |
| return function (instance, property, descriptor) { | |
| return { | |
| value(...args) { | |
| if (!instance.isDestroying && !instance.isDestroyed) { | |
| return fn(instance, descriptor.value, ...args, delay); | |
| } |
| git config --global diff.tool bbdiff | |
| git config --global difftool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"' | |
| git config --global difftool.prompt false | |
| git config --global merge.tool bbdiff | |
| git config --global mergetool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"' | |
| Double check ~/.gitconfig |
| // when T is any|unknown, Y is returned, otherwise N | |
| type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N; | |
| // when T is never, Y is returned, otherwise N | |
| type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N; | |
| // when T is a tuple, Y is returned, otherwise N | |
| // valid tuples = [string], [string, boolean], | |
| // invalid tuples = [], string[], (string | number)[] |
| /// | |
| /// Line-Clamp | |
| /// | |
| /// https://medium.com/@elad/trimming-multi-lines-in-css-5ae59d5e6d84 | |
| /// | |
| @mixin line-clamp($lines: null) { | |
| @if $lines != null { | |
| display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */ | |
| -webkit-line-clamp: $lines; |
| /* | |
| Copy this into the console of any web page that is interactive and doesn't | |
| do hard reloads. You will hear your DOM changes as different pitches of | |
| audio. | |
| I have found this interesting for debugging, but also fun to hear web pages | |
| render like UIs do in movies. | |
| */ | |
| const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |