Skip to content

Instantly share code, notes, and snippets.

View anhkhoakz's full-sized avatar
🎯
Focusing

Nguyễn Huỳnh Anh Khoa anhkhoakz

🎯
Focusing
View GitHub Profile
#!/usr/bin/env bash
set -euo pipefail
# install zsh
sudo apt-get update
sudo apt-get install -y \
curl \
zsh \
tmux \
@anhkhoakz
anhkhoakz / Vietnam_provinces.json
Last active July 16, 2025 03:38
Vietnam Provinces & Wards
{"11":{"name":"Hà Nội","slug":"ha-noi","type":"thanh-pho","name_with_type":"Thành phố Hà Nội","code":"11"},"12":{"name":"Hồ Chí Minh","slug":"ho-chi-minh","type":"thanh-pho","name_with_type":"Thành phố Hồ Chí Minh","code":"12"},"13":{"name":"Đà Nẵng","slug":"da-nang","type":"thanh-pho","name_with_type":"Thành phố Đà Nẵng","code":"13"},"14":{"name":"Hải Phòng","slug":"hai-phong","type":"thanh-pho","name_with_type":"Thành phố Hải Phòng","code":"14"},"15":{"name":"Cần Thơ","slug":"can-tho","type":"thanh-pho","name_with_type":"Thành phố Cần Thơ","code":"15"},"16":{"name":"Huế","slug":"hue","type":"thanh-pho","name_with_type":"Thành phố Huế","code":"16"},"17":{"name":"An Giang","slug":"an-giang","type":"tinh","name_with_type":"Tỉnh An Giang","code":"17"},"18":{"name":"Bắc Ninh","slug":"bac-ninh","type":"tinh","name_with_type":"Tỉnh Bắc Ninh","code":"18"},"19":{"name":"Cà Mau","slug":"ca-mau","type":"tinh","name_with_type":"Tỉnh Cà Mau","code":"19"},"20":{"name":"Cao Bằng","slug":"cao-bang","type":"tinh","name_with
@anhkhoakz
anhkhoakz / Pandoc Markdown to PDF.md
Last active July 12, 2025 03:17 — forked from ilessing/Pandoc Markdown to PDF.md
getting pandoc to generate PDF from Markdown on MacOS

Convert Markdown to PDF with Pandoc on macOS

What You Need

  1. Pandoc – Converts Markdown to other formats.
  2. PDFLaTeX – Needed by Pandoc to make PDFs.

Installation Steps

  1. Install Pandoc
@anhkhoakz
anhkhoakz / ubuntu_bootstraping.sh
Created July 5, 2025 03:19
Sets up essential packages for a better terminal experience on Ubuntu systems.
#!/usr/bin/env bash
# ubuntu_bootstrap.sh - Automated installation for Ubuntu
#
# Sets up Zsh, ZSH4Humans, and essential packages for a better terminal
# experience on Ubuntu systems.
readonly ESSENTIAL_PKGS=(
zsh git curl fastfetch fzf tmux neovim make gcc ripgrep unzip xclip \
tar jq lsb-release
  1. Install Bash using Homebrew
% brew install --formula bash
  1. Edit /etc/shells
% sudo vim /etc/shells
@anhkhoakz
anhkhoakz / git-browse.sh
Last active June 26, 2025 05:44
Open or copy the web URL for a file, directory, branch, or commit in a git repository
#!/usr/bin/env bash
# git-browse.sh - Open or copy the web URL for a file, directory, branch,
# or commit in a git repository.
#
# Usage: git-browse.sh [--dry-run] [--copy] [--path RELPATH] [target]
set -e
SCRIPT_NAME="$(basename "$0")"
@anhkhoakz
anhkhoakz / startup-time-of-zsh.md
Created June 10, 2025 07:56 — forked from laggardkernel/startup-time-of-zsh.md
Comparison of ZSH frameworks and plugin managers

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR

@anhkhoakz
anhkhoakz / project_dump.sh
Created June 9, 2025 05:15
File crawler that extracts all files from a directory into a single text file
#!/usr/bin/env bash
# File crawler that extracts all files from a directory into a single text file
# Handles both text and binary files appropriately
set -euo pipefail
SCRIPT_NAME=$(basename "$0")
readonly SCRIPT_NAME
@anhkhoakz
anhkhoakz / prezto-plugins-timer.sh
Last active June 9, 2025 18:12
Plugin loader for zprezto that measures loading time for each plugin.
#!/usr/bin/env zsh
#
# zprezto-plugin-timer - Measures loading time for zprezto plugins
#
# Sources plugins from either ~/.zprezto/modules or ~/.zprezto-contrib
# and reports the time taken to load each plugin with performance-based
# color coding.
set -e
-- AlfredGhostty Script v1.4.0
-- Latest version: https://paste.sr.ht/~anhkhoakz?search=GhosttyAlfred.applescript
-- Forked from https://github.com/zeitlings/alfred-ghostty-script
property NEW_TAB : "t"
property NEW_WINDOW : "n"
property NEW_SPLIT : "d"
property QUICK_TERMINAL : "qt"
property OPEN_MODE : NEW_TAB
property RUN_COMMAND : true