Skip to content

Instantly share code, notes, and snippets.

View JobsDong's full-sized avatar

JobsDong JobsDong

  • Alibaba
  • HangZhou, China
View GitHub Profile
@JobsDong
JobsDong / sub.py
Last active May 4, 2018 07:55 — forked from FZambia/sub.py
使用tornado将命令行操作包装成异步
#!/usr/bin/python2.7
#-*- coding=utf-8 -*-
import shlex
import subprocess
from tornado.gen import coroutine, Task, Return
from tornado.process import Subprocess
from tornado.ioloop import IOLoop
@coroutine
@JobsDong
JobsDong / HttpUtils.java
Last active August 29, 2015 14:03
charset detect in web crawling
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;