Skip to content

Instantly share code, notes, and snippets.

@oliverlee
oliverlee / git-pr-update.sh
Last active June 26, 2024 19:13
Push commit to Github and open/update a PR
#!/usr/bin/env bash
set -euo pipefail
KEY="Change-Id: "
SOURCE_REMOTE=origin
TARGET_USER=$(git remote get-url "$SOURCE_REMOTE" | sed 's/^.*\.com[:/]\(.*\)\/.*$/\1/')
TARGET_REMOTE="${TARGET_REMOTE:-origin}"
if git rev-parse --verify main >/dev/null 2>&1; then
@oliverlee
oliverlee / github-context.json
Created June 8, 2024 01:46 — forked from colbyfayock/github-context.json
Sample payload for Github Action `github` context
{
"token": "[token]",
"job": "notifySlack",
"ref": "refs/pull/4/merge",
"sha": "[shad]",
"repository": "colbyfayock/demo-github-actions",
"repository_owner": "colbyfayock",
"repositoryUrl": "git://github.com/colbyfayock/demo-github-actions.git",
"run_id": 120667610,
"run_number": "2",
@oliverlee
oliverlee / bazel-integrity.bash
Created June 17, 2025 05:07
generate the integrity for a bazel archive
#!/bin/bash
set -euo pipefail
# https://github.com/bazelbuild/bazel/issues/17124
url="$1"
echo -n "sha256-"
curl -fnsSL "$url" | sha256sum | cut -d' ' -f1 | xxd -r -p | base64
@oliverlee
oliverlee / cpp14_metaprogramming_exercises.md
Last active November 15, 2025 19:39
C++14 Metaprogramming Exercises

C++14 Metaprogramming Exercises

Based on Peter Dimov's "Simple C++11 Metaprogramming" articles from Boost.MP11 documentation.

These exercises progress from basic type list manipulation to advanced metaprogramming techniques, emphasizing the use of variadic templates, parameter pack expansion, and template aliases.


Level 1: Fundamentals