This file contains 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
git log --pretty=oneline --abbrev-commit --since='yesterday' --author='Eliasz Sawicki' |
This file contains 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
git log --pretty=oneline --abbrev-commit --since='yesterday' --author='Eliasz Sawicki' | mail -s "Update" "eliasz.sawicki@gmail.com" |
This file contains 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
@interface Task : NSObject <NSCoding> | |
@property (nonatomic, strong) NSString *name; | |
- (instancetype)initWithName:(NSString *)name; | |
@end |
This file contains 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
@implementation Task | |
- (instancetype)initWithName:(NSString *)name { | |
self = [super init]; | |
if (self) { | |
self.name = name; | |
} | |
return self; | |
} |
This file contains 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
- (void)saveTasks { | |
NSMutableArray *tasksToSave = [NSMutableArray new]; | |
for (NSInteger i = 0 ; i < 5; i ++) { | |
NSString *taskName = [NSString stringWithFormat:@"%d", arc4random_uniform(50)]; | |
Task *task = [[Task alloc] initWithName:taskName]; | |
[tasksToSave addObject:task]; | |
} | |
NSString *path = @"~/Documents/"; | |
path = [path stringByAppendingString:@"FILE_NAME"]; |
This file contains 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
- (void)loadTasks { | |
NSString *path = @"~/Documents/"; | |
path = [path stringByAppendingString:@"FILE_NAME"]; | |
path = [path stringByExpandingTildeInPath]; | |
NSMutableDictionary *rootObject = [NSKeyedUnarchiver unarchiveObjectWithFile:path]; | |
NSArray *tasks = rootObject[@"myTasks"]; | |
for (NSInteger i = 0; i < tasks.count; i++) { |
This file contains 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
@protocol NSCoding | |
- (void)encodeWithCoder:(NSCoder *)aCoder; | |
- (id)initWithCoder:(NSCoder *)aDecoder; // NS_DESIGNATED_INITIALIZER | |
@end |
This file contains 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
xcrun simctl list | grep "Booted" |
This file contains 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
[[EKEventStore new] requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { | |
if (granted) { | |
NSLog(@"Access to calendar granted"); | |
} else { | |
NSLog(@"No access to calendar"); | |
} | |
}]; |
This file contains 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
NSArray *calendars = [[EKEventStore new] calendarsForEntityType:EKEntityTypeEvent]; |
OlderNewer