Skip to content

Instantly share code, notes, and snippets.

@mickeek
mickeek / useTierChangeMonitor.ts
Created November 7, 2022 13:51
Alternative campaigns voucher hook
import { useEffect, useState } from 'react';
import { useFormikContext } from '@sonic/form';
import useEventCallback from '@sonic/utils/useEventCallback';
import { tierPath } from '../constants';
type Tiers = 3 | 4 | 5 | 6;
type TierValues = 0 | 20 | 50 | 100;
@mickeek
mickeek / gbranch.sh
Last active October 16, 2025 08:39
gbranch
// requires:
// - https://github.com/github/hub
// - https://github.com/ankitpokhrel/jira-cli
// $ gbranch COM-12345
function gbranch {
typeset -u key
local key=$1
@mickeek
mickeek / gfeat.sh
Last active October 16, 2025 08:39
gfeat
// $ gfeat "did some stuff"
function gfeat {
# Extract the branch key (formatted as uppercase second segment + third segment)
local key=$(git branch --show-current | awk -F"[/-]+" '{print toupper($2)"-"$3}')
# Construct the commit message using all passed arguments
local commitmessage="feat: $key $*"
# Use vared to allow editing of the commit message