Skip to content

Instantly share code, notes, and snippets.

View mjvo's full-sized avatar

Mark Olson mjvo

View GitHub Profile
@tangert
tangert / globals.ts
Last active January 14, 2026 06:11
Transpile p5.js global mode to instance mode
/*
Source typefile from here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/p5/global.d.ts
Used ts-morph to parse the type file and generate a list of all function names and constants.
*/
export default {
functions: [
"describe",
"describeElement",
"textOutput",
@kotobuki
kotobuki / script.js
Last active August 7, 2024 14:34
Web Bluetooth with micro:bit (UART)
// https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html
// An implementation of Nordic Semicondutor's UART/Serial Port Emulation over Bluetooth low energy
const UART_SERVICE_UUID = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
// Allows the micro:bit to transmit a byte array
const UART_TX_CHARACTERISTIC_UUID = "6e400002-b5a3-f393-e0a9-e50e24dcca9e";
// Allows a connected client to send a byte array
const UART_RX_CHARACTERISTIC_UUID = "6e400003-b5a3-f393-e0a9-e50e24dcca9e";