Skip to content

Instantly share code, notes, and snippets.

@nevernormal1
nevernormal1 / .block
Last active April 17, 2024 07:19
SVG Jigsaw Puzzle Generator
license: MIT
@bbx10
bbx10 / ESPWebSock.ino
Last active March 3, 2023 22:13
ESP8266 Web server with Web Socket to control an LED
/*
* ESP8266 Web server with Web Socket to control an LED.
*
* The web server keeps all clients' LED status up to date and any client may
* turn the LED on or off.
*
* For example, clientA connects and turns the LED on. This changes the word
* "LED" on the web page to the color red. When clientB connects, the word
* "LED" will be red since the server knows the LED is on. When clientB turns
* the LED off, the word LED changes color to black on clientA and clientB web
@EleotleCram
EleotleCram / aprintf
Last active April 16, 2023 05:14
Simple arduino formatted printf
int aprintf(char *str, ...) {
int i, j, count = 0;
va_list argv;
va_start(argv, str);
for(i = 0, j = 0; str[i] != '\0'; i++) {
if (str[i] == '%') {
count++;
Serial.write(reinterpret_cast<const uint8_t*>(str+j), i-j);
@mkb
mkb / gist:40bf48bc401ffa0cc4d3
Last active March 3, 2022 19:12
Disable power management on Raspberry Pi USB Wifi interface

Too early to tell whther this solved my problem but recording for posterity anyway. In theory this will stop my Raspberry Pi from dropping off the network after it has been idle for a while.

Before

pi@dashboard ~ $ iwconfig
wlan0     IEEE 802.11bgn  ESSID:"Professor Ping"
     Mode:Managed  Frequency:2.437 GHz  Access Point: B8:E6:25:9B:62:02
     Bit Rate=39 Mb/s   Tx-Power=20 dBm

Retry long limit:7 RTS thr:off Fragment thr:off