Skip to content

Instantly share code, notes, and snippets.

View Azarattum's full-sized avatar
💭
Hello World

Azarattum Azarattum

💭
Hello World
View GitHub Profile
@Azarattum
Azarattum / badapply.py
Created April 23, 2026 08:55
Bad Apple frames to keyboard encoded data generator
from PIL import Image
frames = 1754
out = []
for frame in range(1, frames):
im = Image.open(f'frames/output_{frame:04}.png')
im_out = Image.new(mode="RGB", size=im.size)
@Azarattum
Azarattum / fish.html
Created September 29, 2024 05:52
Demo of interactive 3D fish in 717 bytes.
<style>*{margin:0</style><canvas id="c"><script>c.width=innerWidth,c.height=innerHeight;let t,e=c.getContext("2d"),a=Math.sin,f=Math.cos,n=Math.PI,i=Math.atan2,r=fy=fa=v=2;addEventListener("pointermove",e=>t=e);let l=new DOMMatrix;l.m11=l.m22=290,l.m34=-1,l.m43=30,l.m44=-30,function o(h){if(t){e.clearRect(0,0,c.width,c.height);let o=i(fy-t.y,r-t.x);fa+=i(a(o-fa),f(o-fa))/10,r-=f(fa)*v,fy-=a(fa)*v;let m=l.rotate(0,0,fa/(2*n)*360);for(let t=0;t<360;t+=10)for(let i=0;i<2*n;i+=.05){let{x:l,y:o,w:c}=m.translate(0,0,a(h/100+Math.abs(i-n))).rotateSelf(t,0,0).scaleSelf(1,.5,1).transformPoint({x:10*(f(i)-a(i)**2/Math.sqrt(2)),y:a(2*i)/2*10});e.fillRect((l-r)/c+r,(o-fy)/c+fy,2,2)}}requestAnimationFrame(o)}()</script>