Skip to content

Instantly share code, notes, and snippets.

@MarkJeronimus
MarkJeronimus / gist:b0b3eb1f59c0f0efd1525f439c01b2e9
Last active April 6, 2025 10:14
Converting sRGB to HCI and back
Notes on this Java snippet:
- I left out 'Math.' because it's boilerplate/noise
- Color3f is a simple read/write container where the components are float instead of int
- Implementation of 'fromSRGB' and 'toSRGB' should be straightforward
- Uses tab characters for initial indentation, continues with space characters for vertical alignment purposes
// HCI /////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* This color space is a hexagonal bipyramid with the grays at the central axis
@MarkJeronimus
MarkJeronimus / HTMLUtilities.java
Last active July 9, 2020 15:02
HTML Un-escaper by Nick Frolov, with improvement suggested by Axel Dörfler.
import java.util.HashMap;
/**
* HTML Un-escaper by Nick Frolov.
* <p>
* With improvement suggested by Axel Dörfler.
* <p>
* Replaced character map with HTML5 characters from<a href="https://www.w3schools.com/charsets/ref_html_entities_a.asp">
* https://www.w3schools.com/charsets/ref_html_entities_a.asp</a>
*
@MarkJeronimus
MarkJeronimus / set-non-totalistic-vonNeumann-rule.py
Last active June 8, 2020 20:42
set-non-totalistic-vonNeumann-rule.py
import golly as g
from glife import *
napkinLetters=[' ', 'c', 'e', 'k', 'a', 'i', 'n', 'y', 'q', 'j', 'r', 't', 'w', 'z']
mooreParts = ["0 ", \
"1e", \
"2e", \
"2i", \
"3e", \