Skip to content

Instantly share code, notes, and snippets.

View tzing's full-sized avatar

Tzu-Ting tzing

  • Taipei, TW
  • 22:08 (UTC +08:00)
View GitHub Profile
#! /user/bin/env python3
"""
Checks how many colors are supported by the terminal.
Acknowledgements
================
The logic of this script is primarily based on the implementation found in:
- https://github.com/nodejs/node/blob/v24.2.0/lib/internal/tty.js
- https://github.com/chalk/supports-color
"""
@tzing
tzing / kubectl-rsync
Created May 17, 2025 10:32
rsync over kubectl
#! /bin/bash
# This script is inspired by following scripts:
# * https://serverfault.com/a/887402
# * https://github.com/dmrub/kube-utils/blob/master/kube-rsync
set -eo pipefail
if [[ -z "$KUBECTL_RSYNC_RSH" ]]; then
[[ -n "$KUBE_CONTEXT" ]] && echo >&2 "* Found \$KUBE_CONTEXT = $KUBE_CONTEXT"
[[ -n "$POD_NAMESPACE" ]] && echo >&2 "* Found \$POD_NAMESPACE = $POD_NAMESPACE"
@tzing
tzing / emoji.md
Last active January 12, 2018 06:10
autogenerated github emoji cheat sheet
πŸ‘ :+1: πŸ‘Ž :-1: πŸ’― :100:
πŸ”’ :1234: πŸ₯‡ :1st_place_medal: πŸ₯ˆ :2nd_place_medal:
πŸ₯‰ :3rd_place_medal: 🎱 :8ball: πŸ…°οΈ :a:
πŸ†Ž :ab: πŸ”€ :abc: πŸ”‘ :abcd:
πŸ‰‘ :accept: 🚑 :aerial_tramway: πŸ‡¦πŸ‡« :afghanistan:
✈️ :airplane: πŸ‡¦πŸ‡½ :aland_islands: ⏰ :alarm_clock:
πŸ‡¦πŸ‡± :albania: βš—οΈ :alembic: πŸ‡©πŸ‡Ώ :algeria:
πŸ‘½ :alien: πŸš‘ :ambulance: πŸ‡¦πŸ‡Έ :american_samoa: