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
| # grab list of image ids | |
| docker images -a | tail -n+2 | awk '{print $3}' | |
| # Explanation | |
| # | |
| # -n+2 removes the table header from the output | |
| # awk '{print $3}' grabs the image column values | |
| # Output |
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
| # syntax | |
| curl -s https://api.github.com/repos/<org>/<repo> | jq .created_at | |
| # example | |
| curl -s https://api.github.com/repos/PRQL/prql | jq .created_at |
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
| # get list all domains support by `defaults` and present as a list | |
| defaults domains | sed 's/, /\n/g' |
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
| # may or may not work | |
| dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | |
| curl icanhazip.com | |
| curl ifconfig.me |
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
| # syntax to read | |
| # defaults read <bundle-identifier> ApplePressAndHoldEnabled | |
| # syntax to write | |
| # defaults write <bundle-identifier> ApplePressAndHoldEnabled -bool false | |
| # example command | |
| defaults write com.electron.replit ApplePressAndHoldEnabled -bool false |
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
| # find the bundle identifier of Numbers app | |
| codesign -dv /Applications/Numbers.app/ | |
| # explanation of the flags used | |
| # | |
| # -d, --display Display information about the code at the path(s) given. | |
| # -v, --verify Requests verification of code signatures | |
| # one line to directly extract the bundle identifier using [rg](https://github.com/BurntSushi/ripgrep) | |
| codesign -dv /Applications/Numbers.app/ 2>&1 | rg '^Identifier=' --replace "" |
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
| function getElements({ sort = true } = {}) { | |
| let elems = Array.from(document.getElementsByTagName("*")).map( | |
| (e) => e.localName | |
| ); | |
| let map = new Map(); | |
| for (let elem of elems) { | |
| if (!map.has(elem)) { | |
| map.set(elem, 1); |
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
| const source = { a: 1, b: 2, c: 3 } | |
| const toRemove = "c" | |
| const { [toRemove]: toRemove, ...rest } = source | |
| // rest will be { a: 1, b: 2 } | |
| // source remains { a: 1, b: 2, c: 3} |
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
| const http = require("http"); | |
| const express = require("express"); | |
| const app = express(); | |
| const HOST = "localhost"; | |
| const PORT = 4000; | |
| const PROXY_PORT = 8080; | |
| setupProxy(); |
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
| security find-generic-password -ga "SSID" |