Skip to content

Instantly share code, notes, and snippets.

# 你可以从该 URL 下载这个配置文件: http://surge.run/config-example/ios.conf
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备
# Version 2.0
[General]
# 日志等级: warning, notify, info, verbose (默认值: notify)
loglevel = notify
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS
# 版本中,如果启用了 Set as System Proxy, 那么这些值会被写入到系统网络代理
# 设置中.)
# You can download this config from: http://surge.run/config-example/ios.conf
# Edit with your computer and copy back to iOS device via iTunes, URL, AirDrop
# or iCloud Drive
# Version 2.0
[General]
# Log level: warning, notify, info, verbose (Default: notify)
loglevel = notify
# Skip domain or IP range. These hosts will not be processed by Surge Proxy.
# (In macOS version when Set as System Proxy enabled, these hosts will be
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:animated];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:animated];
[Proxy]
WIFI = direct, interface=en2
VPN = direct, interface=utun0
[Rule]
DOMAIN-SUFFIX,yach.me,WIFI
FINAL,VPN
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0/9, 119.0.0.0/9, 119.128.0.0/10, 119.224.0.0/11, 120.0.0.0/10, 120.64.0.0/11, 120.128.0.0/11, 120.192.0.0/10,
var redis = require('redis');
redis.debug_mode = true;
var db = redis.createClient(process.env.NODE_ENV === 'development' ? '6379' : '6392');
var apns = require('apn');
var util = require('util');
var errorCallback = function(errcode, err) {
console.log(errcode, err);
};
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
CGFloat textWidth = [button.currentTitle sizeWithFont:button.titleLabel.font].width;
CGFloat imageWidth = button.currentImage.size.width;
CGFloat buttonWidth = button.frame.size.width;
CGFloat contentWidth = textWidth + 5 + imageWidth;
[button setTitleEdgeInsets:UIEdgeInsetsMake(0, - imageWidth + (buttonWidth - contentWidth) / 2.0f, 0, 0)];
[button setImageEdgeInsets:UIEdgeInsetsMake(2, contentWidth / 2.0f + buttonWidth / 2.0f - imageWidth, 0, 0)];
# Cocoapods
/Podfile.lock
/Pods
#import <UIKit/UIKit.h>
@protocol GEStaticTableViewDataSource, GEStaticTableViewDelegate;
@interface GEStaticTableView : UIView {
UIView *_selectMaskView;
}
@property (readonly, nonatomic) NSInteger numberOfRow;
- (void) imagePickerController: (UIImagePickerController *) picker
didFinishPickingMediaWithInfo: (NSDictionary *) info {
UIImage *image = (UIImage *) [info objectForKey:
UIImagePickerControllerOriginalImage];
NSArray *imageArray = [NSArray arrayWithObject:image];
NSMutableDictionary *sendSessionInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"ItemType", @"Photo", @"ImageArray", imageArray, nil];
[[picker parentViewController] dismissModalViewControllerAnimated: YES];
[picker release];