Skip to content

Instantly share code, notes, and snippets.

@snOm3ad
snOm3ad / pyrun.py
Created November 14, 2023 02:52
Python utility orchestrator
#!/usr/bin/python3
import subprocess as sp
import os
import argparse
import sys
def clap(args, utils):
parser = argparse.ArgumentParser(prog='PyRun', description='Script orchestration utility.')
parser.add_argument('util', choices=utils, help='Script to be ran')
@snOm3ad
snOm3ad / zettel.sh
Last active October 18, 2022 02:31
automatic `.md` file creator with zettelkasten format.
#!/bin/bash
# $# - arguments passed to the program.
while [[ $# -gt 0 ]]
do
case "$1" in
-h|--help)
PROG_NAME=$(basename "$0")
echo "$PROG_NAME"
echo "A note creator for zettelkasten format."
@snOm3ad
snOm3ad / tmux-dev.sh
Created May 17, 2020 18:25
automatic session creator for tmux.
#!/bin/bash
create_session() {
# robustly split the space separated list of window names.
read -r -a WINDOWS <<< "$NAMES"
# override parameter list with names of windows.
set -- "${WINDOWS[@]}"
# create session with first window argument.
tmux new -d -s "$SESSION" -n "$1" || return 1
shift
# `seq 0` actually produces the output `1 0` thus the script would