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
- (NSDate *)midnightDateForDate:(NSDate *)date { | |
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
NSDateComponents *components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) | |
fromDate:date]; | |
[components setHour:0]; | |
return [calendar dateFromComponents:components]; | |
} |
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
## | |
## minimize 'sudo' as much as possible | |
## | |
## | |
## note that this file is not meant to be RUN directly | |
## - consider this specific file simply a list of steps to complete | |
## - ie: copy and paste parts of this to your command line! | |
## |
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
// http://stackoverflow.com/questions/13122210/dynamically-format-a-float-in-a-nsstring | |
int precision = 2; | |
NSString *whatever=[NSString stringWithFormat:@"My float: %.*f", precision,aFloat]; | |
// Asterisk in place of 2^^ ^^^^^^^^^ int variable |
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
// | |
// AppDelegate | |
// | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
UIViewController *root = nil; // replace this line! | |
self.window.rootViewController = root; | |
[self.window makeKeyAndVisible]; | |
return YES; |
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
## | |
## Most Audio Units install to this location: | |
## | |
cd /Library/Audio/Plug-Ins/Components | |
## | |
## Other Audio Units install to: | |
## | |
cd ~/Library/Audio/Plug-Ins/Components |
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
// | |
// Sharing an instance | |
// | |
+ (id)sharedInstance { | |
static SharedInstanceClass *instance = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
instance = [[self alloc] init]; | |
}); |
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
. ~/.bash_colors | |
if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
. $(brew --prefix)/etc/bash_completion | |
export PS1=$txtred'[\W]'$txtylw'$(__git_ps1)'$txtrst' \$ ' | |
fi | |
export GIT_PS1_SHOWUPSTREAM=auto | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
export GIT_PS1_SHOWSTASHSTATE=1 |
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
https://github.com/kif-framework/KIF | |
http://cocoadocs.org/docsets/KIF/2.0.0/ | |
http://cocoadocs.org/docsets/KIF/2.0.0/Classes/KIFUITestActor.html#//api/name/waitForViewWithAccessibilityLabel: | |
https://github.com/kif-framework/KIF/blob/master/Documentation/Examples/Testable/Acceptance%20Tests/IntegrationTestCases.m | |
The first thing you will want to do is set up a test target you will be using for KIF. |
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
## http://www.ruby-doc.org/gems/docs/d/davidtrogers-cucumber-0.6.2/Cucumber/Ast/Table.html |
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
txtblk='\[\e[0;30m\]' # Black - Regular | |
txtred='\[\e[0;31m\]' # Red | |
txtgrn='\[\e[0;32m\]' # Green | |
txtylw='\[\e[0;33m\]' # Yellow | |
txtblu='\[\e[0;34m\]' # Blue | |
txtpur='\[\e[0;35m\]' # Purple | |
txtcyn='\[\e[0;36m\]' # Cyan | |
txtwht='\[\e[0;37m\]' # White | |
bldblk='\[\e[1;30m\]' # Black - Bold | |
bldred='\[\e[1;31m\]' # Red |