Skip to content

Instantly share code, notes, and snippets.

@injust
injust / httpx_remove_HTTPStatusError_info_suffix.py
Last active April 9, 2025 23:36
httpx: Remove `HTTPStatusError` info suffix from `raise_for_status()`
from collections.abc import Callable
from functools import wraps
import httpx
def httpx_remove_HTTPStatusError_info_suffix(
raise_for_status: Callable[[httpx.Response], httpx.Response],
) -> Callable[[httpx.Response], httpx.Response]:
@wraps(raise_for_status)
@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 December 25, 2024 14:55
DMOJ: Personal userscript
$(() => {
$('.anime-img').show()
// Dark mode for native HTML elements
const colorScheme = $('<meta>').attr({
name: 'color-scheme',
content: 'light dark'
})
$('head').append(colorScheme)
./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