This file contains hidden or 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
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion `cd ${PROJECT_DIR} && git rev-list head | sort | wc -l | awk '{print $1}'`" "${INFOPLIST_FILE}" |
This file contains hidden or 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
sudo kextunload /System/Library/Extensions/AppleHDA.kext | |
sudo kextload /System/Library/Extensions/AppleHDA.kext |
This file contains hidden or 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
- (id)fromViews:(NSArray *)views findViewWithClass:(Class)viewClass { | |
id retView = nil; | |
for (UIView * subView in views) { | |
if ([subView isKindOfClass:[UIAlertView class]]) { | |
retView = subView; | |
break; | |
} else { | |
if ([subView.subviews count]) { | |
retView = [self fromViews:subView.subviews findViewWithClass:viewClass]; | |
} |
This file contains hidden or 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
+ (NSDateFormatter *)dateFormatter { | |
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
dateFormatter.locale = [[NSLocale preferredLanguages] objectAtIndex:0]; | |
dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss'Z'"; | |
return dateFormatter; | |
} |
This file contains hidden or 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
buildappw() { | |
~/Script/xctool/xctool.sh -workspace "$@".xcworkspace -scheme "$@" build | |
} |
This file contains hidden or 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
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth, float ovalHeight) { | |
float fw, fh; | |
if (ovalWidth == 0 || ovalHeight == 0) { | |
CGContextAddRect(context, rect); | |
return; | |
} | |
CGContextSaveGState(context); | |
CGContextTranslateCTM(context, CGRectGetMinX(rect), CGRectGetMinY(rect)); |
This file contains hidden or 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
sbin/mount -uaw # | |
rm /var/db/.AppleSetupDone | |
reboot |
This file contains hidden or 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
static NSInteger daysRemainInCurrentMonth () { | |
return ([[NSCalendar currentCalendar] rangeOfUnit:NSDayCalendarUnit inUnit:NSMonthCalendarUnit forDate:[NSDate date]].length - [[({NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"dd"]; formatter;}) stringFromDate:[NSDate date]] integerValue]); | |
} |
This file contains hidden or 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
sudo chown -R $USER /path/to |
This file contains hidden or 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
brew install libtool | |
brew link libtool |
OlderNewer