Skip to content

Instantly share code, notes, and snippets.

View CSonTi04's full-sized avatar

András Tóth CSonTi04

View GitHub Profile
@CSonTi04
CSonTi04 / wifi-stick-switch.ps1
Last active March 10, 2026 19:34
Automatically waits for the USB Wi-Fi adapter’s fake driver CD to appear and ejects it so the device switches into Wi-Fi mode.
# This script waits for the USB Wi-Fi adapter's installer drive to appear
# (the fake driver CD that the device exposes when plugged in). Once detected,
# it automatically ejects the drive so the device re-enumerates as a Wi-Fi adapter.
# Intended to run at startup to make the adapter usable without manual intervention.
param(
[string]$VolumeLabel = "MERCUSYS",
[int]$TimeoutSeconds = 60
)
Write-Host "Waiting for USB installer drive with label '$VolumeLabel'..."
@CSonTi04
CSonTi04 / anxius.ino
Last active February 28, 2026 10:49
ESP32 “emotional” LED sculpture: 8 LEDs via PCF8574 + touch + BLE presence. Models arousal/anxiety/affection and shifts between Idle/Excited/Anxious/Friendly patterns. BLE scan runs in its own task so LEDs stay smooth.
#include <Wire.h>
#include <PCF8574.h>
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <math.h>
// -------------------- State (placed early to avoid Arduino auto-prototype issues) --------------------
enum class State { Idle, Excited, Anxious, Friendly };
State chooseState(uint32_t nowMs);
@CSonTi04
CSonTi04 / kpro_arp.ino
Last active April 19, 2025 08:41
Arduino Uno - Kaossilator Pro MIDI Arpeggiator
/*
Kaossilator Pro MIDI Arpeggiator
=================================
An expressive, clock-synced, monophonic arpeggiator controlled entirely by the Kaossilator Pro
via MIDI CC, Note, and Program Change messages.
Compatible with Arduino Nano / Uno + MIDI IN (optocoupler or MIDI shield)
=== What is an Arpeggiator? ===
An arpeggiator takes chord notes and plays them one after another in a rhythmic pattern,
from machine import I2S, Pin, I2C
import ulab
from ulab import numpy as np
import array
import math
import time
import gc
###################
# PIN CONFIGURATION
@CSonTi04
CSonTi04 / nussinov.py
Last active November 28, 2024 07:20
Nussinov algorithm
import numpy as np
# Define RNA sequence
seq = "AUGGCAUCGGC"
N = len(seq)
@CSonTi04
CSonTi04 / README.md
Created March 3, 2024 20:41 — forked from nitaku/README.md
Minimal JSON HTTP server in python

A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.

python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
table > *{
background-color: tan;
}
function addHeaders(table, keys) {
var row = table.insertRow();
for (var i = 0; i < keys.length; i++) {
var cell = row.insertCell();
cell.appendChild(document.createTextNode(keys[i]));
}
}
class TableFromJson extends HTMLElement {
items = [];
[
{
"Drink": "Cappuccino",
"Preparation": "Espresso",
"Temperature": "Hot",
"Ingredients": "Equal amount of espresso and steamed milk",
"Details": "Pour the espresso through the milk and serve."
},
{
"Drink": "Latte",