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 September 19, 2024 19:38
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 {
@zmilojko
zmilojko / UDPer.cs
Last active August 14, 2024 15:38
C# sends and receives UDP broadcasts
using System;
using System.Net.Sockets;
using System.Net;
using System.Text;
using System.Threading;
namespace UDPer
{
class UDPer
{
@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