Skip to content

Instantly share code, notes, and snippets.

View hunterjsb's full-sized avatar
🏗️
Flipping Freight

Hunter Boyd hunterjsb

🏗️
Flipping Freight
View GitHub Profile
@hunterjsb
hunterjsb / catters.sh
Last active February 23, 2025 08:13
catters
# golang project to clipboard
find . \( -path "*/.venv/*" -o -path "*/__pycache__/*" \) -prune -o -type f \( -name "*.go" -o -name "*.sh" -o -iname "readme*" \) -print0 | while IFS= read -r -d '' file; do printf '################################################################################\n# File: %s\n################################################################################\n\n' "$file"; cat "$file"; printf '\n\n'; done | xsel -ib
# wails to clipboard
find . -path "*/node_modules/*" -prune -o -type f \( -iname "*.go" -o -iname "*.js" -o -iname "*.ts" -o -iname "*.css" -o -iname "*.html" \) -print0 | while IFS= read -r -d '' file; do printf '################################################################################\n# File: %s\n################################################################################\n\n' "$file"; cat "$file"; printf '\n\n'; done | xsel -ib
# :3

Data Persistence Model

  • shard & replicate at Redis level
  • horizontially scale rpc servers
flowchart TB
    subgraph "Device 1"
        C1[Client] --> R1[RPC Server]
@hunterjsb
hunterjsb / bookclub-go-races-memory.md
Last active May 1, 2024 15:04
Super-Sod Book Club May 2024: Race Conditions and Memory in Golang

Super-Sod Book Club 📚

May 2024 - Race Conditions and Memory in Golang

Two Uber engineers break down practical examples of how they detected, approached, and fixed race conditions at their company. They created a detected, which they claim:

We have deployed this detector in Uber’s 46 million lines of Go codebase hosting 2100 distinct microservices, found over 2000 data races, and fixed over 1000 data races, spanning 790 distinct code patches submitted by 210 unique developers over a six-month period.

@hunterjsb
hunterjsb / togmon.sh
Created April 22, 2024 20:37
Toggle Monitors One/All
#!/bin/bash
echo "Debug: Starting monitor toggle script"
# Get the current state of the monitors
monitors=$(xrandr --query | grep " connected" | awk '{print $1}')
echo "Debug: Connected monitors: $monitors"
# Check if all monitors are in use
all_on=0

Conversation Cosmos Doc

This document describes the structure of the JSON payload used in the system and consequently how it will be stored in Cosmos.

Payload Structure

The JSON payload consists of the following fields:

  • exchange (string): Specifies the platform where the item is listed. It can be either "marketplace" or "offerup".