Skip to content

Instantly share code, notes, and snippets.

@injust
injust / git-set-head.sh
Created November 3, 2024 06:09
Git: Set `origin/HEAD`
git remote set-head origin --auto
@injust
injust / brew-autoupdate.sh
Last active October 28, 2024 07:36
Homebrew: Autoupdate
brew tap domt4/autoupdate
brew autoupdate start 21600 --upgrade --cleanup --immediate
@injust
injust / disable-cmd-ctrl-d.sh
Last active October 28, 2024 07:42
macOS: Disable Look Up in Dictionary shortcut (Ctrl-⌘-d)
# https://apple.stackexchange.com/questions/22785/how-do-i-disable-the-command-control-d-word-definition-keyboard-shortcut-in-os-x/114269#114269
defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 70 '<dict><key>enabled</key><false/></dict>'
@injust
injust / dmoj.user.js
Last active November 10, 2024 05:07
DMOJ: Personal userscript
$(document).ready(() => {
// Dark mode for native HTML elements
const colorScheme = $('<meta>').attr({
name: 'color-scheme',
content: 'light dark'
})
$('head').append(colorScheme)
// Highlight trailing whitespace (from https://dmoj.ca/user/d)
const f = s => `<span style="background-color: rgba(247, 196, 0, 0.5)">${s}</span>`
./gmvault-v1.9.2-beta-1/gmvault sync --type=custom --db-dir=./gmvault-db/ --passwd --gmail-req=label:gmvault_dl --emails-only --check-db=no --no-compression $EMAIL
python3 help_crack.py --coptions="--deprecated-check-disable --backend-ignore-opencl --workload-profile 3 --slow-candidates" --dictcount 15
hwatch --color --interval=300 --differences \
'curl -fsS https://dutchie.com/graphql \
-H "Content-Type: application/json" \
-d \'{"operationName": "IndividualFilteredProduct", "extensions": {"persistedQuery":{"version":1,"sha256Hash":"294bd77efd624c69e1a614f431729d422f81aa6505f535061589df96efcf184c"}}, "variables": {"productsFilter":{"cName":"ellevia-rso-1g","dispensaryId":"64c136f3a1b0aa000940eb6f"}}}\' \
--compressed \
| jq --color-output ".data.filteredProducts.products[0] | del(..|nulls)"'
curl -fsS https://dutchie.com/graphql \
-H 'Content-Type: application/json' \
-d '{"operationName": "IndividualFilteredProduct", "extensions": {"persistedQuery":{"version":1,"sha256Hash":"294bd77efd624c69e1a614f431729d422f81aa6505f535061589df96efcf184c"}}, "variables": {"productsFilter":{"cName":"ellevia-rso-1g","dispensaryId":"64c136f3a1b0aa000940eb6f"}}}' \
--compressed \
| jq '.data.filteredProducts.products[0] | del(..|nulls)'
@injust
injust / install-nanorc.sh
Last active October 28, 2024 07:36 — forked from BlakeGardner/install nano.sh
nano: Syntax highlighting
brew install gnu-sed nano nanorc
echo 'include "'"$(brew --prefix)"'/share/nanorc/*.nanorc"' >> ~/.nanorc
gsed -i 's/icolor brightnormal/icolor normal/g' $(brew --prefix)/share/nanorc/nanorc.nanorc
@injust
injust / aa-award-search-hwatch.sh
Last active August 19, 2024 03:55
AA award search (hwatch)
hwatch --color --interval=60 --differences \
'curl -fsS https://www.aa.com/booking/api/search/calendar \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" \
-d \'{"metadata":{"selectedProducts":[],"tripType":"OneWay","udo":{}},"passengers":[{"type":"adult","count":1}],"requestHeader":{"clientId":"AAcom"},"slices":[{"allCarriers":true,"cabin":"BUSINESS,FIRST","departureDate":"2024-01-25","destination":"ORD","destinationNearbyAirports":true,"maxStops":null,"origin":"HKG","originNearbyAirports":true}],"tripOptions":{"searchType":"Award","corporateBooking":false,"locale":"en_US"},"loyaltyInfo":null,"queryParams":{}}\' \
--compressed \
| jq --sort-keys --color-output ".calendarMonths[0].weeks.[].days | flatten[] | select( .solution != null ) | del(.dayOfMonth, .solution.calendarSlices, .validDay)"'