... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| function extend(Child, Parent) { | |
| var F = function(){}; | |
| F.prototype = Parent.prototype; | |
| Child.prototype = F(); | |
| Child.prototype.constructor = Child; | |
| Child.uber = Parent.prototype; | |
| } |
| class CORSResource(object): | |
| """ | |
| Adds CORS headers to resources that subclass this. | |
| """ | |
| def create_response(self, *args, **kwargs): | |
| response = super(CORSResource, self).create_response(*args, **kwargs) | |
| response['Access-Control-Allow-Origin'] = '*' | |
| response['Access-Control-Allow-Headers'] = 'Content-Type' | |
| return response |
| redswallow.me/blog/ | |
| http://www.soimort.org | |
| http://lilydjwg.is-programmer.com/ | |
| http://weibo.com/qinjianxiang | |
| http://rango.swoole.com/ | |
| http://www.guangla.com | |
| www.renren.com/profile.do?id=250805736 | |
| http://blog.cooer.net | |
| https://twitter.com/clowwindy | |
| http://skora.net |
| import requests | |
| class GithubWalker(object): | |
| token = None | |
| source_user = None | |
| api_url_base = 'https://api.github.com' | |
| user_has_walked = set() | |
| user_id_wait_walk = [] |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| <?php | |
| $arrStr = var_export($arr, true); |
| keys = map(lambda element: element.strip(), keys) |
| if len(gs) == len(keys): | |
| gs_dict = dict(zip(keys, gs)) |
| #! /usr/bin/env python | |
| import argparse | |
| import sys | |
| import re | |
| import time | |
| line_nginx_full = re.compile(r"""(?P<ipaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?P<dateandtime>\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] ((\"(GET|POST) )(?P<url>.+)(http\/1\.1")) (?P<statuscode>\d{3}) (?P<bytessent>\d+) (["](?P<refferer>(\-)|(.+))["]) (["](?P<useragent>.+)["])""", | |
| re.IGNORECASE) | |
| line_nginx_onlyStatus = re.compile(r'.+HTTP\/1\.1" (?P<statuscode>\d{3})') |