Skip to content

Instantly share code, notes, and snippets.

@kaebmoo
kaebmoo / nginx-thingsboard
Created July 1, 2019 07:38 — forked from mfalkvidd/nginx-thingsboard
Thingsboard nginx reverse proxy with websocket and HTTPS support (Let's Encrypt)
server {
listen 80;
server_name EXTERNAL_THINGSBOARD_DOMAIN.com;
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}
server {
@kaebmoo
kaebmoo / debounce2.ino
Created February 26, 2018 03:14 — forked from smching/debounce2.ino
Debouncing Multiple Switches
#define DEBOUNCE 10 // how many ms to debounce, 5+ ms is usually plenty
//define the buttons that we'll use.
byte buttons[] = {4, 5, 6, 7, 8, 9};
//determine how big the array up above is, by checking the size
#define NUMBUTTONS sizeof(buttons)
//track if a button is just pressed, just released, or 'currently pressed'
byte pressed[NUMBUTTONS], justpressed[NUMBUTTONS], justreleased[NUMBUTTONS];