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
| self.roles.each do |r| | |
| define_method "#{r}?" do | |
| role == r | |
| end | |
| 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
| SecureRandom.base64(5).tr('+/=lIO0', 'pqrsxyz') |
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
| @implementation AppDelegate | |
| - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { | |
| [NSApp setServicesProvider:[MyService new]]; | |
| ... |
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
| pg_dump databas > dump.sql |
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
| Devise.friendly_token |
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
| .ring { | |
| border: 3px solid #999; | |
| -webkit-border-radius: 30px; | |
| height: 40px; | |
| width: 40px; | |
| position: fixed; | |
| top: 45%; | |
| left: 45%; |
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
| + (MyClass *)sharedInstance { | |
| static dispatch_once_t _predicate; | |
| static MyClass *_sharedInstance = nil; | |
| dispatch_once(&_predicate, ^{ | |
| _sharedInstance = [self new]; | |
| }); | |
| return _sharedInstance; | |
| } |
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
| static NSDateFormatter *dateFormatter = nil; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| dateFormatter = [NSDateFormatter new]; | |
| [dateFormatter setDateFormat:@"yyyy-MM-dd"]; | |
| }); | |
| return [dateFormatter dateFromString:self]; |
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
| static NSDateFormatter *railsFormatter = nil; | |
| if (railsFormatter == nil) { | |
| railsFormatter = [[NSDateFormatter alloc] init]; | |
| [railsFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss'Z'"]; | |
| } | |
| return [railsFormatter stringFromDate:self]; |
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
| chflags nohidden ~/Library/ |