Skip to content

Instantly share code, notes, and snippets.

View pushfoo's full-sized avatar

Paul pushfoo

  • Freelance, open to full-time
  • USA
View GitHub Profile
@pushfoo
pushfoo / pyglet_2_0_color_setter_crash.py
Created October 24, 2023 02:13
Replication code for a pyglet crash involving RGB colors & underlines
import pyglet
COLOR = (255, 255, 255, 255) # RGB values will crash the code
LINE_HEIGHT_PX=40
FONT_SIZE_PT=20
TEXT="Test"
TAG='b' # u sets it off, but b does not
def html(tag, contents):
return f"<{tag}>{contents}</{tag}>"
@pushfoo
pushfoo / tagtable.py
Last active May 26, 2020 08:21
Part of a rejected refactor for prayer, a creatures PRAY library
"""
Part of a refactor of prayer (https://github.com/Creatures-Developer-Network/prayer)
Initially rejected for being too radical a change.
This approach might not be the best for final use. The main goals were:
1. always know the size it would take up when written so we can write directly to streams instead of caching & copying
2. try to provide a path toward a nested object structure
"""
class TagTable(MutableMapping):