Skip to content

Instantly share code, notes, and snippets.

View nickccm1122's full-sized avatar
🇭🇰
Searching...

Nick Chan nickccm1122

🇭🇰
Searching...
View GitHub Profile
@nickccm1122
nickccm1122 / replace_macos_legacy_cli.sh
Last active March 7, 2024 07:00
script to replace macos legacy cli
#!/usr/bin/sh
###################################################
# Check if the brew path of the item exists
# then run brew install if not exits
# set the PATH and MANPATH for each item
###################################################
# check if brew is installed
if ! [ -x "$(command -v brew)" ]; then
@nickccm1122
nickccm1122 / fzf.sh
Last active July 21, 2019 09:55
fzf config
#!/usr/bin/sh
# Setup fzf
# ---------
if [[ ! "$PATH" == */usr/local/opt/fzf/bin* ]]; then
export PATH="$PATH:/usr/local/opt/fzf/bin"
fi
# Custom settings
# ------------
@nickccm1122
nickccm1122 / docker-alias.zsh
Last active August 10, 2019 09:38
my docker command functions or aliases
#!/usr/bin/sh
################################
# functions
################################
# docker contianer logs
dklog(){
docker ps -a \
--format "table{{.ID}}\t{{.Names}}\t{{.Ports}}" \
@nickccm1122
nickccm1122 / job_buffering.go
Created March 11, 2020 15:57
Example code to buffer concurrent long running task
package main
import (
"fmt"
"math/rand"
"strconv"
"sync"
"sync/atomic"
"time"
)
{
"basics": {
"label": "Software Engineer",
"phone": "+852 60406776",
"email": "[email protected]",
"website": "https://registry.jsonresume.org/nickccm1122",
"other": [],
"name": "Nick Chan",
"location": {
"city": "Hong Kong SAR",