Skip to content

Instantly share code, notes, and snippets.

@injust
injust / httpx-remove-HTTPStatusError-info-suffix.py
Last active April 29, 2025 11:47
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 April 29, 2025 12:00
Homebrew: Configure auto-update
brew tap domt4/autoupdate
brew autoupdate start 21600 --upgrade --cleanup --immediate
@injust
injust / disable-cmd-ctrl-d.sh
Last active April 29, 2025 11:57
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
@injust
injust / install-nanorc.sh
Last active April 29, 2025 11:59 — forked from BlakeGardner/install nano.sh
nano: Improved 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