Skip to content

Instantly share code, notes, and snippets.

View maxstepanyuk's full-sized avatar
418 I'm a teapot

Maksym Stepaniuk - aka purpexe maxstepanyuk

418 I'm a teapot
View GitHub Profile
@ravarcheon
ravarcheon / spectralRotation.py
Last active September 22, 2025 11:00
rotates an audio file by 90 degrees in the spectrum while being a reversible process with minimal loss (only floating point errors which are like -150 dB but thats literally silence ahaha~)
import numpy as np
import soundfile as sf
from scipy.fftpack import fft, ifft
def rotateSignal(signal,flip):
if flip:
signal = signal[::-1]
x = np.concatenate((signal, signal[1:][::-1])) # concatenating the array with a reverse of itself makes it such that the fourier transform doesn't layer over a reversed version of itself in the inverse fft
rotSig = ifft(x)
@jsmsalt
jsmsalt / seeding.py
Last active November 5, 2025 20:58
Seeding data to database using SQLAlchemy and FastAPI
# The simplest solution I found is to set up an event for each table that executes a method after the table is created.
# Database initial data
INITIAL_DATA = {
'users': [
{
'username': 'superuser',
'email': 'superuser@example.com',
'hashed_password': hash_password('123')