Skip to content

Instantly share code, notes, and snippets.

View therealechan's full-sized avatar

Ed therealechan

  • Beansmile
  • 20:54 (UTC +08:00)
View GitHub Profile

###Note Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

[UPDATE : Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.]

[UPDATE 2:The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead]

##[UPDATE 3: For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached]

@therealechan
therealechan / Update server time.md
Last active June 22, 2016 03:26
Linux : Add x seconds to the current date
  • add 5 seconds to the current time: $ date -s "5 seconds"
  • minus 5 seconds to the current time: $ date -s "5 seconds ago"
[Proxy]
WIFI = direct, interface=en2
VPN = direct, interface=utun0
[Rule]
DOMAIN-SUFFIX,yach.me,WIFI
FINAL,VPN
@therealechan
therealechan / readme.txt
Created December 4, 2015 07:28 — forked from fqrouter/readme.txt
shadowsocks 公共代理的必要设置
good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。
但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能)
本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考
https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks
1、 shadowsocks的timeout设置
超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。
2、 检查操作系统的各种限制
对于openvz的vps,特别需要检查一下
@therealechan
therealechan / keyrepeat.shell
Created October 14, 2015 06:18 — forked from rastasheep/keyrepeat.shell
Enable key repeat in Apple Lion for Atom in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Atom if you're running vim mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@therealechan
therealechan / fix_413_nginx_error.md
Created September 15, 2015 05:52
Nginx: 413 Request Entity Too Large Error and Solution

sudo vi /opt/nginx/conf/nginx.conf

Add the following line to http or server or location context to increase the size limit in nginx.conf, enter:

# set client body size to 2M #
client_max_body_size 2M;
@therealechan
therealechan / create pg database via cap command.md
Created August 21, 2015 04:13
Create pg database via cap command
default: &default
  adapter: postgresql
  encoding: utf8
  # For details on connection pooling, see rails configuration guide
  # http://guides.rubyonrails.org/configuring.html#database-pooling
  pool: 5
  template: template0 # must added!
@therealechan
therealechan / delete all except one or two.md
Created August 6, 2015 05:40
Delete all files expect one or two

ls | grep -v 'file-to-keep' | xargs rm

@therealechan
therealechan / config multiple website with Nginx.md
Last active July 18, 2016 06:37
config multiple website with Nginx

in /opt/nginx/conf/nginx.conf, to include the folder call sites-enabled

http { ... include /opt/nginx/conf/sites-enabled/*; ... }

Then mkdir sites-enabled and sites-available folder in /opt/nginx/conf/

@therealechan
therealechan / install redis to ubuntu.md
Created May 14, 2015 07:34
Install Redis to Ubuntu