Skip to content

Instantly share code, notes, and snippets.

View Sasszem's full-sized avatar
💥
Burning the dynamite at both ends

László Baráth Sasszem

💥
Burning the dynamite at both ends
  • Szolnok, Hungary
View GitHub Profile
@Sasszem
Sasszem / bf2c.py
Created September 10, 2021 20:36
Optimizing bf2c compiler in python. Possibly not 100% working. Gave up on fixing cuz' I got bored on it.
from dataclasses import dataclass, field, replace
import typing
from collections.abc import Iterator
from enum import Enum
from collections import defaultdict
#######################################
# Base classes for storing operations #
#######################################
@Sasszem
Sasszem / image_mixer.py
Created December 10, 2021 16:21
Create "fake-preview" images (similar to this one: https://www.reddit.com/r/rickroll/comments/ls99p2/wheres_waldo/). Requires the Pillow package!
import struct
import zlib
from PIL import Image
import click
import io
GAMMA = 0.08
DESAT_RATE = 0.4
################################################################################

Rescue Rover (shareware) maps

Map images of the game "Rescue Rover (1991)"

Used GIMP and Tiled to create the map images. Tile images were extracted via screenshoting DosBox. Used the game version from PlayDosGames. Map images and TILED files included.

@Sasszem
Sasszem / libhackrf_tx_fm_triangle.c
Created December 18, 2022 09:13
Transmit a 440Hz triangle wave through FM using the libhackrf API
#include <libhackrf/hackrf.h>
#include <math.h>
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <complex.h>
#include <stdint.h>
const double f_mod = 440;
const uint64_t sample_rate = 10000000;
@Sasszem
Sasszem / cwgen.cpp
Created November 10, 2024 23:05
Generate a CW signal on a HackRF One with set frequency and gain settings
#include <cstdio>
#include <cstring>
extern "C" {
#include <libhackrf/hackrf.h>
}
#include <pthread.h>
#include <unistd.h>
#include <complex>
#include <cstdint>
#include <numbers>