Skip to content

Instantly share code, notes, and snippets.

View bradmartin333's full-sized avatar

Brad Martin bradmartin333

View GitHub Profile
@vprusa
vprusa / characteristics.js
Last active November 3, 2023 18:16
UART terminal (with performance test) sketch for google chrome's Web Bluetooth GATT communication with ESP32 BLE
//https://googlechrome.github.io/samples/web-bluetooth/get-characteristics.html?service=6e400001-b5a3-f393-e0a9-e50e24dcca9e&characteristic_read=6e400002-b5a3-f393-e0a9-e50e24dcca9e
var bluetoothDevice;
var bluetoothDeviceWriteChar;
var bluetoothDeviceNotifyChar;
var timeNow, timeWriteLast, timeNotifyLast;
function str2ab(str) {
var buf = new ArrayBuffer(str.length*2); // 2 bytes for each char
@Larry57
Larry57 / SimpleMJPEGDecoder.cs
Last active November 11, 2022 09:19
Simple, fast and stupid MJPEG decoder that works for real. Give this viewer a try : https://github.com/Larry57/SimpleMJPEGStreamViewer
using System;
using System.Drawing;
using System.IO;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace SimpleMJPEGStreamViewer {
static class SimpleMJPEGDecoder {
@mmalex
mmalex / pngencode.cpp
Created April 7, 2011 17:48 — forked from anonymous/pngencode.cpp
bug fix png encoder
// by alex evans, 2011. released into the public domain.
// based on a first ever reading of the png spec, it occurs to me that a minimal png encoder should be quite simple.
// this is a first stab - may be buggy! the only external dependency is zlib and some basic typedefs (u32, u8)
//
// VERSION 0.02! now using zlib's crc rather than my own, and avoiding a memcpy and memory scribbler in the old one
// by passing the zero byte at the start of the scanline to zlib first, then the original scanline in place. WIN!
//
// more context at http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/.
//
// follow me on twitter @mmalex http://twitter.com/mmalex