Skip to content

Instantly share code, notes, and snippets.


  • Germany
Block or report user

Report or block sfan5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sfan5 /
Last active May 28, 2016
Creates an APNG from PNGs (all PNGs need to have the same IHDR checksum for this to work)
#!/usr/bin/env python
import sys
import struct
import binascii
def mkchunk(tp, data):
return struct.pack("!L", len(data)) + tp + data + struct.pack("!L", binascii.crc32(tp + data) & 0xffffffff)
def getchunk(f, tp):
sfan5 /
Created Nov 28, 2013
Makes each PNG only show the difference to the previous ones pasted on top of eachother
#!/usr/bin/env python
import sys
from PIL import Image
def rgb_rgba_cmp(a, b):
if a[0] != b[0]:
return False
if a[1] != b[1]:
return False
if a[2] != b[2]:
sfan5 / Makefile
Last active Dec 1, 2016
A small python wrapper for xbrz
View Makefile
#You may have to tweak some things here
CC = gcc
CXX = g++
FLAGS = -I/usr/include/python2.7
#Do not change anything beyond this point
CXXFLAGS += -std=c++11
sfan5 /
Created Jan 6, 2014
Tools to work with .cpbitmap files
#!/usr/bin/env python2
from PIL import Image
import sys
import struct
def r8(f):
return ord(
if len(sys.argv) <= 2:
print("Usage: %s <input> <output>" % sys.argv[0])
sfan5 /
Last active Nov 28, 2018
Builds ffmpeg with many libraries; easily configurable; can build mpv too
set -e
if [ ! -f $ffbuild_conf ]; then
mkdir -p $(dirname "$ffbuild_conf")
cat <<MEOW >"$ffbuild_conf"
# This file contains settings for the build script
sfan5 /
Created Feb 15, 2014
Adds a bumpmap-like effect to images (works best on low-res [~16x16] textures).
#!/usr/bin/env python
import sys
from PIL import Image
FCT = 8
def diff2(a, b):
return abs(a-b)
def avg3(a, b, c, d=0):
sfan5 /
Created Mar 12, 2014
Generates an image with an EAN-8 barcode
#!/usr/bin/env python
from PIL import Image
import sys
l_code = {
0: '0001101',
1: '0011001',
2: '0010011',
3: '0111101',
4: '0100011',
sfan5 / packetgen.cpp
Last active Aug 29, 2015
does stuff using C++
View packetgen.cpp
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <list>
#include <utility>
#include <stdlib.h> // for exit()
#include <vector>
template <typename T, typename U> class create_map {
sfan5 / controlfilegen.html
Last active Jan 18, 2018
Various tools for managing Cydia repositories & packages
View controlfilegen.html
<title>Cydia package control file Generator</title>
<style type="text/css">
* {
font-family: sans-serif;
input {
border-radius: 6px;
sfan5 / run-as.c
Last active Aug 29, 2015
A simple Android run-as replacement when the preinstalled one won't work (I'm looking at you Android 4.2)
View run-as.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <stdarg.h>
#include <stdbool.h>
// Link this with a from your Android device
You can’t perform that action at this time.