Skip to content

Instantly share code, notes, and snippets.

@logiclrd
logiclrd / ramanuj.py
Created August 22, 2026 17:15
Quick Python hack-up of one of Ramanujan's pi formulae
from mpmath import *
mp.dps = 500
mp.pretty = False
coeff = fdiv(1, fmul(882, sqrt(fadd(fmul(6, sqrt(2)), 1))))
for i in range(0, 5):
s = 0
@logiclrd
logiclrd / stargato.svg
Last active July 19, 2026 13:07
Star Gato
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@logiclrd
logiclrd / VARPTR.BAS
Last active June 26, 2026 15:05
C64 VARPTR
10 dim r%(25)
11 input "index"; y%
12 input "value"; r%(y%)
13 print "okay, r("; y%; ") has been set to "; r%(y%)
20 x$ = "r": rem the other parameter is y%, already populated
21 gosub 90: print "return value: varptr("; x$; "("; y%; ")) = "; vp
22 if vp < 0 then goto 27
23 print "reading element "; x$; "("; y%; ") directly"
24 print "from memory:"
@logiclrd
logiclrd / anti2.bas
Last active June 22, 2026 23:24
Deobfuscated ZX Spectrum BASIC fractal code
11 BORDER 0: PAPER 0: INK 5: CLS
12 LET du=2.25/255
13 LET dv=2.3/175
14 LET u=-1.6
15 FOR x=0 TO 254
16 LET v=dv
17 FOR y=0 TO 87
18 LET o=0: LET d=0
19 LET uu=0: LET vv=0
20 FOR k=0 TO 16
@logiclrd
logiclrd / primitives.scad
Created November 26, 2024 16:13
Useful OpenSCAD Primitives
module sector(radius, angle)
{
fn = ($fn <= 0) ? 20 : $fn;
polygon(
[
[0, 0],
for (i = [0 : fn])
let (a = i * angle / fn)
[radius * cos(a), radius * sin(a)]
@logiclrd
logiclrd / ffmpeg film grain
Last active August 1, 2025 17:00
FFmpeg: Ultimate film grain
ffmpeg -i "HD Splice 1080p No Grain.mkv" -i "HD Splice 1080p No Grain.mkv" -filter_complex "
color=black:d=3006.57:s=3840x2160:r=24000/1001,
geq=lum_expr=random(1)*256:cb=128:cr=128,
deflate=threshold0=15,
dilation=threshold0=10,
eq=contrast=3,
scale=1920x1080 [n];
[0] eq=saturation=0,geq=lum='0.15*(182-abs(75-lum(X,Y)))':cb=128:cr=128 [o];
[n][o] blend=c0_mode=multiply,negate [a];
color=c=black:d=3006.57:s=1920x1080:r=24000/1001 [b];