Skip to content

Instantly share code, notes, and snippets.

View stephenlb's full-sized avatar
😁
Coding Python, Rust, JavaScript, AI

Stephen Blum stephenlb

😁
Coding Python, Rust, JavaScript, AI
View GitHub Profile
@stephenlb
stephenlb / CLAUDE.md
Created January 3, 2026 19:09 — forked from minimaxir/CLAUDE.md
Rust CLAUDE.md (20260101)

Agent Guidelines for Rust Code Quality

This document provides guidelines for maintaining high-quality Rust code. These rules MUST be followed by all AI coding agents and contributors.

Your Core Principles

All code you write MUST be fully optimized.

"Fully optimized" includes:

@stephenlb
stephenlb / index.js
Created May 1, 2018 17:09 — forked from ajb413/index.js
audio lext test
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: "__id__",
secretAccessKey: "__secret__",
});
var lexruntime = new AWS.LexRuntime({region: 'us-east-1'});
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {
// if we're paused don't do anything
if(self.currentState==STATE_PAUSED) {
// reset our frame counter
self.validFrameCounter=0;
return;
}
@stephenlb
stephenlb / 1.js
Created November 15, 2017 21:06 — forked from domadev812/1.js
Streaming Sensor Readings to a Realtime Gauge Chart
var five = require("johnny-five");
var board = new five.Board();
var pubnub = new PubNub({
subscribeKey: "mySubscribeKey",
publishKey: "myPublishKey",
ssl: true
})
@stephenlb
stephenlb / publishMsg.c
Created November 15, 2017 21:06 — forked from domadev812/publishMsg.c
Code chunks from project javamon
// Publish the value using PubNub
static void publishMsg (void)
{
// Check values for I2C line error...
if (TWI_msg[0] > 99 || TWI_msg[1] > 99) {
TWI_fullMsg = 10000;
}
// Ignore very small values
else if (TWI_msg[0] == 0 && TWI_msg[1] < 50) {
TWI_fullMsg = 0;
@stephenlb
stephenlb / 1.h
Created November 15, 2017 21:06 — forked from domadev812/1.h
Arduino To PubNub In Two Steps
#include <SPI.h>
#include <Ethernet.h>
#include <Pubnub.h>
#include "string.h"
#include "iotconnector.h"
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char pubkey[] = "PUBLISH KEYS HERE";char subkey[] = "SUBSCRIBE KEYS HERE";char channel[] = "iotchannel";char uuid[] = "Arduino";
@stephenlb
stephenlb / 1.js
Created November 15, 2017 21:06 — forked from domadev812/1.js
Creating Real-Time WebGL Visualizations
function handleMsg(msg) {
if (VISIBLE) {
addData(msg.pub, msg.subs);
}
}
pubnub = new PubNub({
publishKey : 'demo',
subscribeKey : 'demo'
})
@stephenlb
stephenlb / 1.html
Created November 15, 2017 21:06 — forked from domadev812/1.html
Displaying Live Location Points & Tracks with JavaScript & MapBox and PubNub
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.js'></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.css' rel='stylesheet' />
@stephenlb
stephenlb / 01.py
Created November 15, 2017 21:06 — forked from domadev812/01.py
[Blog] DIY Hue Lightbulb with Android Control
#!/usr/bin/python
import time
import RPi.GPIO as GPIO
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub
@stephenlb
stephenlb / 1.html
Created November 15, 2017 21:06 — forked from domadev812/1.html
Transportation Delay: Create Real-Time Visualization of Data Using NVD3 And PubNub
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js'></script>
<link href='https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css' rel='stylesheet'>