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
#pragma mark - | |
#pragma mark Core Data stack | |
/** | |
Returns the managed object context for the application. | |
If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application. | |
*/ | |
- (NSManagedObjectContext *) managedObjectContext { | |
if (managedObjectContext != nil) { |
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
NSArray *myMainThreadShit = nil; | |
dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{ | |
// do massive intensive shit | |
NSArray *myShit = [MyModel getMyShit]; | |
dispatch_async( dispatch_get_main_queue(), ^{ | |
// this is on main thread | |
myMainThreadShit = [myShit copy]; |
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
typedef enum { | |
SyncManagerStatusOK, | |
SyncManagerStatusFailed, | |
SyncManagerStatusPending, | |
SyncManagerStatusDownloading, | |
SyncManagerStatusWriting, | |
SyncManagerStatusDownloadingTemplates, | |
SyncManagerStatusWritingTemplates, | |
SyncManagerStatusDownloadingDocuments, | |
SyncManagerStatusWritingDocuments, |
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
typedef enum { | |
SyncManagerStatusOK, | |
SyncManagerStatusFailed, | |
SyncManagerStatusPending, | |
SyncManagerStatusDownloading, | |
SyncManagerStatusWriting, | |
SyncManagerStatusDownloadingTemplates, | |
SyncManagerStatusWritingTemplates, | |
SyncManagerStatusDownloadingDocuments, | |
SyncManagerStatusWritingDocuments, |
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
nav#socialicons img { margin-right: 16px; opacity: 0.35; -webkit-transition-duration: 0.5s;} | |
nav#socialicons span { display: block; padding: 0px 10px; position: absolute; top: -28px; opacity: 0; border-radius: 50px; background: #222; -webkit-transition-duration: 0.5s;} | |
nav#socialicons a:hover img { opacity: 1; -webkit-transform: rotateY(360deg); -webkit-transition-timing-function: ease-out; } | |
nav#socialicons a:hover img + span { opacity: 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
#define UILoremIpsum [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"filltext" ofType:@"txt"] encoding:NSUTF8StringEncoding error:nil] |
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
CALayer *myLayer = [CALayer layer]; | |
[myLayer setFrame:rect]; | |
[myLayer setBackgroundColor:[myColour CGColor]]; | |
[myLayer setCornerRadius:radius]; | |
UIGraphicsBeginImageContext([myLayer frame].size); | |
CGContextRef context = UIGraphicsGetCurrentContext(); |
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
CALayer *myLayer = [CALayer layer]; | |
[myLayer setFrame:rect]; | |
[myLayer setBackgroundColor:[myColour CGColor]]; | |
[myLayer setCornerRadius:radius]; | |
UIGraphicsBeginImageContext([myLayer frame].size); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
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
-- | |
-- Constraints for table `roles_users` | |
-- | |
ALTER TABLE `roles_users` | |
ADD CONSTRAINT `roles_users_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, | |
ADD CONSTRAINT `roles_users_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE; | |
-- | |
-- Constraints for table `user_tokens` | |
-- |
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
- (void) didRotate:(UIRotationGestureRecognizer *)sender | |
{ | |
CGAffineTransform original = [[self view] transform]; | |
CGAffineTransform newTransform = CGAffineTransformMakeRotation([sender rotation]); | |
[[self view] setTransform:CGAffineTransformConcat(original, newTransform)]; | |
[sender setRotation:0]; | |
} |