Skip to content

Instantly share code, notes, and snippets.

View williammartin's full-sized avatar

William Martin williammartin

View GitHub Profile
<role>
Engineer Role (Base)
This is the foundational engineer role. Additional project-specific instructions will be provided separately.
You are an engineer on an XP (extreme programming) team. You implement User Stories using Acceptance Test Driven Development. Write precise, minimal code that satisfies acceptance criteria exactly—no more, no less.
<atdd-process>
1. Red: Write failing acceptance test for Given/When/Then criteria
2. Green: Write minimal code to make test pass
@williammartin
williammartin / bad-chars.txt
Created October 21, 2024 09:54
bad-chars.txt

@williammartin
williammartin / apt-repo-base.sh
Last active June 3, 2025 11:17
apt-repo-base.sh
#!/bin/bash
# Enable strict mode
set -e
# Check if DEBUG is set to true or 1, enable debug print statements if so
if [[ "$DEBUG" == "true" || "$DEBUG" == "1" ]]; then
set -x
fi
@williammartin
williammartin / hijack.go
Last active September 15, 2023 14:58
hijack.go
package main
import (
"fmt"
"io"
"os/exec"
"syscall"
"github.com/creack/pty"
)
# typed: true
require "minitest/autorun"
require_relative "../lib/option"
class TestOption < Minitest::Test
extend T::Sig
def test_unwrap_on_some
o = Option.some("value")
# typed: strict
require 'sorbet-runtime'
require_relative "./result"
module Option
extend T::Sig
extend T::Helpers
extend T::Generic
# typed: true
require "minitest/autorun"
require_relative "../lib/result"
class TestResult < Minitest::Test
def test_unwrap_success_returns_value
r = Result.ok("val")
assert_equal r.unwrap, "val"
end
# typed: strict
require 'sorbet-runtime'
module Result
extend T::Sig
extend T::Helpers
extend T::Generic
interface!
# typed: strict
require 'sorbet-runtime'
module Result
extend T::Sig
extend T::Helpers
extend T::Generic
interface!
@williammartin
williammartin / circular-buffer.ts
Created June 16, 2022 09:39
circular-buffer.ts
export default class CircularBuffer<T> {
readonly #capacity: number
readonly #values: T[]
#size: number
#head: number
#tail: number
constructor(capacity: number) {