Skip to content

Instantly share code, notes, and snippets.

View PurpleBooth's full-sized avatar

Billie Thompson PurpleBooth

View GitHub Profile
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 18, 2025 06:21
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@PurpleBooth
PurpleBooth / 1password
Last active February 2, 2025 20:51
Use sops to cache the one password vault session token because op is horrible to use
#!/usr/bin/env bash
set -euo pipefail
CACHE_DIR="${XDG_CACHE_HOME:-$HOME/Library/Caches}/wrapper-1password"
CACHE_FILE="$CACHE_DIR/session-token.yaml"
OP_LOCATION="$(command -v op)"
mkdir -p "$CACHE_DIR"
@PurpleBooth
PurpleBooth / setup-git-delta.sh
Last active January 19, 2025 14:15
Git Setup
#!/usr/bin/env bash
git config --global core.pager delta
git config --global interactive.diffFilter "delta --color-only"
git config --global delta.navigate true
git config --global merge.conflictstyle zdiff3

Docker Container Name

A one paragraph description about the container.

Getting Started

These instructions will cover usage information and for the docker container

Prerequisities

@PurpleBooth
PurpleBooth / thingy.go
Created July 20, 2024 09:43
Scrape github for merge durations
package main
import (
"golang.org/x/oauth2"
"github.com/google/go-github/github"
"context"
"fmt"
"time"
"os"
"log"
@PurpleBooth
PurpleBooth / README.md
Last active May 31, 2024 16:56
How to use docker in without docker-desktop on mac using lima

First run ths install.sh script

Then add an environment variable so tools you use that use docker can find docker

## Add this to your bashrc if you want this to be permenant
export DOCKER_HOST=ssh://localhost:60006

This will need the lima vm for docker running, you can do that by running

@PurpleBooth
PurpleBooth / write-me-a-commit-message.py
Last active March 25, 2024 02:20
I cba with writing my own commit messages anymore
#!/usr/bin/env python
import json
import logging
import subprocess
import sys
import textwrap
from typing import Literal, Sequence, TypedDict, Union
from urllib.error import HTTPError
from urllib.request import Request, urlopen
@PurpleBooth
PurpleBooth / Dockerfile
Last active March 21, 2024 09:33
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]