Skip to content

Instantly share code, notes, and snippets.

@CzechJiri
CzechJiri / gmaps-trackpad-fix
Created September 2, 2026 20:16
Brave custom scriptlet: two-finger trackpad scroll pans Google Maps; pinch zooms
// Brave custom scriptlet: two-finger trackpad scroll pans Google Maps; pinch zooms.
//
// Google Maps' default trackpad behavior zooms on two-finger scroll in any
// direction. This makes two-finger scroll pan the map instead (in all
// directions), while pinch-to-zoom keeps working normally.
//
// INSTALL (Brave desktop):
// 1. Open brave://settings/shields/filters
// 2. Turn on "Developer mode" (under Content filtering)
// 3. Click "Add new scriptlet", paste this ENTIRE file into the code box
@CzechJiri
CzechJiri / config.json
Created August 28, 2026 00:16
Karabiner: remap my mac-os "printscreen shortcut - I use Shottr app" to Windows printscreen key in Citrix (keeps keys consistent for different OS)
{
"description": "Remap Left Shift + Left Command + C to Print Screen when Citrix is the frontmost app",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.citrix\\.receiver\\.nomas$",
"^com\\.citrix\\.receiver\\.icaviewer\\.mac$",
"^com\\.citrix\\.ICAClient$",
@CzechJiri
CzechJiri / config.json
Created August 28, 2026 00:12
Karabiner: remap my mac-os "paste from history" to Windows in Citrix
{
"description": "Remap Left Shift + Left Command + V to Right Command + V when Citrix is the frontmost app",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.citrix\\.receiver\\.nomas$",
"^com\\.citrix\\.receiver\\.icaviewer\\.mac$",
"^com\\.citrix\\.ICAClient$",
@CzechJiri
CzechJiri / google-maps-trackpad-pan-fix.user.js
Created August 21, 2026 18:37
tampermonkey: two-finger trackpad scroll pans Google Maps (any direction) instead of zooming, pinch zooms. Fixes the default macOS trackpad behavior on maps.google.com.
// ==UserScript==
// @name Google Maps Trackpad Fix (pan on two-finger scroll, zoom on pinch)
// @namespace local.google-maps-trackpad-fix
// @version 1.0
// @description Two-finger scroll pans the map in any direction; pinch zooms. Only runs on Google Maps.
// @match https://www.google.com/maps*
// @match https://maps.google.com/*
// @run-at document-idle
// @grant none
// ==/UserScript==
@CzechJiri
CzechJiri / podcast_copy.sh
Last active July 20, 2026 13:56
I love listening to podcasts while swimming with my Shokz OpenSwim Pro, but it has no Bluetooth/streaming — I have to load MP3s onto it directly. Apple Podcasts already downloads episodes locally for offline playback, but buries them in an obscure app cache folder with no filenames to speak of. This script digs those MP3s out of Apple Podcasts' …
#!/usr/bin/env python3
"""
Copies MP3 files created/modified in the last 2 hours from the Apple
Podcasts local cache into ~/Downloads/Podcasts, renamed to
"Author - Podcast Name.mp3" using each file's ID3 tags.
Any existing .mp3 files in the destination folder are deleted first.
"""
import argparse
import json
@CzechJiri
CzechJiri / run.sh
Created July 16, 2020 19:53
openVPN server Let's Encrypt renewal via single command line
certbot certonly --standalone \
--non-interactive \
--preferred-challenges tls-sni \
--agree-tos \
--email hostmaster@mydomain.com \
--domains vpn.mydomain.com \
--pre-hook '/usr/local/openvpn_as/scripts/sacli stop' \
--post-hook '/usr/local/openvpn_as/scripts/sacli --key "cs.priv_key" --value_file "/etc/letsencrypt/live/office.deep-labs.com/privkey.pem" ConfigPut && /usr/local/openvpn_as/scripts/sacli --key "cs.cert" --value_file "/etc/letsencrypt/live/office.deep-labs.com/cert.pem" ConfigPut && /usr/local/openvpn_as/scripts/sacli --key "cs.ca_bundle" --value_file "/etc/letsencrypt/live/office.deep-labs.com/fullchain.pem" ConfigPut && /usr/local/openvpn_as/scripts/sacli start'

Keybase proof

I hereby claim:

  • I am czechjiri on github.
  • I am czechjiri (https://keybase.io/czechjiri) on keybase.
  • I have a public key ASACq5_vCcvs6OfAcIuzbClI4oKCmHFERAMW6Ml2pNGdlgo

To claim this, I am signing this object:

@CzechJiri
CzechJiri / datetime.py
Created May 25, 2017 16:23
my ideal date format for python logging with no spaces, commas or missing timezone
from datetime import datetime, timezone
print( datetime.now(timezone.utc).isoformat() )
@CzechJiri
CzechJiri / wait-for-it postgres style
Last active June 24, 2016 20:55
running application and DB using docker-compose.yml is tricky, because app will not wait for DB to be fully up and read to accept connections (docker-compose.yml only deals with dependencies). This function can be part of application entrypoint script, it waits up to 30 seconds for postgres to start. It uses pg_isready (works even without passwo…
function pg_ready()
{
waitTime=30 # keep trying for x seconds
n=0
until [ $n -ge $waitTime ]; do
# please note pg_isready does not care about username/dbname
# you can add correct values if you want to avoid errors in PG log
pg_isready --host=$DB_HOST --port=$DB_PORT && break