Skip to content

Instantly share code, notes, and snippets.

View EkkoG's full-sized avatar

Ekko EkkoG

View GitHub Profile
@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
# Travis@fir.im
#
# 使用方法:
# 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;
}
@EkkoG
EkkoG / surf.conf
Last active August 24, 2016 16:51 — forked from networkextension/surf.conf
surf.conf
# A.BIG.T rule config
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备
# Version 2.0
[General]
# 日志等级: error,warning, notify, info, verbose (默认值: info)
loglevel = info
# 跳过某个域名或者 IP 段,这些目标主机将不会由 A.BIG.T 处理。
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
# 强制使用特定的 DNS 服务器
CPYCustomTableHeadView *head = [[CPYCustomTableHeadView alloc] init];
// 绑定数据
head.data = data;
// 告诉布局系统需要马上布局
[head setNeedsLayout];
[head layoutIfNeeded];
self.tableView.tableHeaderView = head;