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
| function MyClass() | |
| { | |
| var self = { | |
| var1: 0, | |
| init: function() | |
| { | |
| // constructor | |
| } | |
| } | |
| } |
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
| // | |
| // User.m | |
| // Sambofejden | |
| // | |
| // Created by Oskar Öberg on 2013-01-22. | |
| // Copyright (c) 2013 Oskar Öberg. All rights reserved. | |
| // | |
| #import "NSManagedObject+Extended.h" | |
| #import "DataManager.h" |
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
| D/debug ( 2479): Response: <html> | |
| D/debug ( 2479): <head><title>401 Authorization Required</title></head> | |
| D/debug ( 2479): <body bgcolor="white"> | |
| D/debug ( 2479): <center><h1>401 Authorization Required</h1></center> | |
| D/debug ( 2479): <hr><center>nginx</center> | |
| D/debug ( 2479): </body> | |
| D/debug ( 2479): </html> |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| app.use(passport.initialize()); | |
| app.use(passport.session()); | |
| app.use(function (req, res, next) |
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)doTaskIfNotWaitingForResponse:(void (^)(void (^done)()))task; | |
| { | |
| task(^void () { | |
| //done | |
| }); | |
| } | |
| [self doTaskIfNotWaitingForResponse:^(void (^done)()) { | |
| // do stuff | |
| done(); |
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
| class ImagePagerGermainView: ImagePagerView { | |
| override func awakeFromNib() { | |
| super.awakeFromNib() | |
| productImageView.clipsToBounds = true | |
| } | |
| override func layoutSubviews() { | |
| super.layoutSubviews() | |
| productImageView.layer.cornerRadius = productImageView.frame.size.width / 2 |
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
| - (id)getThingWithIdentifier:(NSString *)identifier; | |
| { | |
| NSArray * arr = [things filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(Thing *thing, NSDictionary *bindings) { | |
| return [thing.identifier isEqualToString:identifier]; | |
| }]]; | |
| return arr.count > 0 ? arr[0] : 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
| - (void) monitorPendingConnections { | |
| dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0f * NSEC_PER_SEC)), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ | |
| NSTimeInterval difference = [[NSDate date] timeIntervalSinceDate: _lastConnectionRefresh]; | |
| ... | |
| }); | |
| } |
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
| - (BOOL)canBecomeFirstResponder { | |
| return YES; | |
| } | |
| - (NSArray *)keyCommands { | |
| UIKeyCommand *left = [UIKeyCommand keyCommandWithInput:UIKeyInputLeftArrow modifierFlags:0 action:@selector(handleKeyLeft:)]; | |
| UIKeyCommand *right = [UIKeyCommand keyCommandWithInput:UIKeyInputRightArrow modifierFlags:0 action:@selector(handleKeyRight:)]; | |
| return @[left, right]; | |
| } |
OlderNewer