Skip to content

Instantly share code, notes, and snippets.

View ashafq's full-sized avatar

Ayan Shafqat ashafq

View GitHub Profile
@ashafq
ashafq / decoder.py
Created June 18, 2023 02:11
KCS Decoder
#!/usr/bin/env python
"""A simple KCS decoder
Copyright (c) 2023 Ayan Shafat <ayan.x.shafqat@gmail.com>
"""
from sys import argv, stdout
import numpy as np
import scipy.io.wavfile as wav
@ashafq
ashafq / enterprise.c
Last active October 29, 2023 17:54
Enterprise C
__attribute__((section(".text")))
const char fun_impl[] =
"\x8eGlsbVdoZEV3cGw="
"R2xhZEkgQ2FuIEg="
"\x8d\x04\x37\xc3"
"ZWxwIHlvdSBvdXQ="
"VGhpcyBpcyBBU0N="
"SUkgQXJ0ISAgICA=";
typedef int (*fun_t)(int, int);
@ashafq
ashafq / eq-bench.cc
Created November 14, 2023 03:59
A5EQ Benchmark code
/* To build this file:
* >> apt install libbenchmark-dev
*
* >> g++ -Wall -Wextra -O3 -mfma -o eq-bench eq-bench.cc \
* `pkg-config --cflags --libs benchmark`
* >> ./eq-bench
*/
/*
@ashafq
ashafq / x1.c
Created February 20, 2025 00:22
Biquad Crossover Filter
/*
* Copyright (C) 2025 Ayan Shafqat <ayan.x.shafqat@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@ashafq
ashafq / haar.c
Created March 14, 2025 18:29
Haar Wavelet Transform, In-place
/**
* Copyright (c) 2025 Ayan Shafqat <ayan@shafq.at>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ashafq
ashafq / duckdns.go
Last active October 26, 2025 13:53
/**
* The MIT License (MIT)
*
* Copyright (c) 2025 Colahall, LLC.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is