Skip to content

Instantly share code, notes, and snippets.

@jerry-sl
jerry-sl / re
Last active September 9, 2017 09:10
Regular Expression
<h1>Ruls</h1>
• The ? matches zero or one of the preceding group.
• The * matches zero or more of the preceding group.
• The + matches one or more of the preceding group.
• The {n} matches exactly n of the preceding group.
• The {n,} matches n or more of the preceding group.
• The {,m} matches 0 to m of the preceding group.
• The {n,m} matches at least n and at most m of the preceding group.
• {n,m}? or *? or +? performs a nongreedy match of the preceding group.
• ^spam means the string must begin with spam.
@interface ApplicationDelegate<UIApplicationDelegate>
@end
@implementation ApplicationDelegate
- (RACSignal *)rac_registeredForRemoteNotifications {
RACSignal *signal = objc_getAssociatedObject(self, _cmd);
if (signal != nil) return signal;
RACSignal *didRegisterForRemoteNotification = [[self rac_signalForSelector: @selector(application:didRegisterForRemoteNotificationsWithDeviceToken:) fromProtocol: @protocol(UIApplicationDelegate)] map: ^(RACTuple *tuple) {
return tuple.second;
typedef enum {
AGCommandPriorityLow = -10,
AGCommandPriorityDefault = 0,
AGCommandPriorityHigh = 10
} AGCommandPriority;
@interface AGCommand : NSObject
@property(nonatomic, weak) NSObject *firingObject;
@property(nonatomic, readonly) SEL action;
typedef enum {
AGCommandPriorityLow = -10,
AGCommandPriorityDefault = 0,
AGCommandPriorityHigh = 10
} AGCommandPriority;
@interface AGCommand : NSObject
@property(nonatomic, weak) NSObject *firingObject;
@property(nonatomic, readonly) SEL action;
#import <UIKit/UIKit.h>
@interface DateFlowLayout : UICollectionViewFlowLayout
@end