Skip to content

Instantly share code, notes, and snippets.

View objectiveSee's full-sized avatar

Danny Ricciotti objectiveSee

  • Starship Studios
View GitHub Profile
Matchmaking.gameNear = function(user, location, callback) {
console.log('[DEBUG] [gameNear]');
Q.fcall(this.updateUserLocation.bind(this,user,location)) // TODO: why do we have to pass 'this' first in bind() params?
.then(this.findGamesNearby.bind(this,user,location))
.then(function(games_nearby) {
foo(games_nearby);
}).done();
};
// TODO: Use weak self to avoid retaining self for a long time (during long downloads)
SDWebImageManager *manager = [SDWebImageManager sharedManager];
[manager downloadWithURL:imageURL
options:0
progress:nil
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished)
{
if ( [self.imageURL isEqual:imageURL] &&
image &&
!error )
/////// .h ///////
// Core Data MOM file: http://grab.by/jf4c
// NOTE: Some attributes excluded in the code below
@interface CDUserPhotos : NSManagedObject
@property (nonatomic, retain) NSData * data; // core data attribute
@property (nonatomic, readonly) NSArray* albums; // not an attribute. Calculate from self.data