Skip to content

Instantly share code, notes, and snippets.

View timonviola's full-sized avatar
🌚

Timon Viola timonviola

🌚
View GitHub Profile
@timonviola
timonviola / aws-remove-scheduled-for-deletion-secrets.sh
Created October 27, 2025 12:50
AWS CLI remove scheduled-for-deletion secrets
#!/usr/bin/env bash
set -euo pipefail
arr=($(aws secretsmanager list-secrets \
--include-planned-deletion \
--query 'SecretList[?DeletedDate!=null].ARN' \
--output json | jq -r '.[]'))
@timonviola
timonviola / keymap.json
Created December 4, 2024 12:36
zed config
[
{
"context": "Editor && VimControl && !VimWaiting && !menu",
"bindings": {
"space b": "editor::ToggleGitBlame",
"shift-k": "editor::Hover",
"space l f": "editor::Format",
"space d": "diagnostics::Deploy",
"space p f": "file_finder::Toggle",
"ctrl-e": "tab_switcher::Toggle",
@timonviola
timonviola / bash_strict_mode.md
Created September 12, 2024 10:42 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@timonviola
timonviola / .gitconfig
Created March 14, 2024 15:45
Git config aliases
[alias]
whoami = !echo "'\\033[0;32m'$(git config user.name)'\\033[0m' '\\033[1;30m'$(git config user.email)'\\033[0m'"

Obsidian iPad syncing via iSH git

by Danny Quah, Jan 2022

This gist describes using Obsidian on iPad while syncing to other Obsidian platforms. The procedure uses git in iSH on iOS, and thus differs from using either Obsidian Sync or Working Copy as described in Obsidian/iOS+app.

(To be clear, Obsidian is one of my favourite Apps, and I'm all for supporting the team financially. Moreover, everything I've heard suggests the paid Obsidian Sync is excellent. However, I don't want my syncing processes to proliferate --- each service using a different client sync flow --- so I keep my systems minimal: just syncthing and git. After writing this I found an Obsidian Forum writeup which uses the same tools I do to achieve the same goal, but you'll want to read that with its accumulated contributions dispersed across the comments. So at least I was thinking

@timonviola
timonviola / keymap.c
Created March 24, 2023 09:01
Corne Dvorak keymap (QMK v0.19.10)
/*
Copyright 2019 @foostan
Copyright 2023 @timonviola
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@timonviola
timonviola / log_decorators.py
Last active June 23, 2025 08:19
Python logging decorators
from functools import wraps
from typing import Any, Callable, ParamSpec, TypeVar
T = TypeVar("T", bound=Callable[..., Any])
P = ParamSpec("P")
# log results
def log_result(logger_method: Callable[..., Any], msg: str = "") -> Callable[..., Any]:
"""Log the return value of the function.
@timonviola
timonviola / release.sh
Created October 3, 2022 14:34
semver release script for python project
# Updates the
# 1 git version tag,
# 2 project/__init__.py __version__ attribute and
# 3 tests/test_project.py
# 4 pushes the chanes, new tags to remote
# The script makes sure that the new tag is semver2.0 compliant and checks if the new
# version is higher than the latest tag on remote.
#
# To use this, replace the remote URI and the `project` `test_project.py` hardcoded names.
#
@timonviola
timonviola / log.js
Created October 4, 2019 12:37 — forked from vikas5914/log.js
Custom Logger Library with winston
var winston = require('winston')
// set default log level.
var logLevel = 'info'
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'blue',