Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active May 26, 2024 06:18
The introduction to Reactive Programming you've been missing
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
@odrobnik
odrobnik / gist:2711594
Created May 16, 2012 15:58
Force decompression of UIImage on background queue before setting on UIImageView
dispatch_queue_t queue = dispatch_queue_create("PlusFlickrPhotoView Queue", DISPATCH_QUEUE_CONCURRENT);
dispatch_async(queue, ^{
// force decompress of image
UIGraphicsBeginImageContext(CGSizeMake(1, 1));
[image drawAtPoint:CGPointZero];
UIGraphicsEndImageContext();
// set the image on main thread
dispatch_sync(dispatch_get_main_queue(), ^{