Skip to content

Instantly share code, notes, and snippets.

View cruffenach's full-sized avatar

Collin Ruffenach cruffenach

View GitHub Profile
BOOL noError(NSError **error) {
return (error && [*error code] == 0);
}
BOOL hasError(NSError **error) {
return !noError(error);
}
BOOL deleteFileAtPath(NSString *path, NSError **error) {
BOOL success = [[NSFileManager defaultManager] removeItemAtPath:path error:error];
10. Non-Solicitation and Non-Compete. During this Agreement and for three (3) years thereafter, The Consultant will not hire, solicit for hire, use, and/or contract any individual previously unknown to him/her who was or is a First Planet Software employee or independent contractor during the term of this Agreement, will not hire or work for previously known colleagues with the intention to join forces and copy, knock off or duplicate The Company’s projects, and he/she will not contact any of The Company’s customers or clients learned of or served by him/herself to solicit similar work for The Consultant or perform similar work for any other business which may employ The Consultant on a competitive product.
@cruffenach
cruffenach / gist:4612102
Created January 23, 2013 19:43
Hack to clear notification center and avoid duplicate notifications
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
[[UIApplication sharedApplication] cancelAllLocalNotifications];
//This line
NSFileManager *mockFileManager = mock([NSFileManager class]);
/*
Causes these build errors
Undefined symbols for architecture i386:
"_llvm_gcda_emit_arcs", referenced from:
___llvm_gcov_writeout in OCMockitoIOS(MKTObjectMock.o)
failed: -[NSConcreteData instanceMethodSignatureForSelector:]: unrecognized selector sent to instance
// save parent to disk asynchronously
[mainMOC performBlock:^{
NSError *error;
if (![mainMOC save:&error])
{
// handle error
}
}];
Number add(Number a, Number b) {
return a + b;
}
Number add(Number a, Number b) {
return a + b;
}
void main() {
Number myAge = 26;
Number jamesAge = 28;
Number together = add(myAge, jamesAge);
String myName = "Collin Ruffenach"
This is code on GitHub for instance