Skip to content

Instantly share code, notes, and snippets.

View hanksudo's full-sized avatar
:octocat:
Follow your passion.

Hank Wang hanksudo

:octocat:
Follow your passion.
View GitHub Profile
@hanksudo
hanksudo / purgeAndroid.txt
Created March 20, 2018 15:24 — forked from tahmidsadik/purgeAndroid.txt
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
@hanksudo
hanksudo / class-private-publc.py
Created October 8, 2017 16:17
Python - class private publc
class Person:
def __init__(self):
pass
def _single(self):
print "single"
def __double(self):
print "double"
@hanksudo
hanksudo / monacoin-price-notifier.md
Last active October 8, 2017 11:00
Monacoin price notifier

Monacoin price notifier

Prerequisites

brew install jq

Installation

@hanksudo
hanksudo / enable-ant-aliasing-vscode.md
Last active September 27, 2023 12:30
Enable font anti-aliasing on VS Code
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 April 6, 2017 06:55
resolve too many opened files in Python
$ 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 February 21, 2017 08:27
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
hanksudo / ng-tokyo.md
Last active December 9, 2016 12:19
20161209 ng tokyo
@hanksudo
hanksudo / aws-cli-note.md
Last active January 12, 2020 15:15
AWS CLI note

AWS CLI Note

aws-cli - examples

STS - AWS Security Token Service

# whoami
aws sts get-caller-identity
@hanksudo
hanksudo / gist:847fd0c35afe7929f0abbbb780c86557
Last active March 8, 2024 23:42
Install PHP 7 on Ubuntu 12.04
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 June 28, 2016 06:48
Backup files to Dropbox
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__))