Skip to content

Instantly share code, notes, and snippets.

View cgjosephlee's full-sized avatar
🚀
Go Go!

Joseph Lee cgjosephlee

🚀
Go Go!
View GitHub Profile
@cgjosephlee
cgjosephlee / _bat
Created August 8, 2023 04:46
bat zsh autocompletion, v0.23.0
#compdef bat
local context state state_descr line
typeset -A opt_args
(( $+functions[_bat_cache_subcommand] )) ||
_bat_cache_subcommand() {
local -a args
args=(
'(-b --build -c --clear)'{-b,--build}'[Initialize or update the syntax/theme cache]'
@cgjosephlee
cgjosephlee / _poetry
Created July 28, 2023 03:51
poetry zsh autocompletion, `poetry completions zsh > _poetry`
#compdef poetry
_poetry_354d8f8794c14b58_complete()
{
local state com cur
local -a opts
local -a coms
cur=${words[${#words[@]}]}
@cgjosephlee
cgjosephlee / Grind75.csv
Created July 27, 2023 10:00
Leetcode Grind 75 question list
Week No Question Title Question URL Difficulty Topic Time
1 1 Two Sum https://leetcode.com/problems/two-sum Easy Array 15 mins
1 2 Valid Parentheses https://leetcode.com/problems/valid-parentheses Easy Stack 20 mins
1 3 Merge Two Sorted Lists https://leetcode.com/problems/merge-two-sorted-lists Easy Linked List 20 mins
1 4 Best Time to Buy and Sell Stock https://leetcode.com/problems/best-time-to-buy-and-sell-stock Easy Array 20 mins
1 5 Valid Palindrome https://leetcode.com/problems/valid-palindrome Easy String 15 mins
1 6 Invert Binary Tree https://leetcode.com/problems/invert-binary-tree Easy Binary Tree 15 mins
1 7 Valid Anagram https://leetcode.com/problems/valid-anagram Easy String 15 mins
1 8 Binary Search https://leetcode.com/problems/binary-search Easy Binary Search 15 mins
1 9 Flood Fill https://leetcode.com/problems/flood-fill Easy Graph 20 mins
[
{
"name": "HHKB Professional"
},
[
{
"c": "#b8b8b8",
"a": 6,
"f": 4
},
@cgjosephlee
cgjosephlee / _csvtk
Last active July 28, 2023 03:48
csvtk zsh autocompletion, `csvtk genautocomplete --shell zsh --file _csvtk`
#compdef _csvtk csvtk
# zsh completion for csvtk -*- shell-script -*-
__csvtk_debug()
{
local file="$BASH_COMP_DEBUG_FILE"
if [[ -n ${file} ]]; then
echo "$*" >> "${file}"
fi
@cgjosephlee
cgjosephlee / median.theme.bash
Last active December 19, 2018 09:44
A simple bash theme
#!/usr/bin/env bash
SCM_THEME_PROMPT_PREFIX="${bold_cyan} (${bold_green}"
SCM_THEME_PROMPT_SUFFIX="${bold_cyan})"
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
__last_cmd_return() {
code=$?
if [ $code = 0 ]; then