Skip to content

Instantly share code, notes, and snippets.

View hbmartin's full-sized avatar
😃
Let's build together

Harold Martin hbmartin

😃
Let's build together
View GitHub Profile
@hbmartin
hbmartin / index.html
Created August 12, 2025 16:08
demo homepage
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Harold Martin — AI • Python • Data • Mobile</title>
<meta name="description" content="Harold Martin — AI, Python, database, and mobile app developer. Portfolio, open‑source, and writing."/>
<meta name="color-scheme" content="dark light"/>
<!-- Simple, single-file styles → modern + lo‑fi -->
@hbmartin
hbmartin / config
Created June 25, 2025 22:32
My Ghostty config
macos-titlebar-style = tabs
window-save-state = always
auto-update = download
quick-terminal-position = center
quick-terminal-screen = mouse
quick-terminal-animation-duration = 0
keybind = global:ctrl+grave_accent=toggle_quick_terminal
window-inherit-working-directory = true
@hbmartin
hbmartin / The Grug Brained Developer.md
Created June 18, 2025 17:18
A readable translation of https://grugbrain.dev/ with links to other perspectives

Software Development Principles: A Pragmatic Guide

A practical approach to software development based on years of experience

Introduction

This collection represents practical lessons learned from many years of software development. While not claiming exceptional intelligence, these insights come from extensive experience building and maintaining software systems, along with the mistakes that inevitably accompany that journey.

These principles are intended for developers at all levels, but particularly those who value pragmatic solutions over theoretical perfection. Some may find this approach overly simplistic, but experience suggests that simple, maintainable solutions often outperform complex, "elegant" ones.

@hbmartin
hbmartin / webcam-capture-interval.py
Created November 25, 2024 15:37
A simple Python script to capture webcam photos in a loop
import cv2
import time
import os
from datetime import datetime
def setup_output_directory():
output_dir = 'webcam_photos'
if not os.path.exists(output_dir):
os.makedirs(output_dir)
return output_dir
@hbmartin
hbmartin / missing-rosetta-code-tasks-for-lang.py
Last active October 17, 2024 22:51
Find Rosetta Code tasks missing for a given language
#!/usr/bin/env python
# /// script
# dependencies = [
# "pymediawiki",
# ]
# ///
from mediawiki import MediaWiki
from sys import argv
@hbmartin
hbmartin / menv.sh
Created July 11, 2024 00:08
A small script to setup multiple environments for a list of packages. Useful for comparing in isolated venv's.
#!/bin/bash
# Check if at least one argument is provided
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <arg1> <arg2> ... <argN>"
exit 1
fi
BOLD_GREEN="\033[1;32m"
RESET="\033[0m"
import com.esotericsoftware.kryo.io.Input
import com.google.common.collect.ImmutableMap
import java.io.File
import java.io.FileInputStream
import java.io.FileNotFoundException
import java.io.UncheckedIOException
fun main(args: Array<String>) {
val reader = Reader(
/* indexFile = */ File(".../build/test-results/macosArm64Test/binary/output.bin.idx"),
@hbmartin
hbmartin / tensorflow_numpy_coremltools_m1.yaml
Created April 3, 2023 20:15
Quick and consistent conda environment for TensorFlow and Core ML on Apple Silicon
name: tf-2.10-coremltools-6.2-numpy-1.24.2
channels:
- conda-forge
- defaults
dependencies:
- anyio=3.5.0=py310hca03da5_0
- appnope=0.1.2=py310hca03da5_1001
- argon2-cffi=21.3.0=pyhd3eb1b0_0
- argon2-cffi-bindings=21.2.0=py310h1a28f6b_0
- asttokens=2.0.5=pyhd3eb1b0_0
@hbmartin
hbmartin / tweets2gpt2.py
Created December 24, 2019 19:52
Download a twitter user's tweet corpus with output suitable for nlp / gpt2 training
#!/usr/bin/env python3
import json
import re
import sys
import tweepy
try:
with open("twitter_secrets.json") as json_file:
twitter_secrets = json.load(json_file)
// subclass must implement injection
public abstract class BoundVmFragment<VM extends ViewModel, VDB extends ViewDataBinding> extends LifecycleFragment {
@Inject protected ViewModelProvider.Factory viewModelFactory;
@Inject protected NavigationController navigationController;
protected FragmentDataBindingComponent dataBindingComponent = new FragmentDataBindingComponent(this);
protected VM viewModel;
protected AutoClearedValue<VDB> binding;