Skip to content

Instantly share code, notes, and snippets.

@chunheisiu
Last active November 12, 2025 09:56
Show Gist options
  • Select an option

  • Save chunheisiu/b3e6f88d930db44cbd77627053233816 to your computer and use it in GitHub Desktop.

Select an option

Save chunheisiu/b3e6f88d930db44cbd77627053233816 to your computer and use it in GitHub Desktop.

Revisions

  1. chunheisiu revised this gist Nov 12, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update_app_icons.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ APPS=(
    # "Futubull"
    "GIMP"
    "JetBrains Toolbox"
    "Spotify"
    # "Spotify"
    "uSMART Trade"
    "Zerotier"
    )
  2. chunheisiu revised this gist Sep 19, 2025. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions update_app_icons.sh
    Original file line number Diff line number Diff line change
    @@ -2,13 +2,14 @@ APPLICATIONS_DIR="/Applications/"
    ICONS_DIR="/Users/chunheisiu/Documents/Icons/"

    APPS=(
    "Dark Mode for Safari"
    # "Dark Mode for Safari"
    "Days Matter"
    "Futubull"
    # "Futubull"
    "GIMP"
    "JetBrains Toolbox"
    "Spotify"
    "uSMART Trade"
    "Zerotier"
    )

    for app in "${APPS[@]}"; do
  3. chunheisiu revised this gist Jun 23, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ echo

    # Replace App Icons
    echo "${RED}##${ENDCOLOR} ${WHITE}Update App Icons${ENDCOLOR}"
    read -p "Update app icons? [y/N]" update_icons
    read -p "Update app icons [y/N]? " update_icons
    if [[ "$update_icons" =~ ^[Yy]$ ]]; then
    . ${0%/*}/update_app_icons.sh
    fi
  4. chunheisiu revised this gist Jun 23, 2025. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -12,8 +12,7 @@ echo

    # Replace App Icons
    echo "${RED}##${ENDCOLOR} ${WHITE}Update App Icons${ENDCOLOR}"
    echo "Update app icons? [y/N]"
    read -r update_icons
    read -p "Update app icons? [y/N]" update_icons
    if [[ "$update_icons" =~ ^[Yy]$ ]]; then
    . ${0%/*}/update_app_icons.sh
    fi
  5. chunheisiu revised this gist Jun 22, 2025. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,11 @@ echo

    # Replace App Icons
    echo "${RED}##${ENDCOLOR} ${WHITE}Update App Icons${ENDCOLOR}"
    . ${0%/*}/update_app_icons.sh
    echo "Update app icons? [y/N]"
    read -r update_icons
    if [[ "$update_icons" =~ ^[Yy]$ ]]; then
    . ${0%/*}/update_app_icons.sh
    fi
    echo

    # Conda
  6. chunheisiu revised this gist Jun 20, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -8,11 +8,11 @@ brew update
    brew upgrade
    brew cu -a
    brew cleanup
    echo

    # Replace App Icons
    echo "${RED}##${ENDCOLOR} ${WHITE}Update App Icons${ENDCOLOR}"
    . ${0%/*}/update_app_icons.sh

    echo

    # Conda
  7. chunheisiu revised this gist Jun 20, 2025. 2 changed files with 7 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ brew cleanup

    # Replace App Icons
    echo "${RED}##${ENDCOLOR} ${WHITE}Update App Icons${ENDCOLOR}"
    sudo ${0%/*}/update_app_icons.sh
    . ${0%/*}/update_app_icons.sh

    echo

    7 changes: 6 additions & 1 deletion update_app_icons.sh
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,11 @@ for app in "${APPS[@]}"; do
    app_path="${APPLICATIONS_DIR}${app}.app"
    icon_path="${ICONS_DIR}${app}.icns"

    fileicon set "${app_path}" "${icon_path}"
    fileicon set "${app_path}" "${icon_path}" -q
    # Retry using sudo if the first attempt fails
    if [ $? -ne 0 ]; then
    sudo fileicon set "${app_path}" "${icon_path}" -q
    fi

    echo "Updated icon for ${app}.app with ${app}.icns"
    done
  8. chunheisiu revised this gist Jun 20, 2025. 2 changed files with 5 additions and 1 deletion.
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ brew cleanup

    # Replace App Icons
    echo "${RED}##${ENDCOLOR} ${WHITE}Update App Icons${ENDCOLOR}"
    . ${0%/*}/update_app_icons.sh
    sudo ${0%/*}/update_app_icons.sh

    echo

    4 changes: 4 additions & 0 deletions update_app_icons.sh
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,10 @@ APPLICATIONS_DIR="/Applications/"
    ICONS_DIR="/Users/chunheisiu/Documents/Icons/"

    APPS=(
    "Dark Mode for Safari"
    "Days Matter"
    "Futubull"
    "GIMP"
    "JetBrains Toolbox"
    "Spotify"
    "uSMART Trade"
  9. chunheisiu revised this gist Jun 20, 2025. 2 changed files with 20 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,10 @@ brew upgrade
    brew cu -a
    brew cleanup

    # Replace App Icons
    echo "${RED}##${ENDCOLOR} ${WHITE}Update App Icons${ENDCOLOR}"
    . ${0%/*}/update_app_icons.sh

    echo

    # Conda
    16 changes: 16 additions & 0 deletions update_app_icons.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    APPLICATIONS_DIR="/Applications/"
    ICONS_DIR="/Users/chunheisiu/Documents/Icons/"

    APPS=(
    "JetBrains Toolbox"
    "Spotify"
    "uSMART Trade"
    )

    for app in "${APPS[@]}"; do
    app_path="${APPLICATIONS_DIR}${app}.app"
    icon_path="${ICONS_DIR}${app}.icns"

    fileicon set "${app_path}" "${icon_path}"
    echo "Updated icon for ${app}.app with ${app}.icns"
    done
  10. chunheisiu revised this gist Jun 20, 2025. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion setup_brew.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,6 @@

    brew install brew-cask-completion
    brew tap buo/cask-upgrade
    brew tap Homebrew/cask-versions
    brew tap Homebrew/cask-drivers

    brew install apparency qlstephen qlcolorcode
  11. chunheisiu revised this gist Nov 27, 2022. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions setup_brew.sh
    Original file line number Diff line number Diff line change
    @@ -6,3 +6,6 @@ brew install brew-cask-completion
    brew tap buo/cask-upgrade
    brew tap Homebrew/cask-versions
    brew tap Homebrew/cask-drivers

    brew install apparency qlstephen qlcolorcode
    xattr -d -r com.apple.quarantine ~/Library/QuickLook
  12. chunheisiu revised this gist Apr 3, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions setup_brew.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/""

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    brew install brew-cask-completion
  13. chunheisiu revised this gist Apr 3, 2021. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,16 @@
    RED="\033[1;91m"
    WHITE="\033[1;97m"
    ENDCOLOR="\033[0m"

    # Brew
    echo "## Update Brew"
    echo "${RED}##${ENDCOLOR} ${WHITE}Update Brew${ENDCOLOR}"
    brew update
    brew upgrade
    brew cu -a
    brew cleanup

    echo

    # Conda
    echo "## Update Conda"
    echo "${RED}##${ENDCOLOR} ${WHITE}Update Conda${ENDCOLOR}"
    conda update --all
  14. chunheisiu revised this gist Mar 27, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,10 @@
    # Brew
    echo "## Update Brew"
    brew update
    brew upgrade
    brew cu -a
    brew cleanup

    # Conda
    echo "## Update Conda"
    conda update --all
  15. chunheisiu revised this gist Feb 29, 2020. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,3 @@ brew cleanup

    # Conda
    conda update --all

    # Pip
    pip install -U $(pip freeze | awk '{split($0, a, "=="); print a[1]}')
  16. chunheisiu revised this gist Feb 29, 2020. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,6 @@ brew cu -a
    brew cleanup

    # Conda
    conda deactivate
    conda update --all

    # Pip
  17. chunheisiu revised this gist Feb 29, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,4 @@ conda deactivate
    conda update --all

    # Pip
    pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
    pip install -U $(pip freeze | awk '{split($0, a, "=="); print a[1]}')
  18. chunheisiu revised this gist Feb 29, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@ brew cu -a
    brew cleanup

    # Conda
    conda deactivate
    conda update --all

    # Pip
  19. chunheisiu revised this gist Feb 26, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ brew cleanup
    conda update --all

    # Pip
    pip install -U $(pip freeze | awk '{split($0, a, "=="); print a[1]}')
    pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
  20. chunheisiu revised this gist Nov 21, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,6 @@ brew cu -a
    brew cleanup

    # Conda
    conda deactivate
    conda update --all

    # Pip
  21. chunheisiu revised this gist Nov 21, 2019. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,12 @@
    # Brew
    brew update; brew upgrade; brew cu -a; brew cleanup
    brew update
    brew upgrade
    brew cu -a
    brew cleanup

    # Conda
    conda deactivate
    conda update --all

    # Pip
    pip install -U $(pip freeze | awk '{split($0, a, "=="); print a[1]}')
    pip install -U $(pip freeze | awk '{split($0, a, "=="); print a[1]}')
  22. chunheisiu revised this gist Oct 18, 2019. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions setup_brew.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    brew install brew-cask-completion
    brew tap buo/cask-upgrade
    brew tap Homebrew/cask-versions
    brew tap Homebrew/cask-drivers
  23. chunheisiu renamed this gist Oct 18, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  24. chunheisiu renamed this gist Oct 18, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  25. chunheisiu revised this gist Oct 18, 2019. 2 changed files with 0 additions and 0 deletions.
    Empty file modified pandoc_md2html.sh
    100644 → 100755
    Empty file.
    Empty file modified pandoc_md2pdf.sh
    100644 → 100755
    Empty file.
  26. chunheisiu revised this gist Oct 18, 2019. 1 changed file with 0 additions and 0 deletions.
    Empty file modified update.sh
    100644 → 100755
    Empty file.
  27. chunheisiu revised this gist Oct 18, 2019. No changes.
  28. chunheisiu revised this gist Oct 18, 2019. 2 changed files with 18 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions pandoc_md2html.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # pandoc_md2html.sh <input filename> <output filename> <output file title>
    pandoc $1 \
    --output=$2 \
    --from=gfm \
    --to=html5 \
    --css=$HOME/git/markdown-css/github.css \
    --self-contained \
    --metadata=title:$3
    10 changes: 10 additions & 0 deletions pandoc_md2pdf.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # pandoc_md2pdf.sh <input filename> <output filename> <output file title>
    pandoc $1 \
    -V geometry:margin=0.5in \
    -V mainfont=Arial \
    --output=$2 \
    --from=gfm \
    --to=latex \
    --self-contained \
    --pdf-engine=xelatex \
    --metadata=title:$3
  29. chunheisiu revised this gist Oct 18, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .scripts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Useful shell scripts
  30. chunheisiu created this gist Oct 18, 2019.
    8 changes: 8 additions & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # Brew
    brew update; brew upgrade; brew cu -a; brew cleanup

    # Conda
    conda update --all

    # Pip
    pip install -U $(pip freeze | awk '{split($0, a, "=="); print a[1]}')