Skip to content

Instantly share code, notes, and snippets.

View zgracem's full-sized avatar

Amy Grace zgracem

  • ᐄᐧᐦᑫᐧᐣᑑᐃᐧᐣ
View GitHub Profile
@zgracem
zgracem / prose_time_span.rb
Created March 30, 2025 04:25
Print a human-readable string for the interval between two times
require "time"
class ProseTimeSpan
def initialize(time1, time2 = Time.now)
@begin, @end = [time1, time2].map { Time.parse(it.to_s) }.sort
end
def to_i
@end - @begin
end
@zgracem
zgracem / distributor-logo-steamdeck-oled.svg
Created January 13, 2024 14:52
Replacement icon for the Application Menu on Steam Deck OLED
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zgracem
zgracem / AddNoiseLayer.scpt
Created November 11, 2023 17:46
AppleScript to add a layer of random noise to an Acorn document
set blankPixel to «data TPIC00000A0000000000000000000100010020280000000000»
tell application "Acorn"
tell front document
try
set the oldClipboard to (get the clipboard)
on error msg number -1700
set the oldClipboard to the blankPixel
end try
try
@zgracem
zgracem / fix-skyrim-missing-sounds.md
Created March 7, 2021 17:43
Fixing missing sounds in Skyrim SE (Windows 10 + Boot Camp)

Problem: Skyrim Special Edition + Windows 10 + Boot Camp works normally, but many sounds (music, player voice/dragon shouts, weapon drawing/attacking, etc.) are missing. Any sounds added by third-party mods are similarly silent.

Cause: An obscure bug in Skyrim SE that expects the game data (including sound) to be stored on a volume with a Master Boot Record (MBR). Boot Camp drives, however, must be GUID-formatted.

Solution: Create a virtual MBR volume and run the game from there.

@zgracem
zgracem / fix-skyrim-dark-face-npc-bug.md
Last active August 20, 2026 19:30
Fixing the "dark face" NPC bug in Skyrim SE
created 2021-03-04
updated 2024-05-19

Fixing the "dark face" bug in Skyrim SE

Important

This document is obsolete! Use Face Discoloration Fix SE instead.

@zgracem
zgracem / nethack_phase_of_the_moon.rb
Created September 27, 2018 14:26
Calculating the phase of the moon in Ruby, based on NetHack's source code
### Based on NetHack's phase_of_the_moon()
# > http://nethack.wikia.com/wiki/Hacklib.c#phase_of_the_moon
### See also:
# > https://en.wikipedia.org/wiki/Epact
# > https://en.wikipedia.org/wiki/Golden_number_(time)
# > https://en.wikipedia.org/wiki/Metonic_cycle
# > https://en.wikipedia.org/wiki/Computus
def phase(lt = Time.now)
# The solar year is about 365¼ days, while the lunar month is slightly longer
@zgracem
zgracem / ao3-ratings.css
Created September 22, 2018 19:32
Add ratings icons to AO3
dd.rating a::before {
color: #fff;
padding: 0 1ex;
margin-right: 1ex;
border-radius: 0.333ex;
}
dd.rating a[href="/tags/General%20Audiences/works"]::before {
content: "G";
background: #78a700;