Skip to content

Instantly share code, notes, and snippets.

View Kequc's full-sized avatar

Kequc

View GitHub Profile
extends Node
enum TERRAIN_SHAPE { NONE, FLAT, PEAK, DROP, SLANT }
const QUAD_UVS: = PoolVector2Array([Vector2(0, 0), Vector2(1, 0), Vector2(1, 1), Vector2(0, 1)])
@Kequc
Kequc / fix-dts.ts
Created October 4, 2025 21:50
Fix build output of tsc .d.ts files when written with valid ecmascript.
import { readdir, readFile, writeFile } from 'node:fs/promises';
import { join } from 'node:path';
async function walk(dir: string) {
for (const e of await readdir(dir, { withFileTypes: true })) {
const p = join(dir, e.name);
if (e.isDirectory()) {
await walk(p);
} else if (e.isFile() && p.endsWith('.d.ts')) {
const src = await readFile(p, 'utf8');
@Kequc
Kequc / print-weekly-surprise.py
Last active October 21, 2025 16:36
Generate random things and print them once a week
#!/usr/bin/env python3
import os, io, json, random, datetime, subprocess, ssl, urllib.request
from PIL import Image, ImageDraw, ImageFont
# ---------------- CONFIG ----------------
DPI = 300
PAPER = os.getenv("PAPER", "A4").upper() # 'A4' or 'LETTER'
def mm_px(mm): return round(mm / 25.4 * DPI)