Skip to content

Instantly share code, notes, and snippets.

View ayyybe's full-sized avatar
life, lemons, etc.

Ibrahim Ahmed ayyybe

life, lemons, etc.
  • Bellingham, WA
View GitHub Profile
ayyybe /
Last active July 4, 2023 06:52
rust cpal + dasp + channel = realtime audio processing
// live recording and realtime resampling of any input to 16kHz mono for whisper
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
use dasp::{interpolate::sinc::Sinc, ring_buffer, signal, Frame, Signal};
use std::{sync::mpsc, thread};
fn get_voicemeeter_input_device(host: &cpal::Host) -> cpal::Device {
.expect("Failed to get input devices")
.find(|device| {
ayyybe /
Last active June 5, 2023 00:24
wsl2 + docker desktop tomfoolery

Update WSL (to use "store version" features) without the Microsoft Store:

  1. Download the latest WSL app package release:
  2. wsl --shutdown
  3. Add-AppxPackage Microsoft.WSL_1.2.5.0_x64_ARM64.msixbundle

Optionally, reboot before and/or after installing the package if features aren't working properly (not required for --mount, maybe required for WSLg)

Attach bare vhdx disk (useful for formatting to ext4)

ayyybe / vars-playground.swift
Created October 4, 2020 07:55
var parse thing
import Cocoa
var vars = [
"AdobeCommon": "/Library/Application Support/Adobe",
"df": "shouldn't get replaced",
"durq": "wurqd!",
"AdobeProgramFiles": "/Applications"
func parseVars(_ str: String) -> String {
ayyybe /
Last active September 23, 2021 00:22
download & reconstruct a local copy of hosted EPUBs (to download online textbooks, etc.)
#!/usr/bin/env python3
import os
import shutil
import zipfile
import tempfile
import readline # input gets limited to 1024 characters for some reason if this isn't imported (macos only?)
except ImportError:
import urllib.request
ayyybe / dpc-game-stub.c
Last active August 16, 2020 08:03
A small Cocoa app written purely in C using the objc runtime (part of a scrapped project)
// compile with
// clang main.c -framework Cocoa
#include <ApplicationServices/ApplicationServices.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreGraphics/CoreGraphics.h>
#include <objc/runtime.h>
#include <objc/message.h>
#include <stdio.h>
ayyybe / ccdl.command
Last active May 20, 2024 22:48
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
ayyybe /
Last active July 21, 2022 19:33
extract zip keeping permissions & symlinks intact
import zipfile
import os
import stat
def extract_file(zf, info, extract_dir):
out_path = os.path.join(extract_dir, info.filename)
perm = info.external_attr >> 16
if (stat.S_ISLNK(perm)):
src =