Skip to content

Instantly share code, notes, and snippets.

@s5bug
s5bug / kh2vm_notes.txt
Last active December 26, 2023 04:14
Kingdom Hearts 2 AI VM Language notes
???? ???? ???? 0000:
[TODO: document special cases related to Xemnas]
???? ???? ??0? 0000:
???? ???? ??00 0000 iiii iiii iiii iiii iiii iiii iiii iiii:
load immediate INT
push to TP
???? ???? ??01 0000 ffff ffff ffff ffff ffff ffff ffff ffff:
load immediate FLOAT
push to TP
iiii iiii ii1m 0000 oooo oooo oooo oooo:
@s5bug
s5bug / note.md
Created September 9, 2023 10:26
Inclusive Volume Spell (HexCasting)

High-level Immutable Algorithm

val volumeWithin: (Vec3, Vec3) -> List[Vec3] = (a: Vec3, b: Vec3) -> {
  val Vec3(ax, ay, az) = a
  val Vec3(bx, by, bz) = b
  
  val (minX, maxX) =
    if(ax <= bx) (ax, bx)
    else (bx, ax)
@mmha
mmha / formula.sh
Created September 13, 2016 22:06
Render Latex and copy the image into the clipboard
#!/bin/sh
TEMPDIR=`mktemp -d --tmpdir=/tmp`
CURDIR=`pwd`
cd $TEMPDIR
echo "\documentclass[convert]{standalone}\begin{document}" > src.tex
echo $1 >> src.tex
echo "\end{document}" >> src.tex
pdflatex -shell-escape src.tex > /dev/null
cat src.png | xclip -selection c -t image/png