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
| NSDictionary *dict = responseObject; | |
| NSLog(@"dict"); | |
| for (id key in dict) { | |
| id obj = [dict objectForKey:key]; | |
| NSLog(@"key=%@ value=%@ class=%@", key, obj, [obj class]); | |
| } |
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
| @interface DismissGravity : NSObject <UIViewControllerAnimatedTransitioning> | |
| @property (strong, nonatomic) UIDynamicAnimator *animator; |
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
| @interface RootVC : UIViewController <UIDynamicAnimatorDelegate> | |
| @property (strong, nonatomic) UIDynamicAnimator *animator; | |
| @property (strong, nonatomic) UIView *noticeView; |
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
| @property (strong, nonatomic) UIDynamicAnimator *animator; | |
| @property (strong, nonatomic) UIView *boxView; |
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
| @interface InteractiveTransition.h : NSObject <UIViewControllerAnimatedTransitioning> | |
| @end |
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
| @interface RootVC : UIViewController <UIViewControllerTransitioningDelegate> |
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
| #import <Foundation/Foundation.h> | |
| @interface BouncyTransition : NSObject <UIViewControllerAnimatedTransitioning> | |
| @end |
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)viewDidLoad | |
| { | |
| CGRect rect = CGRectMake(0, 0, self.view.frame.size.width, 20); | |
| UIView *statusBarBg = [[UIView alloc] initWithFrame:rect]; | |
| [self.view addSubview:statusBarBg]; | |
| statusBarBg.backgroundColor = [UIColor purpleColor]; | |
| } | |
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
| from PIL import Image | |
| img = Image.open("imagefilename.png") | |
| print img.size | |
| # 512, 512 | |
| print img.format | |
| # PNG | |
| print img.mode | |
| # RGB |
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
| # 1. Use Celery: | |
| # http://celery.readthedocs.org/en/latest/tutorials/debugging.html | |
| from celery import task | |
| from celery.contrib import rdb | |
| @task() | |
| def add(x, y): | |
| result = x + y | |
| rdb.set_trace() # <- set breakpoint |