Instantly share code, notes, and snippets.

View OpenChannel.py
import serial, webbrowser
with serial.Serial('/dev/ttyUSB0', 115200) as s:
while True:
line = s.readline()
webbrowser.open_new('https://www.youtube.com/c/DavyBot')
View ESP32-Touch.ino
// Touch pin cutoff value
#define CUTOFF 20
// Amount of time held before touch fires event (ms)
#define DURATION 100
// Touch state (0=none, 1=touched+waiting, 2=touched+sent)
int state;
int start;
View LoraDemo.js
/*
This is an example of using Espruino JS to control a REYAX LoRa module.
It listens for "on" and "off" messages to change and LED and
sends "on" and "off" messages by pressing the button.
Watch the video here: https://youtu.be/IStuUv9eAmE
*/
const RYLR = require('https://github.com/wybiral/espruino-modules/blob/master/RYLR.js');
View EspruinoWebSockets.js
/*
Example of using WebSockets on an Espruino WiFi device for bidirectional communication.
Fill in the WiFi SSID and password to connect to your local network and then the Espruino
console will print out the IP address of your device which you can connect to with a web
browser.
Video here: https://www.youtube.com/watch?v=xcecEODjxSE
*/
View WiPy_RGB_Server.py
import pycom
import socket
pycom.heartbeat(False)
html = b'''<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Change Color</title>
View BLE_Scan.ino
#include <BLEAdvertisedDevice.h>
#include <BLEDevice.h>
#include <BLEScan.h>
const int PIN = 2;
const int CUTOFF = -60;
void setup() {
pinMode(PIN, OUTPUT);
BLEDevice::init("");
View SerialProxy.ino
void setup() {
Serial.begin(115200);
Serial1.begin(115200);
}
void loop() {
byte b;
if (Serial1.available() > 0) {
b = Serial1.read();
Serial.write(b);
View hookah-example.go
package main
import (
"encoding/json"
"io"
"log"
"github.com/wybiral/hookah"
)
View tor-ed25519.go
// Example of generating Tor onion using the new ED25519-v3 format
package main
import (
"crypto/rand"
"crypto/sha512"
"encoding/base32"
"encoding/base64"
"fmt"