Skip to content

Instantly share code, notes, and snippets.

View gavrie's full-sized avatar

Gavrie Philipson gavrie

View GitHub Profile
@gavrie
gavrie / m1-mac-python-2.7.md
Last active July 29, 2021 08:34
Running Python 2.7 virtualenv on M1 Mac
# Start Rosetta shell
arch -x86_64 $SHELL

# Install x86_64 Homebrew in /usr/local/bin (as opposed to /opt/homebrew/bin):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Create virtualenv for native macOS Python 2.7 (since we can't build vanilla Python 2.7 on M1):
# (Note: Due to the arm64e issue, we need to use x86_64 Python)
virtualenv -p python2.7 venv
@gavrie
gavrie / run.tpl
Last active October 30, 2023 10:33 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- range $b := .Binds}}
--volume {{printf "%q" $b}} \
@gavrie
gavrie / gist:ebfad1920d7c300ff9b55d68839adbc2
Last active January 12, 2025 02:08
Building Consistent Artifacts from Multiple Git Repositories

The following is based on this prompt to Claude:

Design a solution to build artifacts from several Git repos that all use the same compiler flags. We do not want to use a central makefile for this. The repos are all built using a specific Docker image that includes all the build tools. How should we store and cache the artifacts, and retrieve the relevant versions?

I'll design a solution that focuses on consistency, reusability, and efficient artifact management. Here's a comprehensive approach:

  1. Compiler Flags Management:
# compiler-config.yaml (stored in a separate config repo)
compiler: