Skip to content

Instantly share code, notes, and snippets.

View gliggy's full-sized avatar
🐿️
squirrel

Leo Fitzpatrick gliggy

🐿️
squirrel
View GitHub Profile
@amcolash
amcolash / convert.py
Last active May 19, 2021 15:11
Python script to convert images for "The World's Worst Video Card" by Ben Eater
from PIL import Image
import struct
# Options to set up
file = "iceland.jpg"
dither = True
showPreview = True
# Palette code based off of https://stackoverflow.com/a/29438149/2303432
@gullyn
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@bmcculley
bmcculley / dummy-web-server.py
Last active November 17, 2022 04:02 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python (2/3). Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@tuxmartin
tuxmartin / v4l.sh
Last active April 26, 2022 14:31
Create fake /dev/videoX device from video file
# mozna neni potreba: sudo apt-get install linux-generic
sudo apt-get install v4l2loopback-dkms
sudo modprobe v4l2loopback
modprobe v4l2loopback
ffmpeg -i /home/martin/Downloads/video.mp4 -f v4l2 -vcodec rawvideo /dev/video0
ffmpeg -i rtsp://10.104.103.138/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp -f v4l2 -pix_fmt yuv420p -vcodec rawvideo /dev/video0
@vihanb
vihanb / downgoat1.jpg
Last active January 1, 2021 13:30
DowngoatUpgoatDowngoatUpgoat
downgoat1.jpg
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active April 15, 2024 14:27
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request: