Skip to content

Instantly share code, notes, and snippets.

View piggynl's full-sized avatar
🐱

Piggy piggynl

🐱
View GitHub Profile
# ~/.config/mpv/input.conf
z add sub-delay -0.5 # shift subtitles 500 ms earlier
Z add sub-delay +0.5 # delay subtitles by 500 ms
x add sub-delay +0.5 # delay subtitles by 500 ms
@piggynl
piggynl / .gitconfig
Last active September 24, 2025 10:03
~/.gitconfig
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = Piggy
email = piggynl@outlook.com
signingKey = 9EEBC83C83FBE5FD6B339460A2B522033B71526D
[init]
defaultBranch = main
[pull]
ff = only
@piggynl
piggynl / $imapfilter.lua
Last active June 14, 2024 11:50
Periodically move unseen junk emails to inbox. This is to against Outlook's overly aggressive spam detection.
-- Ignore this file.
-- https://stackoverflow.com/questions/19896900/how-to-change-the-name-of-a-gist-in-github/19904644#19904644
-- https://stackoverflow.com/questions/17665267/how-do-you-control-the-order-in-which-files-appear-in-a-github-gist/17668995#17668995
@piggynl
piggynl / fonts.conf
Created June 8, 2024 14:52
~/.config/fontconfig/fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias binding="strong">
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>Noto Serif CJK SC</family>
</prefer>
</alias>
@piggynl
piggynl / config.fish
Last active May 28, 2025 16:15
~/.config/fish/config.fish
if status is-interactive
# Commands to run in interactive sessions can go here
end
function last_history_item
echo $history[1]
end
abbr -a !! --position anywhere --function last_history_item
function fish_user_key_bindings
@piggynl
piggynl / tg-json-export-to-text.py
Last active March 26, 2025 14:55
Transform Telegram chat export in JSON to a easy-to-read line-by-line text file.
#!/usr/bin/env python3
import json
import sys
if len(sys.argv) == 1:
print(f'Usage: {sys.argv[0]} result.json > result.txt')
sys.exit(1)
with open(sys.argv[1], 'r') as f:
data = json.load(f)
@piggynl
piggynl / dn42-peer.sh
Created November 22, 2022 13:22
My script to add a peer in DN42.
#!/bin/sh
if [ "$(id -u -n)" != "root" ]; then
echo "You need to run this script as root"
exit 1
fi
WG_PRIVKEY=
WG_PUBKEY=
@piggynl
piggynl / iitc-polygon-to-polyline.js
Last active September 26, 2022 06:20
Convert polygons to polylines in exported drawn Items from Draw Tools in IITC.
var drawnItems = [{"type":"polygon","latLngs":[{"lat":0,"lng":0},{"lat":0,"lng":60},{"lat":30,"lng":30}],"color":"#a24ac3"}];
drawnItems = drawnItems.map(o => o.type !== "polygon" ? o : { ...o, type: "polyline", latLngs: [...o.latLngs, o.latLngs[0]] });
copy(JSON.stringify(drawnItems));