Skip to content

Instantly share code, notes, and snippets.

View yifeiyin's full-sized avatar

Yifei Yin yifeiyin

View GitHub Profile
@yifeiyin
yifeiyin / publish-gh-page.yml
Created August 4, 2021 03:31
Put this file in .github/workflows/publish-gh-page.yml
name: Publish to GitHub Page
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
@yifeiyin
yifeiyin / index.mjs
Created November 6, 2022 19:13
commit message parsing using magic-regexp https://regexp.dev
import assert from 'node:assert';
import {
createRegExp,
exactly,
oneOrMore,
char,
wordChar,
whitespace,
maybe,
} from 'magic-regexp';
@yifeiyin
yifeiyin / gist_commit_apply.sh
Created October 30, 2025 22:16
Publish commit to github gist
# --- Publish a git commit as a gist patch ---
gist_commit() {
local sha="$1"
local desc="${2:-"Patch for commit $sha"}"
if [ -z "$sha" ]; then
echo "Usage: gist_commit <commit-sha> [description]"
return 1
fi