Skip to content

Instantly share code, notes, and snippets.

@dezza
dezza / git_repo_hash.sh
Created July 29, 2025 03:16
Save a git repo state in a sha256sum by tracking all unmodified, modified, deleted, staged, unstaged, untracked, ignored files as well as config, notes, submodules, worktree, remotes, excludes, heads, branches, stash, hooks and packed-refs
# Save repo state
git_repo_hash() {
set -- "${1%/}" # remove trailing slash
{
cat "$1/.git/logs/HEAD" "$1/.git/ORIG_HEAD" "$1/.git/packed-refs" \
"$1/.git/refs/heads/*" "$1/.git/refs/remotes/*" "$1/.git/refs/stash" \
"$1/.git/logs/refs/stash" "$1/.git/hooks/*" "$1/.git/info/exclude" \
"$1/.git/refs/tags/*" 2>/dev/null
git -C "$1" ls-files --modified --deleted --others
@dezza
dezza / refined-github.css
Last active April 19, 2025 18:23
Github gist custom css
/* https://github.com/sindresorhus/refined-github */
/* Default height viewport for edit view of gist is weirdly snug and shrinked */
.CodeMirror { height: calc(34vw) !important; }
@dezza
dezza / dk.txt
Last active June 12, 2025 18:48
Danske kommunale, offentlige, nævn, styrelser, sekretariater, ministerier, direktorater, statsfinancierede, rådgivning, oplysning, forskning, uddannelses sider
borger.dk
patienterstatningen.dk
mitid.dk
sundhed.dk
laegevejen.dk
stpk.dk
sundhedsdatastyrelsen.dk
digst.dk
netseidbroker.dk
mit.dk
# Norlys Digital A/S
# AS39642
2a00:1b70::/29
2a00:1f98::/29
2a02:25c8::/29
2a02:2b98::/32
2a02:6940::/32
2a03:7400::/29
2a0c:63c0::/48
# AS213320
@dezza
dezza / ublacklist (personal)
Last active August 27, 2025 06:07
ublacklist
---
name: dezza's uBlacklist subscription
description: Personal opinionated blocklist
homepage: https://gist.github.com/dezza/2ede13cc2df2db618e85bceb55228635
---
# WARNING: Firefox can crash if there's a Syntax Error in this list while browsing a search engine.
# - Check syntax error in "Show" under the subscription list.
# TLD
! Title: dezza's Ad Annoyance filters
! Expires: 12 hours
! Description: Filters for Global Website Annoyances
! Homepage: https://abp.recv.ws
! ## YouTube
! Shorts
youtube.com##ytd-reel-shelf-renderer
! Sponsored result
youtube.com##ytd-in-feed-ad-layout-renderer:upward(ytd-ad-slot-renderer)
@dezza
dezza / dk_filter.txt
Last active August 8, 2025 22:57
abp, ublock filters for danish websites
! Title: dezza's Danish filters
! Expires: 12 hours
! Description: Filters for Danish websites.
! Homepage: https://abp.recv.ws
! https://www.pricerunner.dk/cl/36/Harddiske
! https://www.pricerunner.dk/c/black-friday
! https://www.pricerunner.dk/deals
pricerunner.dk##svg[aria-label="PriceRunner logo"] > path:nth-last-of-type(-n+2)
pricerunner.dk##:xpath(//p[text()='Mine produkter']/../../../..)
@dezza
dezza / magic-oldfiles.vim
Last active May 31, 2022 14:35
Its magic 🧙‍♂️⭐
if has('viminfo') && !empty(&viminfo)
" Ignore paths, such as :help files
set viminfo+=r/usr/share/vim/vim81/doc
endif
set viminfofile=$HOME/.vim/viminfo
function! Oldfiles()
rviminfo!
enew
@dezza
dezza / gist:53432d6a0df797a0f64d7142d1c582d2
Created October 7, 2021 23:43
common arkenfox issues
// privacy.firstparty.isolate=true known issues with paypal
// browser.display.use_document_fonts=false known issues with version2.dk fonts
// privacy.resistFingerprinting=true breaks digitalocean login, breaks google oauth logins
// network.http.referer.XOriginPolicy=1 breaks atlassian.com,bitbucket.org login, reddit oauth login
// network.cookie.cookieBehavior=1 breaks memedroid.com google SSO login
// media.autoplay.blocking_policy = 2 # youtube won't autoplay music radios
// media.autoplay.blocking_policy = 2 # twitch won't play ads or unmute audio
// media.autoplay.blocking_policy = 2 # bandcamp won't play next tracks
// media.block-autoplay-until-in-foreground = false # plex will MAYBE stop playing music when forwarding tracks https://www.reddit.com/r/firefox/comments/ga9tzv/i_just_want_to_be_able_to_play_my_plex_playlist/
#!/usr/bin/env zsh
assertequal () {
(( testcount=testcount+1 ))
if [ "$1" = "$2" ]; then
echo "${testcount} PASS: $3"
else
echo "${testcount} FAIL: expected output failed"
fi
}