Skip to content

Instantly share code, notes, and snippets.

View kai-kj's full-sized avatar

Kai Kitagawa-Jones kai-kj

View GitHub Profile
@kai-kj
kai-kj / cr2tiff.sh
Last active December 1, 2024 16:51
Convert raw files to ppm files and copy exif data
#!/bin/bash
n_threads=1
if ! [ -x "$(command -v dcraw_emu)" ]; then
echo "error: dcraw_emu does not exist (ubuntu: apt install libraw-bin)"
exit 1
fi
while getopts "hn:" opt; do
@kai-kj
kai-kj / mini_doc_gen.py
Last active July 13, 2023 05:21
A tiny documentation generator for c. Outputs a markdown file.
import sys, re
class T:
def __init__(self, text): self.curr = 0; self.txt = text.splitlines(True)
def at(self, i): return self.txt[i] if i < len(self.txt) else None
def peek(self): return self.at(self.curr)
def next(self): self.curr += 1; return self.at(self.curr - 1)
def d_start(l): return re.search(r"^\/\*\*\s*(\w*)", l)
def d_end(l): return re.search(r"^ \*\/", l) if l else True
@kai-kj
kai-kj / makefile
Last active August 17, 2022 06:24
A basic makefile to compile binary files
#======================================================================================================================#
# CONFIG
#======================================================================================================================#
#---- BASIC -----------------------------------------------------------------------------------------------------------#
EXECUTABLE :=
LIBS :=
FLAGS := -Wall -Wno-missing-braces
DEFS :=