里程碑及产出
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 python | |
# -*- coding: utf-8 -*- | |
import re | |
import urllib2 | |
import datetime | |
html = urllib2.urlopen('http://blog.csdn.net/zjerryj').read() | |
mo = re.search(r'访问:<span>(\d+)次</span>', html) |
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
alias gl='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --date=relative' |
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
# -*- coding: utf-8 -*- | |
import time | |
import os.path | |
import asyncio | |
import logging | |
import argparse | |
import websockets | |
from collections import deque | |
from urllib.parse import urlparse, parse_qs |
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
(import 'java.security.MessageDigest | |
'java.math.BigInteger) | |
(defn md5 [s] | |
(let [algorithm (MessageDigest/getInstance "MD5") | |
size (* 2 (.getDigestLength algorithm)) | |
raw (.digest algorithm (.getBytes s)) | |
sig (.toString (BigInteger. 1 raw) 16) | |
padding (apply str (repeat (- size (count sig)) "0"))] | |
(str padding sig))) |
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
def import_submodules(package) -> None: | |
package = importlib.import_module(package) | |
for _, name, is_pkg in pkgutil.iter_modules(package.__path__): | |
full_name = package.__name__ + '.' + name | |
if is_pkg: | |
import_submodules(full_name) | |
else: | |
importlib.import_module(full_name) | |
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
from typing import Any, Iterable, List, Dict | |
from decimal import Decimal | |
from datetime import datetime | |
from sqlalchemy import Row | |
from sqlalchemy.orm import DeclarativeMeta | |
def row_to_dict(row) -> dict: | |
if isinstance(row, Row): |
OlderNewer