Skip to content

Instantly share code, notes, and snippets.

Avatar
😅
Busy AF

Wouterr0

😅
Busy AF
  • Amsterdam, Netherlands
View GitHub Profile
View plot2d.py
import matplotlib.pyplot as plt
import numpy as np
min = -5
max = 5
step = .1
width = (max-min)/step
fx0 = lambda x, y: abs(x) + abs(y)
@Wouterr0
Wouterr0 / png_parser.py
Created Oct 23, 2021
Python PNG parser
View png_parser.py
# PNG spec http://www.libpng.org/pub/png/spec/1.2/png-1.2-pdg.html
import argparse
import binascii
import struct
from typing import cast
parser = argparse.ArgumentParser(prog="png_parse",
description="Parse a PNG file and show the file information",
epilog="See http://www.libpng.org/pub/png/spec/1.2/png-1.2-pdg.html for the PNG spec")
@Wouterr0
Wouterr0 / hexdump.c
Last active Oct 23, 2021
Hexdump file to stdout
View hexdump.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
#include <math.h>
#define STR_HELPER(x) #x