Skip to content

Instantly share code, notes, and snippets.

View LockeBirdsey's full-sized avatar
🐛

Locke Birdsey LockeBirdsey

🐛
View GitHub Profile
@LockeBirdsey
LockeBirdsey / pfkm_large_zone_finder.sh
Last active August 6, 2022 13:23
Pathfinder: Kingmaker has this realllllllllllllllllly annoying save system (it just dumps Unity components from a scene into a Json and each zone has persistence so these Jsons stay large forever). This is a little (and very hastily put together) bash script to find which zones are creating the most trouble
# NEEDS jq installed
# sorry for how lazy this is
# run this inside an uncompressed save file directory (you know, the one with dozens of json files and png fog of war masks)
# this will help you find which are the zones causing the most save lag
# run this, install UMM + Cleaner (and NoHistory to be extra clean) mods and travel to largest zones and run the "Clean" option provided
# by the Cleaner mod
echo > zones.txt; for f in *.json; do s=`stat -c "%s %n" "$f"`; j=`jq '.m_MainState.SceneName' "$f"`; echo $s $j >> zones.txt; done; sort -n --reverse zones.txt > zones_sorted.txt;
# output is:
# sizeinbytes filename zonename
@LockeBirdsey
LockeBirdsey / markmerge.py
Last active May 25, 2021 05:29
Markdown merger:
#v0.6
import argparse
import re
import sys
parser = argparse.ArgumentParser(description="Incorporate multiple markdown files into a single source markdown file based on keys. Returns STDOUT")
parser.add_argument('source', type=str, help="The source markdown file")
parser.add_argument('--manual', metavar="file", type=str, nargs='+', help="a list of files to be incorporated into the source file. \
\nCan pass in file names that match the keys or can direct keys to files using \"KEY:FILE\" where KEY is the key in the markdown\
file and FILE is the path to the file whose contents you want to replace the key with")
function onEdit(e) {
var sheet = SpreadsheetApp.getActive().getActiveSheet();
//Get the final potential rows
var row = 10;
var varA = SpreadsheetApp.getActiveSheet().getRange(row, 4).getValue();
var varB = SpreadsheetApp.getActiveSheet().getRange(row, 5).getValue();
var varC = SpreadsheetApp.getActiveSheet().getRange(row, 6).getValue();
var varD = SpreadsheetApp.getActiveSheet().getRange(row, 7).getValue();
var varE = SpreadsheetApp.getActiveSheet().getRange(row, 8).getValue();
@LockeBirdsey
LockeBirdsey / TwineTitleCard.css
Created February 3, 2020 11:25
Generate a text-only Title Screen for Twine using CSS
/*
This centers some text on the screen and then you can
display some stuff under it to start the story
Place in the main Twine stylesheet
Use with:
@@.titlecard;
Title of the story
@@
*/
@LockeBirdsey
LockeBirdsey / pngToICO.sh
Created February 2, 2020 11:57
Converts a PNG to a Windows ICO file. Uses imagemagick instead of sips for conversion for nix-ness
#!/bin/bash
#The image you want to make into a Windows ICO file
#Requires imagemagick
orig=$1
mkdir tmp_ico_dir
# resize all the images
convert -scale 16 $orig tmp_ico_dir/icon_16x16.png
convert -scale 32 $orig tmp_ico_dir/icon_32x32.png
convert -scale 128 $orig tmp_ico_dir/icon_128x128.png
convert -scale 256 $orig tmp_ico_dir/icon_256x256.png
@LockeBirdsey
LockeBirdsey / pngToICNS.sh
Last active February 2, 2020 11:43
Convert a PNG to a macOS ICNS file
#!/bin/bash
#The image you want to make into a macOS ICNS file
#Make sure there is an alpha layer or the iconutil command will fail
orig=$1
mkdir icon.iconset
# resize all the images
sips -z 16 16 $orig --out icon.iconset/icon_16x16.png
sips -z 32 32 $orig --out icon.iconset/icon_16x16@2x.png
sips -z 32 32 $orig --out icon.iconset/icon_32x32.png
sips -z 64 64 $orig --out icon.iconset/icon_32x32@2x.png
@LockeBirdsey
LockeBirdsey / prepareVideoForSocialMedia.sh
Created January 31, 2020 09:12
Prepare Video for Byte/IG Story/etc
#!/bin/bash
#Quick and dirty way to get a video ready for byte or instagram or other
#These are usually in a ratio of 9:16, as opposed to usual viewing of 16:9
#Requires: ffprobe, ffmpeg
#Example usages:
# 1)
# sh prepareVideoForSocialMedia.sh someStream.mp4 00:01:45 6 510
# 2)
@LockeBirdsey
LockeBirdsey / .vimrc
Created September 9, 2016 04:39
super basic vimrc
set nu
syn on
set tabstop=4
set softtabstop=4
set ruler
set visualbell
set so=7
set showmatch
set ai
set si