- Press Command + Shift + P (to open Command Palette)
- Search: “Keyboard Shortcuts (JSON)”
- Upload the following JSON content in the keybindings.json file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* [Try on the TypeScript Playground](https://www.typescriptlang.org/play?#code/PTAEDkHkBUFEC5QBcAWBLAzsgngBwKagYoD2ArgDYAmoAdiUqAEaEDGJAtriRvlQDR0SdfH1AAzEgCdQaRkmEtQAQ1qzaSfFPHLW+AFBI8hALLKpAay2gAvKADeoKfmVUStCtlAB9b2+-0SN4KZKwo3hzmVlTeuFIkBFJGvohktGgAjmSEGNgcTCQUoAC+ANz6hsagAEr4WWjOANL42BhmlpC4SGjuyhQACvGJ3fgYADzQAHy2DvqgoCAQMAigAKq8oJGW1iysymQbAAYAtAD8h074HCQAbqOgh2lU+OJotHwXCiRzoADa-epQFZsCRxKBoCosP0ALpnVK0Z6vd40fAAD00CKw0H+0NAp3BONAAB9QO0rDJENiYeUyhUjAQavhcBRdPgyVpBgktCNxtBBAA1GZPF5vPjTOz2H7-QHA0HgyGgGGIdkyNEYqhYwn42Co1gUMjPCY4wQq6YkwWUnE08qVBmdbq9AZDbloUbQEirBEi5ETcWM5mslWc4au8a1epNFptKL2nq0PrBl2jX2TG30wjQUaMOyxx2JpKh92exGiqhjRwJB3xiinRAYJBSN4AcxKqZ+iwAeqcgA) | |
*/ | |
// NOTE: this type should not be composed, no need for it to be an interface | |
type Marker = { readonly __do_not_touch_marked_property__: unique symbol }; | |
type RequireKeysMarkOptionalProperties<T> = { | |
// NOTE: Use marker because `-?` removes `undefined` too | |
[P in keyof T as P]-?: undefined extends T[P] ? T[P] | Marker : T[P]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
nix derivation show nixpkgs#zstd | jq 'to_entries[].value.outputs' |
Create a QR Code for one that is destroyed, misplaced, or removed from Google Nest Wifi access points.
-
Use the following template to generate the text value for the QR code:
1V:E100$P:3$R:1$D:700101$S:______________$L:641666004ADA471E$W:F072EA4C4100$H:____.ybc$C:________$ ^ ID ^ Wifi ID ^ Setup Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Prisma, PrismaClient } from '@prisma/client'; | |
import { exec } from 'child_process'; | |
import * as util from 'util'; | |
const execPromisify = util.promisify(exec); | |
const prisma = new PrismaClient(); | |
const tables = Prisma.dmmf.datamodel.models | |
.map((model) => model.dbName) | |
.filter((table) => table); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
# So here's a minimal Gist which worked for me as an install on a new M1 Pro. | |
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration | |
# | |
# Let's get started | |
# | |
# Let's install nix (at the time of writing this is version 2.5.1 | |
curl -L https://nixos.org/nix/install | sh | |
# I might not have needed to, but I rebooted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# !!WARNING!! | |
# This will DELETE all efforts you have put into configuring nix | |
# Have a look through everything that gets deleted / copied over | |
nix-env -e '.*' | |
rm -rf $HOME/.nix-* | |
rm -rf $HOME/.config/nixpkgs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ _ | |
/ X \ | |
\/_\/ | |
' ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Go to https://ankiuser.net/edit/ | |
(async ({ cardType, nameOfDeck, data }) => { | |
const body = [ | |
["nid", ""], | |
["data", encodeURIComponent(JSON.stringify(data))], | |
["csrf_token", editor.token], | |
["mid", editor.mode.notetypes.find(({ name }) => name === cardType).id], | |
["deck", editor.mode.decks.find(({ name }) => name === nameOfDeck).id], | |
] |
NewerOlder