Skip to content

Instantly share code, notes, and snippets.

Follow your passion.

Hank Wang hanksudo

Follow your passion.
  • Taipei, Taiwan & Tokyo, Japan
View GitHub Profile
hanksudo /
Last active Oct 8, 2017
Monacoin price notifier

Monacoin price notifier


brew install jq


hanksudo /
Last active Oct 23, 2021
Enable font anti-aliasing on VS Code
vim /Applications/Visual\ Studio\

add to .editor-container section

-webkit-font-smoothing: antialiased;
hanksudo / too many opened
Created Apr 6, 2017
resolve too many opened files in Python
View too many opened
$ ulimit -a

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 3868
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
hanksudo /
Last active Feb 21, 2017
Find newest note of every number occur and also remove duplicate number.
import itertools
def summarize_notes(case):
found = set()
for note, numbers in case:
snumbers = set(numbers)
output = list(snumbers - found)
found |= snumbers
if output:
hanksudo /
Last active Dec 9, 2016
20161209 ng tokyo


aws-cli - examples

STS - AWS Security Token Service

# whoami
aws sts get-caller-identity
hanksudo / gist:847fd0c35afe7929f0abbbb780c86557
Last active Apr 20, 2018
Install PHP 7 on Ubuntu 12.04
View gist:847fd0c35afe7929f0abbbb780c86557
sudo apt-get install python-software-properties
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y

purge php5

sudo apt-get remove php5-common -y
hanksudo /
Last active Jun 28, 2016
Backup files to Dropbox
import sys
import os
import dropbox
from dropbox.files import WriteMode
from dropbox.exceptions import ApiError, AuthError
# (
TOKEN = ""
LOCAL_FOLDER = os.path.dirname(os.path.abspath(__file__))
hanksudo /
Created Apr 19, 2016
Copy public ssh key to remote
cat ~/.ssh/ | ssh pi@raspberrypi.local "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
hanksudo / list_supported_fonts.swift
Created Apr 15, 2016
List all supported fonts on iOS
View list_supported_fonts.swift
for (familyName) in UIFont.familyNames() {
print("\nFamily: ", familyName.utf8)
let fontNames = UIFont.fontNamesForFamilyName(familyName)
for (fontName) in fontNames {
print("\tFont: ", fontName.utf8)