Skip to content

Instantly share code, notes, and snippets.

View openly-retro's full-sized avatar

openly-retro

  • Washington, DC
View GitHub Profile
@openly-retro
openly-retro / oxr_stellaris_grammar.g4
Last active January 14, 2026 05:25
Attempt to describe up-to-date Stellaris (Clausewitz) script in Antlr grammar
// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging
grammar oxr_stellaris_grammar;
content
: expr+ EOF
;
expr
@openly-retro
openly-retro / stellaris02.sublime-syntax
Last active January 7, 2026 16:21
Sublime Syntax for Stellaris (Clausewitz) script (paradox interactive)
%YAML 1.2
---
# See http://www.sublimetext.com/docs/syntax.html
# This syntax file describes how to parse clausewitz files
# so that Sublime Text can identify scopes
# Once scopes are identified, color schemes can be applied in the editor
# https://www.sublimetext.com/docs/syntax.html
# https://www.sublimetext.com/docs/scope_naming.html
@openly-retro
openly-retro / moocon.sh
Created November 25, 2025 03:24
Use FFmpeg to convert a movie file to MKV with open-source/free audio & video codecs
#!/bin/bash
# I use this to convert MOV files from my iphone to more open formats
sourcefile=$1
sourcefilenoext="${sourcefile%.*}"
sourceasmkv="${sourcefilenoext}.mkv"
ffmpeg -i $sourcefile -c:v libsvtav1 -q:v 7 -c:a libopus $sourceasmkv
touch -r $sourcefile $sourceasmkv
# MOV files created on iphones have a special 'filemodifydate' exif data we can use
@openly-retro
openly-retro / axel.sh
Created November 25, 2025 03:19
Use Imagemagick to convert a HEIC image to JXL and rename based on original creation date
#!/bin/bash
sourcefile=$1
sourcefilenoext="${sourcefile%.*}"
sourceasjxl="${sourcefilenoext}.jxl"
SECONDS=0
# conversion to jxl (JPEG-XL)
magick mogrify -format jxl $sourcefile -define preserve-timestamp=true
@openly-retro
openly-retro / bash_prompt.txt
Created July 11, 2024 04:09
Customized Bash prompt, promoting directory on first line, time and branch on second
# append below to ~/.bashrc
PROMPT_COMMAND='PS1_CMD1=$(git branch --show-current 2>/dev/null)'; PS1='\[\e[38;5;143m\]\d\[\e[0m\] (\[\e[38;5;115m\]\u\[\e[0m\]) \[\e[38;5;36m\]\w\[\e[0m\] \n\t \[\e[38;5;211m\]${PS1_CMD1}\[\e[0m\]> '