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 / animated-gif.md
Last active April 8, 2026 01:36
DIY How to make your own HD Animated GIF Generator

HD Animated GIF Generator

You can make your own HD animated GIF generator.
Follow along with these commands to get started.

HD Animated GIF Generator

git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
@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 / draw-pytorch-image.py
Last active November 15, 2025 00:26
Draw the Pytorch Image
# -*- coding: utf-8 -*-
import torch
import math
import numpy as np
import matplotlib.pyplot as plt
import torchvision.io as io
import torchvision.transforms as T
from torch.utils.data import TensorDataset, DataLoader
@stephenlb
stephenlb / tutorial.py
Created November 10, 2025 21:28
mnist tensorflow keras tutorial!
import tensorflow as tf
import tensorflow_datasets as tfds
(ds_train, ds_test), ds_info = tfds.load(
'mnist',
split=['train', 'test'],
shuffle_files=True,
as_supervised=True,
with_info=True,
)
@stephenlb
stephenlb / .vimrc
Created October 8, 2025 20:43
Stephen's Vim RC File
set nowrap
set nobackup
set undofile " Undo across sessions
set undolevels=800 " Keep 800 changes to be undone
set undodir=~/.vim/tmp/undo//
nmap <F2> :.w !pbcopy<CR><CR>
vmap <F2> :w !pbcopy<CR><CR>
set noswapfile
@stephenlb
stephenlb / easy_install.sh
Last active September 29, 2025 20:27
# Neovim + Rust Analyzer installation
brew install neovim
rustup component add rust-analyzer
brew install luajit
sudo ln -s `which luajit` /usr/local/bin/lua
nvim -u NORC -c "source https://raw.githubusercontent.com/lumen-oss/rocks.nvim/master/installer.lua"
nvim
:Rocks install rustaceanvim
:RustAnalyzer start
// https://gist.github.com/stephenlb/d1a2972222864afea79076b793e4f58d
const http = require("xhr");
const pubnub = require("pubnub");
const dataUrl = 'https://gist.githubusercontent.com/stephenlb/d1a2972222864afea79076b793e4f58d/raw/4854f61998c6972a87dc63c257b8c8138ea4a541/Chat-flooding_api_calls.json';
const publishKey = '...............';
const subscribeKey = '...............';
let data = null;
let position = 0;
@stephenlb
stephenlb / Procfile
Last active April 2, 2025 20:39
Twitter / PubNub Bridge - Heroku Worker
tweetstream: node twitter-pubnub-stream.js
@stephenlb
stephenlb / pubnub-post.js
Last active April 2, 2025 20:39
PubNub POST Gzip Examples
var http = require("http");
var zlib = require("zlib");
exports.publish = function(msg) {
var req = http.request({
"host" : "pubsub.pubnub.com",
"method" : "POST",
"path" : "/publish/demo/demo/0/my_channel/0",
"headers" : {
"Content-Encoding" : "gzip",
@stephenlb
stephenlb / .screenrc
Created November 13, 2024 18:23
Terminal Setup GNU Screen
startup_message off
vbell on
msgwait 1
defscrollback 200000
hardstatus alwayslastline
hardstatus string '%{= kG}[ Stephen Blum ]%{g}[%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m/%d %{W}%c %{g}]'
caption string "%{W}%n%f %t%?(%u)%?%{r}"
rendition so =rb 04