Skip to content

Instantly share code, notes, and snippets.

View zhugexiaobo's full-sized avatar
🐽
ahhhhhhhh

Pid zhugexiaobo

🐽
ahhhhhhhh
View GitHub Profile
@zhugexiaobo
zhugexiaobo / Resign-ipa.md
Created April 23, 2024 03:06
How to Resign an IPA
  1. Prepare New Signing Assets
$ security cms -D -i path/to/MyProfile.mobileprovision > provision.plist
$ /usr/libexec/PlistBuddy -x -c 'Print :Entitlements' provision.plist > entitlements.plist
  1. Replace Provisioning Profile
@zhugexiaobo
zhugexiaobo / NSArray+NullReplacement.m
Created May 28, 2014 08:49
Replace all NSNull objects in an NSArray
@interface NSArray (NullReplacement)
- (NSArray *)arrayByReplacingNullsWithBlanks;
@end
@implementation NSArray (NullReplacement)
- (NSArray *)arrayByReplacingNullsWithBlanks {
@zhugexiaobo
zhugexiaobo / NSDictionary+NullReplacement.m
Created May 28, 2014 08:47
Replace all NSNull objects in an NSDictionary
@interface NSDictionary (NullReplacement)
- (NSDictionary *)dictionaryByReplacingNullsWithBlanks;
@end
@implementation NSDictionary (NullReplacement)
- (NSDictionary *)dictionaryByReplacingNullsWithBlanks {
@zhugexiaobo
zhugexiaobo / compare-2-nsdate
Last active August 29, 2015 13:56
比较2个 NSDate
if ([date1 compare:date2] == NSOrderedDescending) {
NSLog(@"date1 is later than date2");
} else if ([date1 compare:date2] == NSOrderedAscending) {
NSLog(@"date1 is earlier than date2");
} else if ([date1 compare:date2] == NSOrderedSame) {
NSLog(@"dates are the same");
}
@zhugexiaobo
zhugexiaobo / cellphone-num-check
Created February 21, 2014 08:00
国内手机号检测
+ (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}$";
/**
10 * 中国移动:China Mobile
@zhugexiaobo
zhugexiaobo / updateRepo.sh
Created August 29, 2013 10:30
批量 git pull 仓库最新代码
#!/bin/sh
for dir in $(ls -d */)
do
if [ -d "$dir"/.git ]; then
echo "$dir" && cd "$dir" && git pull && cd ..
fi
done
//
// CLLocation+Sino.h
//
// Created by i0xbean@gmail.com on 13-4-26.
// 火星坐标系转换扩展
//
// earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换
// 未包含 mars2earth. 需要这个可参考 http://xcodev.com/131.html
#import <CoreLocation/CoreLocation.h>
soga,2=▔▽▔
qushi,2=(´▽` )
shima,2=( ̄m ̄)
haokeai,2=(*^-^*)
lala,2=♪(^∇^*)
kongbu,2=┌(。Д。)┐
nihao,2=( ̄▽ ̄)ノ
haoxihuan,2=(≧∇≦)ノ
jiujiuwo,2=_(__)ノ彡
chidiao,2=ψ(`∇´)ψ