This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Web crawler and analysis of matrix67's ideagen | |
Author: Ming Wen | |
""" | |
from bs4 import BeautifulSoup | |
from urllib.request import urlopen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Author: Ming Wen ([email protected]) | |
This script is used to track the changes in the github, and if a new commit | |
is found, update the local repository accordingly. | |
""" | |
from urllib.request import urlopen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Author: Ming Wen ([email protected]) | |
When resolving conflicts on a merge or rebase, this script | |
automates `git add/rm` and `git checkout` with --ours or --theirs | |
for a large batch of changes. | |
Usage: `python3 git_batch_resolver.py` in your git repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from datetime import datetime, timedelta | |
from multiprocessing import Process | |
import random | |
def work(t): | |
current_time = datetime.now() | |
delta = timedelta(seconds=t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import collections | |
import json | |
def parse(filename): | |
res = [] | |
with open(filename, "r") as fd: | |
lines = fd.readlines() | |
for line in lines: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Author: Ming Wen ([email protected]) | |
This python script calculates compound interest: | |
1. Given (initial assets value, investment per year, growth rate, number of years), | |
find out final assets value. |