Skip to content

Instantly share code, notes, and snippets.

View finesse-fingers's full-sized avatar

Bobby Koteski finesse-fingers

  • Amplify Health
  • Singapore
View GitHub Profile
@finesse-fingers
finesse-fingers / devcontainer.json
Last active April 28, 2025 14:31
VSC Dev Container Utilities
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {
"version": "latest",
"bicepVersion": "latest"
@finesse-fingers
finesse-fingers / delete-workflow-runs.sh
Last active March 22, 2025 07:51
Delete a disabled github actions workflow
# ref: https://stackoverflow.com/a/67000032/6648687
org=<org-name>
repo=<repo-name>
# Get workflow IDs with status "disabled_manually"
workflow_ids=($(gh api repos/$org/$repo/actions/workflows --paginate | jq '.workflows[] | select(.["state"] | contains("disabled_manually")) | .id'))
for workflow_id in "${workflow_ids[@]}"
do
@finesse-fingers
finesse-fingers / .sh
Created December 17, 2024 23:19
Copy git repo with history
git clone --bare https://oldRepoURL
cd oldRepoURL
git push --mirror https://newRepoURL
@finesse-fingers
finesse-fingers / coffee.sh
Last active January 30, 2024 04:18
Make your PC drink coffee
python -m pip install pyautogui --quiet
echo "Making an oat latte with 2 sugars..."
echo "Drinking..."
echo "Press ctrl+c to stop drinking..."
python -c "import pyautogui, time; [(pyautogui.press('shift'), time.sleep(59)) for _ in iter(int, 1)]"
@finesse-fingers
finesse-fingers / .zshrc
Created May 28, 2023 06:29
Ask GPT zsh alias
ask_gpt() {
# print the prompt in blue
echo -e "\e[34mPrompt: \"$1\"\e[0m"
# make a a slient request and store the result
response=$(curl https://api.openai.com/v1/completions \
--silent \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {TOKEN}" \
-d '{
"model": "text-davinci-003",
@finesse-fingers
finesse-fingers / .zshrc
Last active February 6, 2024 05:42
Git related zsh aliases
switch_back_to_branch() {
# get the current branch name
current_branch=$(git rev-parse --abbrev-ref HEAD)
# pull target branch
git fetch origin $1:$1
# switch to target branch
git checkout $1
# if -d is passed as second argument, delete the current branch
if [ "$2" = "-d" ]; then
# delete old branch and suppress error if branch is not merged
@finesse-fingers
finesse-fingers / pimp-powershell.md
Last active December 10, 2021 23:43
Pretty themes and history autocompletion for Powershell in Windows Terminal

How to pimp Powershell

Install posh-git, oh-my-posh and CaskaydiaCode Nerd Font

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser

Visit https://www.nerdfonts.com/ and find CaskaydiaCove Nerd Font. The font contains glyphs/icons required by the themes.

ingress:
enabled: true
className: ""
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /$1
hosts:
- host: kubernetes.docker.internal
paths:
- path: /my-app-path/?(.*)
@finesse-fingers
finesse-fingers / bash-args.sh
Last active August 24, 2021 12:54
How to parse cli args in a bash script
# https://www.baeldung.com/linux/use-command-line-arguments-in-bash-script
# usage: <script> -u <username> -a <age> -f <fullname>
while getopts u:a:f: flag
do
case "${flag}" in
u) username=${OPTARG};;
a) age=${OPTARG};;
f) fullname=${OPTARG};;
esac
done