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
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeNewsstandContentAvailability | | |
UIRemoteNotificationTypeBadge | | |
UIRemoteNotificationTypeSound | | |
UIRemoteNotificationTypeAlert)]; |
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
- (BOOL)isMobileNumber:(NSString *)mobileNum | |
{ | |
/** | |
* 手机号码 | |
* 移动:134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188 | |
* 联通:130,131,132,152,155,156,185,186 | |
* 电信:133,1349,153,180,189 | |
*/ | |
NSString * MOBILE = @"^1(3[0-9]|5[0-35-9]|8[025-9])\\d{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
#!/bin/bash | |
PATH_KVDB="/Users/Travis/Development/SAE/data/kvdb.txt"; | |
PATH_STORAGE="/Users/Travis/Development/SAE/data/Storage"; | |
clear;cd $1;echo "Start Project: $1" | |
dev_server.py index.wsgi --storage-path="${PATH_STORAGE}" --kvdb-file="${PATH_KVDB}" --mysql=root:[email protected]:3306 |
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
#Git 版本数 | |
VERSION_NUMBER=`git rev-list head | sort | wc -l | awk '{print $1}'` | |
#VERSION_HASH=`git rev-list head | head -1` | |
echo $VERSION_NUMBER | |
#echo $VERSION_HASH | |
##加入版本号 | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${VERSION_NUMBER}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
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
/** 获取国内手机号运营商 | |
* @param phone 手机号 | |
* @return `U`是联通,`M`是移动,`T`是电信 | |
*/ | |
+(NSString*)carrierOfPhone:(NSString*)phone{ | |
if (phone.length>11) { | |
//去掉乱七八糟的字符 | |
phone=[[phone componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"+- "]] componentsJoinedByString:@""]; | |
//如果86开头 去掉 |
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
"""Demonstration of tornado web server with werkzeug interactive debugger. | |
Ron DuPlain <[email protected]> | |
https://gist.github.com/rduplain/4983839 | |
2013-02-19 | |
* Python 2.7.3 | |
* Tornado 2.4.1 | |
* Werkzeug 0.8.3 |
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
Pod::Spec.new do |s| | |
s.version = "999.99" | |
s.source = { :http => "https://download.avoscloud.com/sdk/iOS/release-beta/AVOSCloud.framework.zip"} | |
s.platform = :ios, '5.0' | |
s.name = "AVOSCloud" | |
s.summary = "AVOS Cloud iOS SDK for mobile backend." | |
s.homepage = "http://avoscloud.com" |
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
#!/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 提供, 非常感谢有这么好的免费服务!" |
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
#!/bin/sh | |
NIC= | |
iptables -I FORWARD -i zt+ -j ACCEPT | |
iptables -I FORWARD -o zt+ -j ACCEPT | |
iptables -t nat -I POSTROUTING -o zt+ -j MASQUERADE | |
iptables -t nat -A POSTROUTING -o ${NIC} -j MASQUERADE |