Skip to content

Instantly share code, notes, and snippets.

View martin-braun's full-sized avatar
♠️

Martin Braun martin-braun

♠️
View GitHub Profile
@martin-braun
martin-braun / install_node_suite.sh
Created February 23, 2023 18:40
Find recommend NPM version for current node version
#!/usr/bin/env sh
# TODO: Install nodejs
read npmv < <(echo $(node -e "fetch('https://nodejs.org/dist/index.json').then(r=>r.json()).then(e=>console.info(e.filter(a=>a.version=='$(node -v)')[0].npm))"))
# TODO: Install npm version $npmv
@martin-braun
martin-braun / 8vim2txt.py
Last active June 18, 2023 04:14
8vim - DE Regular German: kjoetom's time moves (MB h4cker edition) DE60/EN40 Extended
#!/usr/bin/env python3
from fileinput import input as fileinput
from xml.etree import ElementTree
root = ElementTree.fromstring("".join(list(fileinput())))
for keyboardAction in root.findall('.//keyboardAction'):
keyboardActionType = keyboardAction.find('keyboardActionType')
movementSequence = keyboardAction.find('movementSequence')
@martin-braun
martin-braun / !vs.md
Last active March 10, 2024 14:03
vs - Git Vendor Sources - A POSIX compliant Unix tool to manage third-party git sources

Git Vendor Sources

Usage

Usage: vs [COMMAND] [REPO] [OPTIONS]
Adds, updates or deletes git source files of third party vendors in the local source storage at $HOME/.sources/.vendor.
This tool is meant to clone third party sources to compile or use without further modification.
It will try to checkout the latest tag and fallback to the latest branch, unless a prefered branch/tag is given.
If you want to load a workspace, consider forking and cloning using the normal git utility instead.
@martin-braun
martin-braun / ldwallpaper.inc
Last active August 15, 2024 05:20
macOS - Create a "light and dark" wallpaper
ldwallpaper() {
if [ $# -lt 3 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Creates a light and dark wallpaper for macOS."
echo "Usage: ldwallpaper [-h] [--help] light_image dark_image out_heic"
echo ""
return 129
fi
command -v "exiv2" >/dev/null 2>&1 || { echo "exiv2 is not installed." >&2; return 1; }
command -v "heif-enc" >/dev/null 2>&1 || { echo "libheif is not installed." >&2; return 1; }
test -s "$1" || { echo "Light image does not exist." >&2; return 1; }
@martin-braun
martin-braun / !jrpc.md
Last active March 10, 2024 08:29
jrpc - Simple CLI tool for testing output from JSON RPC 2.0 services

JSON RPC CLI test tool

Usage

Usage: jrpc [OPTIONS]
Simple CLI tool for testing output from JSON RPC 2.0 services.

OPTIONS
  -V,   --version                 Prints the version of this script.

SSH Store

Secure your secrets using your SSH agent.