Skip to content

Instantly share code, notes, and snippets.

View jiito's full-sized avatar
♻️
coding the world better than I found it

Ben Allan-Rahill jiito

♻️
coding the world better than I found it
View GitHub Profile
@jiito
jiito / git.el
Last active November 21, 2022 21:55
Get the branch identifier in lisp
;;; git.el -*- lexical-binding: t; -*-
(defun get-jira-prefix (iden)
"Get the JIRA branch identifier from IDEN."
(let ((prefix (string-match "[A-Za-z]+-[0-9]+" iden)))
(if (not prefix)
(message iden) (substring iden prefix (match-end 0))
)
)
@jiito
jiito / gclp
Last active December 5, 2023 20:24
Git Commit Linear Id Prefix (zsh)
# GET LINEAR ID
setopt local_options BASH_REMATCH
REGEX="[A-Za-z]+-[0-9]+"
BRANCH=$(git branch --show-current)
if [[ $BRANCH =~ $REGEX ]]; then
PREFIX=$BASH_REMATCH[1]
fi
# COMMIT CHANGES WITH PREFIX
MESSAGE="$1"
@jiito
jiito / gmail-github-filters.md
Last active June 24, 2022 16:40 — forked from ldez/gmail-github-filters.md
Gmail and GitHub - Filters

Gmail and GitHub

Create new filters and create new labels.

Pull Request

label: gh-pull-request

@jiito
jiito / async-singleton.ts
Last active April 11, 2022 23:22
Async Singleton Typescript
let singletonPromise: Promise<T> | null;
async function getSingletonPromise() {
if (!singletonPromise) {
singletonPromise = functionThatReturnsAPromise<Promise<T>>()
}
return singletonPromise;
}
export default getSingletonPromise;
@jiito
jiito / cloudSettings
Created March 7, 2021 22:09 — forked from jckw/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-12T19:49:30.768Z","extensionVersion":"v3.4.3"}