This file contains hidden or 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 socket | |
| import os | |
| from tornado import gen | |
| # class _ReleasingContextManager(object): | |
| # def __init__(self, obj, future): |
This file contains hidden or 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 | |
| """Wait for all subtasks have done. | |
| """ | |
| import tornado | |
| import tornado.locks | |
| from tornado.concurrent import Future | |
| class ProcessWaiter(tornado.locks._TimeoutGarbageCollector): |
This file contains hidden or 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 sys | |
| import struct | |
| filename = sys.argv[1] | |
| with open(filename, 'rb') as f: | |
| f.seek(12) | |
| list_start = struct.unpack('>I', f.read(4))[0] | |
| words_start = struct.unpack('>I', f.read(4))[0] |
This file contains hidden or 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 unittest | |
| import asyncio | |
| import inspect | |
| def async_test(f): | |
| def wrapper(*args, **kwargs): | |
| if inspect.iscoroutinefunction(f): | |
| future = f(*args, **kwargs) | |
| else: |
This file contains hidden or 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 requests | |
| from pyquery import PyQuery as PQ | |
| import urllib2 | |
| import sys | |
| from bs4 import BeautifulSoup | |
| from multiprocessing import Pool | |
| from functools import partial | |
| import codecs | |
| import re |
This file contains hidden or 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 requests | |
| from pyquery import PyQuery as PQ | |
| import urllib2 | |
| import sys | |
| from bs4 import BeautifulSoup | |
| from multiprocessing import Pool | |
| from functools import partial | |
| import codecs | |
| import re |
This file contains hidden or 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
| ! | |
| function (a) { | |
| String.prototype.trim === a && (String.prototype.trim = function () { | |
| return this.replace(/^\s+|\s+$/g, "") | |
| }), Array.prototype.reduce === a && (Array.prototype.reduce = function (b) { | |
| if (void 0 === this || null === this) throw new TypeError; | |
| var c, d = Object(this), | |
| e = d.length >>> 0, | |
| f = 0; | |
| if ("function" != typeof b) throw new TypeError; |
This file contains hidden or 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
| #!/bin/bash | |
| ##################################### | |
| #Author: Leon Lee # | |
| #email: lendylongli@gmail.com # | |
| #QQ: 730395591 # | |
| #Version: 1.0 # | |
| #Note: If you have some good ideas # | |
| # or advice, please mail me^^ # | |
| ##################################### |
This file contains hidden or 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/python | |
| #coding=utf-8 | |
| import os | |
| from Queue import Queue | |
| import sys | |
| import threading | |
| def get_dict(word): | |
| text = os.popen('dict %s' % word).read() | |
| q.put('\n' + '-'*10 + '海词' + '-'*10 + '\n' + text) |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> |