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
#!/bin/bash | |
DIRECTORY=$1 | |
echo "--------------------------------" | |
echo " Running script in:<$DIRECTORY> " | |
echo " <$DIRECTORY> " | |
echo "--------------------------------" | |
echo "Processing asset:" | |
find "$DIRECTORY" -name '*png' -print0 | while read -d $'\0' file; | |
do |
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
let sessionConfiguration: URLSessionConfiguration = .default | |
let proxyConfiguration: [AnyHashable : Any] = [ | |
kCFNetworkProxiesHTTPEnable as AnyHashable: true, | |
kCFNetworkProxiesHTTPPort as AnyHashable: [Place-proxy's-port-number-here], | |
kCFNetworkProxiesHTTPProxy as AnyHashable: "Place-your-proxy-address-here" | |
] | |
sessionConfiguration.connectionProxyDictionary = proxyConfiguration |
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 CollectionViewFlowLayoutSubclass | |
- (void)awakeFromNib { | |
[super awakeFromNib]; | |
} | |
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { | |
NSArray *attributesToReturn = [super layoutAttributesForElementsInRect:rect]; | |
for (UICollectionViewLayoutAttributes *attributes in attributesToReturn) { |
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
import UIKit | |
func easterDay(Y : Int) -> NSDate { | |
let a: Int = Y % 19 | |
let b: Int = Int(floor(Double(Y) / 100)) | |
let c: Int = Y % 100 | |
let d: Int = (19 * a + b - Int(floor(Double(b) / 4)) - Int(floor(Double(b - Int(floor(Double(b + 8) / 25)) + 1) / 3)) + 15) % 30 | |
let e: Int = (32 + 2 * (b % 4) + 2 * Int(floor(Double(c) / 4)) - d - (c % 4)) % 7 | |
let f: Int = Int(floor(Double(a + 11 * d + 22 * e) / 451)) |
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
#import <GoogleMaps/GoogleMaps.h> | |
@interface GMSMapView (DisableDoubleTapZoom) | |
- (void)setDoubleTapZoomEnabled:(BOOL)enabled; | |
@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
func getColorForPixel(image:CGImageRef, point:CGPoint) -> UIColor { | |
let imageWidth = CGImageGetWidth(image) | |
let imageHeight = CGImageGetHeight(image) | |
let imageRect = CGRect(x: 0, y: 0, width: imageWidth, height: imageHeight) | |
let bitmapBytesForRow = Int(imageWidth * 4) | |
let bitmapByteCount = bitmapBytesForRow * Int(imageHeight) | |
let colorSpace = CGColorSpaceCreateDeviceRGB() | |
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
var networkActivityIndicatorCount = 0 | |
func setNetworkActivityIndicatorVisible(visible:Bool) { | |
if visible { | |
networkActivityIndicatorCount++ | |
} else { | |
networkActivityIndicatorCount-- | |
} | |
if networkActivityIndicatorCount < 0 { |