Skip to content

Instantly share code, notes, and snippets.

@TexZK
TexZK / LZSS.C
Last active July 31, 2025 18:45
Almost verbatim Python 3.8 port of LZSS.C by Haruhiko Okumura
/**************************************************************
LZSS.C -- A Data Compression Program
(tab = 4 spaces)
***************************************************************
4/6/1989 Haruhiko Okumura
Use, distribute, and modify this program freely.
Please send me your improved versions.
PC-VAN SCIENCE
NIFTY-Serve PAF01022
CompuServe 74050,1022
@TexZK
TexZK / rle8bit.py
Last active August 1, 2025 20:13
Naive 8-bit RLE compression codec
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@TexZK
TexZK / gf2.py
Last active October 20, 2024 19:02
GF(2) dummy code
#!/usr/bin/python3
def bits(x: int) -> int:
x = int(x)
assert x >= 0
n = 0
while x:
x >>= 1
n += 1
@TexZK
TexZK / hamming84.py
Last active February 15, 2020 17:40
Simple library for hamming(8,4) codec
# Copyright (c) 2019-2020, Andrea Zoppi.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
@TexZK
TexZK / extract_exif_gps.py
Created April 2, 2018 11:38 — forked from urschrei/extract_exif_gps.py
Extract GPS data from jpg files, and write it to a CSV. Requires the PIL. Tested (haha) on Python 2.7.x
"""
Extract GPS coordinates and filename, output to CSV file
Run this file from the same directory the images are in
run using ./process_exif.py or python process_exif.py, or
%run process_exif.py from an IPython instance
Ensure you have PIL installed
refer to http://www.exiv2.org/tags.html for a full detailed tag listing
This is what the GPSInfo dict looks like for an iPhone 5 jpg: