This file contains 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
areaName | checkKey | countryCode | phoneCode | |
---|---|---|---|---|
中国大陆 | ^(86){0,1}1\\d{10}$ | CN | 86 | |
中国香港 | ^(00){0,1}(852){1}0{0,1}[1,5,6,9,4](?:\\d{7}|\\d{8}|\\d{12})$ | HK | 852 | |
中国澳门 | ^(00){0,1}(853){1}6\\d{7}$ | MO | 853 | |
中国台湾 | ^(00){0,1}(886){1}0{0,1}[6,7,9](?:\\d{7}|\\d{8}|\\d{10})$ | TW | 886 | |
韩国 | ^(00){0,1}(82){1}0{0,1}[7,1](?:\\d{8}|\\d{9})$ | KR | 82 | |
日本 | ^(00){0,1}(81){1}0{0,1}[7,8,9](?:\\d{8}|\\d{9})$ | JP | 81 | |
美国 | ^(00){0,1}(1){1}\\d{10,12}$ | US | 1 | |
加拿大 | ^(00){0,1}(1){1}\\d{10}$ | CA | 1 | |
英国 | ^(00){0,1}(44){1}[347-9](\\d{8,9}|\\d{11,12})$ | GB | 44 |
This file contains 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
# Idea taken from https://gist.github.com/jackcarter/d86808449f0d95060a40 | |
# This script requires python lib: requests | |
# You can install by: `python -m pip install requests` | |
import time | |
import codecs | |
import requests | |
reader = codecs.getreader("utf-8") |
This file contains 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
# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |
This file contains 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
upstream my_app { | |
# server unix:///apps/my_app/tmp/sockets/puma.sock fail_timeout=0; | |
server unix:///apps/my_app/tmp/sockets/puma.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name my_appms.example.com; | |
root /apps/my_app/public; |
This file contains 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
###################### | |
## shadowsocks-libev | |
###################### | |
# install dependencies | |
yum install epel-release -y | |
yum install gcc gettext autoconf libtool automake make pcre-devel asciidoc xmlto udns-devel libev-devel -y | |
# install shadowsocks-libev | |
cd /etc/yum.repos.d/ |
This file contains 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
#cd /etc/caddy/Caddyfile | |
example.com { | |
root /usr/share/nginx/html | |
gzip | |
log /var/log/caddy/access.log | |
#fastcgi / unix:/var/run/php-fpm/php-fpm.sock php # Fast CGI php interpreter | |
#fastcgi / fastcgi / 127.0.0.1:9000 php # Fast CGI php interpreter | |
#using with laravel | |
fastcgi / unix:/var/run/php-fpm/php-fpm.sock php { | |
index index.php |
This file contains 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
https://domain { | |
gzip | |
root /apps/app/public | |
log dev.access.log | |
proxy / unix:///apps/app/tmp/sockets/puma.sock { | |
fail_timeout 300s | |
transparent | |
header_upstream X-Forwarded-Ssl on | |
except /assets /fonts /robots.txt /favicon.ico /404.html /422.html /500.html |
This file contains 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
# Why do we need KudeURI? Because the URI.join method doing something stupid: | |
# | |
# URI.join('http://example.com/subpath', 'hello', '?token=secret') | |
# => “http://example.com/hello?token=secret” | |
# | |
# But what I expected is “http://example.com/subpath/hello?token=secret", the subpath is gone. | |
# By using SmartURI, you can handle the case above gracefully: | |
# | |
# SmartURI.join('http://example.com/subpath', 'hello', query: { token: secret }) | |
# => "http://example.com/subpath/hello?token=secret" |
This file contains 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
# 规则配置仅供参考,适用于 Surge iOS & Mac; | |
# 包含 Proxy Group、URL Rewrite 特性 | |
# 包含 Reject 规则,用于拦截广告、行为分析、数据统计 | |
# 屏蔽 Hao123、百度联盟广告以及部分运营商网页漂浮广告 | |
# 部分特性可能仅适用于最新的 TestFlight 版本 | |
[General] | |
# warning, notify, info, verbose | |
loglevel = notify | |
ipv6 = true |
This file contains 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
[General] | |
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local | |
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12 | |
dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114 | |
loglevel = notify | |
[Proxy] | |
Proxy = custom,hk2.iss.tf,8989,aes-256-cfb,40997300,http://surge.pm/ss.module | |
[Rule] |
NewerOlder