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
tell application "Notes" | |
set theNotes to every note of the folder "Notes" | |
repeat with thisNote in theNotes | |
set myTitle to the name of thisNote | |
set myText to the body of thisNote | |
set myCreateDate to the creation date of thisNote | |
tell application "Evernote" | |
create note with html myText ¬ | |
title myTitle ¬ | |
created myCreateDate ¬ |
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
- (UIImage *)createCroppedImageFromImage:(UIImage *)image { | |
float scale = 1.0f/self.scrollView.zoomScale; | |
CGRect visibleRect; | |
visibleRect.origin.x = self.scrollView.contentOffset.x * scale; | |
visibleRect.origin.y = self.scrollView.contentOffset.y * scale; | |
visibleRect.size.width = self.scrollView.bounds.size.width * scale; | |
visibleRect.size.height = self.scrollView.bounds.size.height * scale; |
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
// Returns the persistent store coordinator for the application. | |
// If the coordinator doesn't already exist, it is created and the application's store added to it. | |
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator | |
{ | |
if (!_persistentStoreCoordinator) { | |
NSURL *storeURL = [[[NSFileManager defaultManager] applicationDocumentsDirectory] URLByAppendingPathComponent:@"UfoSightings.sqlite"]; | |
NSError *error = nil; | |
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; | |
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { |
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)loadGroup:(NSString *)group { | |
// If the groups the same, no need to reload. | |
if ([_currentGroup isEqualToString:group]) { | |
return; | |
} | |
_currentGroup = group; | |
NSLog(@"%@: %@", _currentGroup, [_appearanceContainer[_currentGroup] backgroundColor]); | |
[UIView animateWithDuration:kAnimationDuration animations:^{ | |
_sharedInstance.frame = CGRectMake(0, _parentView.frame.size.height, _parentView.frame.size.width, kAppBarTotalHeight); |
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)drawRect:(CGRect)rect | |
{ | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
if (_currentGroup == nil) { | |
CGContextSetFillColorWithColor(context, kDefaultAccentColor.CGColor); | |
CGContextSetStrokeColorWithColor(context, kDefaultAccentColor.CGColor); | |
} else { | |
CGContextSetFillColorWithColor(context, [_appearanceContainer[_currentGroup] backgroundColor].CGColor); | |
CGContextFillRect(context, self.bounds); |
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
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [[[NSBundle mainBundle] loadNibNamed:@"MYTableViewCell" owner:self options:nil] objectAtIndex:0]; | |
if(self) { | |
} | |
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
#import <UIKit/UIKit.h> | |
@interface UIImage(Extras) | |
+ (UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize; | |
+ (UIImage*)strechyWhiteButton; | |
+ (UIImage*)strechyWhiteButtonPressed; |
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
- (AVCaptureSession*)captureSession | |
{ | |
if(!_captureSession) { | |
_captureSession = [[AVCaptureSession alloc] init]; | |
_captureSession.sessionPreset = AVCaptureSessionPresetMedium; | |
AVCaptureDeviceInput* videoInput = [AVCaptureDeviceInput deviceInputWithDevice:[AVCaptureDevice frontFacingCameraIfAvailable] error:nil]; | |
AVCaptureDeviceInput * audioInput = [AVCaptureDeviceInput deviceInputWithDevice:[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio] error:nil]; |
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
self.readingResource = [[ZOReadingResource alloc]initWithKidId:nil delegate:nil finished:nil failed:nil]; | |
== | |
self.readingResource = [[ZOReadingResource alloc]init]; |
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
[myReadingResource createBook:aBook | |
kids:@[kid1,kid2] | |
success:^(NSManagedObjectID* objId){ | |
//Blah blah use ObjID to fetch reading | |
} failed:^{}]; |