Skip to content

Instantly share code, notes, and snippets.

@idwpan
idwpan / tap_tempo.ino
Created April 22, 2025 17:06
Arduino Digital Tempo Controller
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// --- LCD Setup ---
LiquidCrystal_I2C lcd(0x27, 20, 4); // 20x4 LCD at address 0x27
// --- Pins ---
const int ENC_CLK = 2; // Encoder A (interrupt)
const int ENC_DT = 3; // Encoder B
const int ENC_SW = 10; // Encoder push button
@idwpan
idwpan / update_qbit_port_protonvpn.ps1
Last active March 26, 2025 12:57
PowerShell script to auto update the qBittorrent listening port when ProtonVPN is connected
########################################################################################################################
# Script to Synchronize qBittorrent Listening Port with ProtonVPN assigned port on Windows.
#
# Description:
# This PowerShell script automates the synchronization of qBittorrent's listening port with the
# port number assigned by ProtonVPN's port forwarding feature. It continuously monitors the
# system to check if ProtonVPN is connected and if qBittorrent is running. When both conditions
# are met, it retrieves the latest port number from ProtonVPN's notifications and updates
# qBittorrent's listening port via its Web API if there's a mismatch.
#
@idwpan
idwpan / snake.c
Last active March 21, 2021 21:11
Snake code
#include <ncurses.h>
#include <stdio.h>
int xPOS, yPOS;
void usleep(int i);
const char splashScreen[] =
" .o88b. d8b db .d8b. db dD d88888b \nd8P Y8 888o 88 d8' `8b 88 ,8P' 88' \n8P 88V8o 88 88ooo88 88,8P 88ooooo \n8b 88 V8o88 88~~~88 88`8b 88~~~~~ \nY8b d8 88 V888 88 88 88 `88. 88. \n `Y88P' VP V8P YP YP YP YD Y88888P ";
const char prompt[] = "Press any key to start.";