| func colorWithGradient(frame: CGRect, colors: [UIColor]) -> UIColor { | |
| // create the background layer that will hold the gradient | |
| let backgroundGradientLayer = CAGradientLayer() | |
| backgroundGradientLayer.frame = frame | |
| // we create an array of CG colors from out UIColor array | |
| let cgColors = colors.map({$0.CGColor}) | |
| backgroundGradientLayer.colors = cgColors | 
| // | |
| // ViewController.m | |
| // AVPlayerCaching | |
| // | |
| // Created by Anurag Mishra on 5/19/14. | |
| // Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer | |
| // | |
| #import "ViewController.h" | |
| #import <AVFoundation/AVFoundation.h> | 
| #import "UICollectionViewFlowLayoutCenterItem.h" | |
| @implementation UICollectionViewFlowLayoutCenterItem | |
| - (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity | |
| { | |
| CGSize collectionViewSize = self.collectionView.bounds.size; | |
| CGFloat proposedContentOffsetCenterX = proposedContentOffset.x + self.collectionView.bounds.size.width * 0.5f; | |
| CGRect proposedRect = self.collectionView.bounds; | 
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| // List all files in a directory in Node.js recursively in a synchronous fashion | |
| var walkSync = function(dir, filelist) { | |
| var fs = fs || require('fs'), | |
| files = fs.readdirSync(dir); | |
| filelist = filelist || []; | |
| files.forEach(function(file) { | |
| if (fs.statSync(dir + file).isDirectory()) { | |
| filelist = walkSync(dir + file + '/', filelist); | |
| } | |
| else { | 
- 
The status bar in iOS 7 is transparent, the view behind it shows through.
 - 
The style of the status bar refers to the appearances of its content. In iOS 7, the status bar content is either dark (
UIStatusBarStyleDefault) or light (UIStatusBarStyleLightContent). BothUIStatusBarStyleBlackTranslucentandUIStatusBarStyleBlackOpaqueare deprecated in iOS 7.0. UseUIStatusBarStyleLightContentinstead. 
- If below the status bar is a navigation bar, the status bar style will be adjusted to match the navigation bar style (
UINavigationBar.barStyle): 
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
| NSUInteger PSPDFHashFromCGRect(CGRect rect) { | |
| return (*(NSUInteger *)&rect.origin.x << 10 ^ *(NSUInteger *)&rect.origin.y) + (*(NSUInteger *)&rect.size.width << 10 ^ *(NSUInteger *)&rect.size.height); | |
| } | 

