Skip to content

Instantly share code, notes, and snippets.

View erizhang's full-sized avatar
🎯
Focusing

Eric Zhang erizhang

🎯
Focusing
View GitHub Profile
@erizhang
erizhang / flag_downloader.py
Last active June 24, 2017 10:55
This script is used to download the flag images from web www.sciencekids.co.nz
#!/usr/bin/python
import urllib
countries = [
'Afghanistan',
'Albania',
'Algeria',
'Andorra',
'Angola',
@erizhang
erizhang / decorator_sample.py
Created June 24, 2017 10:58
Learn python decorator samples
def a_decorator_passing_arbitrary_arguments(function_to_decorate):
def wrapper(*args, **kwargs):
print "Do I have args?:"
print args
print kwargs
function_to_decorate(*args, **kwargs)
return wrapper
@erizhang
erizhang / format-git-log.sh
Created September 18, 2019 09:01
One awk script to format the output of git log to statistics the file change and LoC insertions/deletions
#git log --shortstat --since="1 Jan, 2019" > log.txt
BEGIN {
commit="";
date="";
file=0;
add=0;
del=0;
}