Skip to content

Instantly share code, notes, and snippets.

View demonnico's full-sized avatar
💭
📱📱📱

Nicholas Tau demonnico

💭
📱📱📱
View GitHub Profile
@demonnico
demonnico / SDK.podspec
Created June 13, 2013 11:13
cocoapod local pod config
Pod::Spec.new do |s|
s.name = 'SDK'
s.version = '1.0.0'
s.license = 'Commercial'
s.summary = 'SDK summary'
s.homepage = 'https://sdkhomepage.com/'
s.author = { 'SDK author' => 'https://sdkauthor.com/' }
s.source = { :git => '~/Desktop/SDK' }
s.platform = :ios
s.source_files = '**/*.h'
@demonnico
demonnico / Util.h
Last active December 21, 2015 17:29
nice helper to code.
#import <objc/runtime.h>
//iPhone4's wallpaper size in iOS7
#define kWallpaperSizeNomal CGSizeMake(370.0,598.0)
//iPhone5's wallpaper size in iOS7
#define kWallpaperSizeSpec CGSizeMake(372.0,696.0)
//esay to get the string value of patameter's name.
#define NameStringOfParam(param) [NSString stringWithFormat:@"%s", #param]
//add accessor(setter getter) for category by define.
#define SYNTHESIZE_CATEGORY_OBJ_PROPERTY(propertyGetter, propertySetter) \
@demonnico
demonnico / NSStirng+Util.m
Created December 3, 2013 05:39
get totally files size in directory
@impelementaton NSString(Utils)
+ (uint64_t)sizeAtPath:(NSString *)filePath diskMode:(BOOL)diskMode
{
uint64_t totalSize = 0;
NSMutableArray *searchPaths = [NSMutableArray arrayWithObject:filePath];
while ([searchPaths count] > 0)
{
@autoreleasepool
{
NSString *fullPath = [searchPaths objectAtIndex:0];
@demonnico
demonnico / check.m
Created December 9, 2013 14:41
check all app's version info in your iphone.
#import <dlfcn.h>
- (NSMutableArray *)browseInstalled
{
NSMutableArray *installedArray = installedApplications();
return installedArray;
}
typedef NSDictionary *(*PMobileInstallationLookup)(NSDictionary *params, id callback_unknown_usage);
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@demonnico
demonnico / resign.sh
Last active May 5, 2019 12:22
resign ipa file
#First of all, create a new plist file named 'channnel.plist' and refer into your project.
#Second, move codes below in 'didFinishLaunchingWithOptions'
#NSString * channelPath = [[NSBundle mainBundle] pathForResource:@"channel" ofType:@"plist"];
#NSDictionary*channelDic= [NSDictionary dictionaryWithContentsOfFile:channelPath];
#NSString * channelIdentify = [channelDic objectForKey:@"channel"];
#[MobClick startWithAppkey:UMENG_KEY reportPolicy:BATCH channelId:channelIdentify];
#last step, 'cd' into the folder where xxx.ipa is there.
#generally, it's the name of scheme
@demonnico
demonnico / statist.sh
Created June 14, 2013 07:37
统计项目中代码行数
//.m文件的行数
find . -name "*.m" | xargs wc -l
//.m .h .xib .c 文件内容总行数
find . -name "*.m" -or -name "*.h" -or -name "*.xib" -or -name "*.c" |xargs grep -v "^$"|wc -l