Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Follow your passion.

Hank Wang hanksudo

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

Monacoin price notifier

Prerequisites

brew install jq

Installation

@hanksudo
hanksudo / enable-ant-aliasing-vscode.md
Last active Oct 23, 2021
Enable font anti-aliasing on VS Code
View enable-ant-aliasing-vscode.md
vim /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css

add to .editor-container section

-webkit-font-smoothing: antialiased;
@hanksudo
hanksudo / too many opened files.md
Created Apr 6, 2017
resolve too many opened files in Python
View too many opened files.md
$ 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
hanksudo / summarize_notes.py
Last active Feb 21, 2017
Find newest note of every number occur and also remove duplicate number.
View summarize_notes.py
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
hanksudo / ng-tokyo.md
Last active Dec 9, 2016
20161209 ng tokyo
View ng-tokyo.md
View aws-cli-note.md

AWS CLI Note

aws-cli - examples

STS - AWS Security Token Service

# whoami
aws sts get-caller-identity
@hanksudo
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
hanksudo / backup_to_dropbox.py
Last active Jun 28, 2016
Backup files to Dropbox
View backup_to_dropbox.py
import sys
import os
import dropbox
from dropbox.files import WriteMode
from dropbox.exceptions import ApiError, AuthError
# (https://blogs.dropbox.com/developers/2014/05/generate-an-access-token-for-your-own-account/)
TOKEN = ""
LOCAL_FOLDER = os.path.dirname(os.path.abspath(__file__))
@hanksudo
hanksudo / send_public_key_to_remote.sh
Created Apr 19, 2016
Copy public ssh key to remote
View send_public_key_to_remote.sh
cat ~/.ssh/id_rsa.pub | ssh pi@raspberrypi.local "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
@hanksudo
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)
}
}