Skip to content

Instantly share code, notes, and snippets.

@tux-peng
tux-peng / crayola120.py
Created April 11, 2026 01:34
Add letters, numbers and all 120 colours from crayola's 1996 box to classicube
from PIL import Image, ImageDraw, ImageFont
# The 120 Crayola colors mapped to their standard hex values
CRAYOLA_COLORS = {
# Reds & pinks
"Almond": "#EFDECD", "Apricot": "#FDD9B5", "Bittersweet": "#FD7C6E", "Blush": "#DE5D83",
"Brick Red": "#CB4154", "Carnation Pink": "#FFAACC", "Cerise": "#DD4492", "Chestnut": "#BC5D58",
"Jazzberry Jam": "#CA3767", "Mahogany": "#CD4A4C", "Mango Tango": "#FF8243", "Mauvelous": "#EF98AA",
"Melon": "#FDBCB4", "Peach": "#FFCBA4", "Pink Flamingo": "#FC74FD", "Pink Sherbert": "#F78FA7",
"Radical Red": "#FF496C", "Razzmatazz": "#E3256B", "Red": "#EE204D", "Salmon": "#FF9BAA",
@tux-peng
tux-peng / custom120.py
Created April 11, 2026 01:29
Create a customblocks.json for use with my crayola120.py and go server
import json
from PIL import Image
# The 120 Crayola colors mapped to their standard hex values
CRAYOLA_COLORS = {
# Reds & pinks
"Almond": "#EFDECD", "Apricot": "#FDD9B5", "Bittersweet": "#FD7C6E", "Blush": "#DE5D83",
"Brick Red": "#CB4154", "Carnation Pink": "#FFAACC", "Cerise": "#DD4492", "Chestnut": "#BC5D58",
"Jazzberry Jam": "#CA3767", "Mahogany": "#CD4A4C", "Mango Tango": "#FF8243", "Mauvelous": "#EF98AA",
"Melon": "#FDBCB4", "Peach": "#FFCBA4", "Pink Flamingo": "#FC74FD", "Pink Sherbert": "#F78FA7",
@tux-peng
tux-peng / custom.py
Last active April 2, 2026 02:12
Create a customblocks.json for use with my crayola.py and go server
import json
from PIL import Image
# The 64 Crayola colors
CRAYOLA_COLORS = {
"Apricot": "#FDD9B5", "Asparagus": "#87A96B", "Bittersweet": "#FD7C6E", "Black": "#000000",
"Blizzard Blue": "#ACE5EE", "Blue": "#1F75FE", "Blue Green": "#0D98BA", "Blue Violet": "#7366BD",
"Brick Red": "#CB4154", "Brown": "#B4674D", "Burnt Sienna": "#EA7E5D", "Cadet Blue": "#B0B7C6",
"Carnation Pink": "#FFAACC", "Cerulean": "#1DACD6", "Denim": "#2B6CC4", "Forest Green": "#6DAE81",
"Fuchsia": "#C364C5", "Gold": "#E7C697", "Goldenrod": "#FCD975", "Granny Smith Apple": "#A8E4A0",
@tux-peng
tux-peng / crayola.py
Created April 2, 2026 00:41
crayola classicube
from PIL import Image, ImageDraw, ImageFont
# The 64 Crayola colors mapped to their standard hex values
CRAYOLA_COLORS = {
"Apricot": "#FDD9B5", "Asparagus": "#87A96B", "Bittersweet": "#FD7C6E", "Black": "#000000",
"Blizzard Blue": "#ACE5EE", "Blue": "#1F75FE", "Blue Green": "#0D98BA", "Blue Violet": "#7366BD",
"Brick Red": "#CB4154", "Brown": "#B4674D", "Burnt Sienna": "#EA7E5D", "Cadet Blue": "#B0B7C6",
"Carnation Pink": "#FFAACC", "Cerulean": "#1DACD6", "Denim": "#2B6CC4", "Forest Green": "#6DAE81",
"Fuchsia": "#C364C5", "Gold": "#E7C697", "Goldenrod": "#FCD975", "Granny Smith Apple": "#A8E4A0",
"Gray": "#95918C", "Green": "#1CAC78", "Green Yellow": "#F0E891", "Hot Magenta": "#FF1DCE",
@tux-peng
tux-peng / notepad.py
Created February 13, 2026 22:53
Tkinter, notepad. This script includes the core features: a text area, a menu bar (File/Edit/Help), and basic file operations (Open, Save, Exit).
import tkinter as tk
from tkinter import filedialog, messagebox
class Notepad:
def __init__(self, root):
self.root = root
self.root.title("Untitled - Notepad Clone")
self.root.geometry("800x600")
# Create the main text area
@tux-peng
tux-peng / convert_m4b.sh
Created February 13, 2026 01:43
convert m4b chapters to mp3, vorbis, opus or speex
#!/bin/bash
#convert_m4b.sh book.m4b --(mp3|opus|vorbis|speex)
# 1. Parse Arguments
input_file=""
format="mp3" # Default format
for arg in "$@"; do
case "$arg" in