Skip to content

Instantly share code, notes, and snippets.

View amaanq's full-sized avatar
Never stop improving

Amaan Qureshi amaanq

Never stop improving
  • New York, NY
View GitHub Profile
@amaanq
amaanq / fast-switch.c
Last active September 14, 2025 21:31
Fast Workspace Switching on Darwin
// clang -framework CoreGraphics -framework CoreFoundation <file>
#include <CoreGraphics/CoreGraphics.h>
#include <unistd.h>
#define FLOAT_MIN 1.401298464324817e-45
void workingSpaceSwitch(int direction) {
double magnitude = direction == 0 ? -2.25 : 2.25;
double gestureValue = 200.0 * magnitude;
@amaanq
amaanq / cmd.sh
Last active March 9, 2024 05:51
compile_commands.json for wasm ts
emcc binding.c -I../src -I../include -MJ compile_commands.json
@amaanq
amaanq / fuzz.sh
Created August 8, 2023 20:05
XML Grammar Fuzzer
#!/usr/bin/env sh
set -eu
ROOT_DIR="fuzzer"
# XXX: ensure shift below is consistent with number of args here
LANG=$1
TIMEOUT=$2
MAX_TOTAL_TIME=$3
@amaanq
amaanq / table.md
Last active March 11, 2023 07:22
Neovim-Helix Tree-Sitter Query Comparison Table

Legend:

H - highlights.scm

F - folds.scm

I - indents.scm

N - injections.scm

@amaanq
amaanq / steam_sys_info.txt
Last active October 3, 2022 20:58
Steam System Information
Computer Information:
Manufacturer: Gigabyte Technology Co., Ltd.
Model: X570 AORUS MASTER
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 9 3900X 12-Core Processor
CPU Family: 0x17
@amaanq
amaanq / comports.txt
Last active May 26, 2022 19:06
Correlating Linux /dev devices/serial ports to Windows COM Ports
Well, I never thought such a thing even existed, but here we are. A certain GNSS receiver uses software that is only on Windows.
Now, this Windows software is horrendous and I don't have time to reverse or program my own FOSS version for Linux.
So, it hooks to the device by you manually selecting its COM Port. Wow, I would've thought we're able to automatically detect this in the software but I guess not.
Now the issue is, how in the world can you select the right COM Port in Windows if you're using WINE like I am to run this software??
Well it's quite simple, but there isn't any real and clear guide on doing exactly this, I mangled my way around digging through articles on semi-relateed but not clear topics (like how devices are organized in WINE)
So to make it simple for anyone reading this, ensure your device is plugged in and shows up in lspci or lsusb.
Next, run ls -lah /dev/tty* to find your device. GPS receviers tend to be under /dev/ttyACM0 (or 1, 2 etc depending on how many you have plugged in) b