Skip to content

Instantly share code, notes, and snippets.

View EkkoG's full-sized avatar

Ekko EkkoG

View GitHub Profile

Run Flask app with aiohttp and uvloop

hello_world.py

"""Simple demo of using Flask with aiohttp via aiohttp-wsgi's
WSGIHandler.

"""

Rust Iron local server, thread 12

$ wrk --latency -t12 -c100 -d10s http://localhost:3000/
Running 10s test @ http://localhost:3000/
  12 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     9.03ms    3.30ms 100.96ms   91.08%
    Req/Sec   509.25    356.39     2.62k    44.51%
  Latency Distribution
@EkkoG
EkkoG / build.yaml
Last active September 20, 2017 08:20
project_path: ahh
worspace_name: ahh
log_path: builds/log/
builds_path: builds
last_build_commit_file: ahh
last_try_build_commit_file: ahh
git_pull_before_build: true
send_ding_msg_after_build:
@EkkoG
EkkoG / af_custom_http_body
Created May 3, 2017 06:17
Custom http body use af 3.x
NSMutableURLRequest *req = [[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:@"https://example.com" parameters:@{} error:nil];
NSString *body = @"...";
req.HTTPBody = [body dataUsingEncoding:NSUTF8StringEncoding];
AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:configuration];
NSURLSessionDataTask *task = [manager dataTaskWithRequest:req completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
}];
[task resume];
@EkkoG
EkkoG / turbo-qiniu.sh
Created February 21, 2017 07:03 — forked from trawor/turbo-qiniu.sh
本脚本解决部分地区七牛上传速度慢的问题
#!/bin/bash
#
# 通过对比 ping 响应时间,找到本机最快的上传ip
# [email protected]
#
# 使用方法:
# sh -c "$(curl -sSL https://gist.githubusercontent.com/trawor/5dda140dee86836b8e60/raw/turbo-qiniu.sh)"
echo "# 这个脚本理论上可以帮你获取任意域名的最快速的IP"
echo "# 获取IP列表的服务由 17ce.com 提供, 非常感谢有这么好的免费服务!"
@EkkoG
EkkoG / js_match.js
Last active October 12, 2016 15:53
var str = '血红蛋白(123,g/L) 血红蛋白(1209803,g/L) 血红蛋白(19821,g/L)';
var regexp = /\((\d+)/g;
while (true) {
var r = regexp.exec(str);
if (r != null) {
console.log(r[1]);
}
else {
break;
}
@EkkoG
EkkoG / keybase.md
Last active November 25, 2021 14:09

Keybase proof

I hereby claim:

  • I am EkkoG on github.
  • I am cielpy (https://keybase.io/cielpy) on keybase.
  • I have a public key whose fingerprint is 9297 A80C AFDD 5466 5A0F 6349 E471 9567 F093 EC19

To claim this, I am signing this object:

#!/bin/sh
NAME=shadowsocks
SERVERS=servers
dns="119.29.29.29"
uci_set_by_type() {
uci set $NAME.$1.$2=$3 2>/dev/null
}
#!/bin/bash
usage()
{
echo "usage: 使用命令行提交 Merge Request,参数如下:
-p 源工程 ID
-s 源工程分支
-d 目标工程 ID
-t 目标工程分支
-u 用户 ID
#!/bin/bash
usage()
{
echo "git commit,可使用 -d 附加信息类型,如:
-d add [添加]
-d mod [修改]
-d fix [修复]" 1>&2;
exit 1;
}