This file contains 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/sh | |
# ------- | |
# Usage sh unusedImages.sh (jpg|png|gif) | |
# ------- | |
# Caveat | |
# 1 - | |
# NSString *imageName = [NSString stringWithFormat:@"image_%d.png", 1]; | |
# This script would incorrectly list these images as unreferenced. For example, you might have | |
# This script will incorrectly think image_1.png is unreferenced. | |
# 2 - If you have a method, or variable with the same name as the image it won't pick it up |
This file contains 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 proVersion = YES; | |
if (proVersion) { | |
return; | |
} | |
//create predicate and filter the results | |
NSPredicate *freePredicate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *binding) { | |
InAppGame *game = (InAppGame *)evaluatedObject; | |
return game.isFree; | |
}]; |
This file contains 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
// | |
// NSArray_NSArrayUtils.h | |
// GCDAndBlocks | |
// | |
// Created by Daniel Hollis on 21/02/2012. | |
// Copyright (c) 2012 Mobile Interactive Group. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains 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
# recursively delete original files after a git merge failure | |
find . -name *.orig -delete |
This file contains 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
+(CAGradientLayer *)layerFromArray:(NSArray *)gradientsArray | |
{ | |
//create gradient from gradient | |
NSMutableArray *arrayOfColors = [NSMutableArray arrayWithCapacity:10]; | |
NSMutableArray *arrayOfPositions = [NSMutableArray arrayWithCapacity:10]; | |
for (NSString *string in gradientsArray) | |
{ | |
NSArray *arr = [string componentsSeparatedByString:@","]; | |
This file contains 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
// Do any additional setup after loading the view. | |
[[CBTimer instance] startTimerWithMaxTime:5 mode:CBTimerModeDecrease timerDoneBlock:^ (CFTimeInterval elapsed, BOOL isFinished) | |
{ | |
self.counterLabel.text = [NSString stringWithFormat:@"%.3f",elapsed]; | |
if (isFinished) | |
{ | |
UIAlertView *finished =[[UIAlertView alloc] initWithTitle:@"Finished" message:@"Finito" delegate:nil cancelButtonTitle:@"OKAY" otherButtonTitles:nil]; | |
[finished show]; | |
} |
This file contains 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
CGFloat height = 100.f; | |
UIBezierPath *straightPath = [UIBezierPath bezierPath]; | |
[straightPath moveToPoint:CGPointMake(0, 0)]; | |
[straightPath addCurveToPoint:CGPointMake(0, height) controlPoint1:CGPointMake(0, height * 0.5) controlPoint2:CGPointMake(0, height * 0.5)]; | |
UIBezierPath *bendiPath = [UIBezierPath bezierPath]; | |
[bendiPath moveToPoint:CGPointMake(0, 0)]; |
This file contains 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)vuforiaBugFix | |
{ | |
[AVCaptureVideoDataOutput aspect_hookSelector:@selector(setVideoSettings:) withOptions:AspectPositionInstead usingBlock:^(id<AspectInfo> aspectInfo, NSMutableDictionary *settings) { | |
// lets check if the settings have a PixelFormatType as the key | |
NSString *key = (id)kCVPixelBufferPixelFormatTypeKey; | |
if([settings objectForKey:key]) | |
{ |
This file contains 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
// | |
// UILabel+Paragraph.swift | |
// | |
// Created by Daniel Tavares on 09/02/2016. | |
// Copyright © 2016 Daniel Tavares. All rights reserved. | |
// | |
import Foundation | |
//MARK: - Associated Value Struct |
This file contains 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
// | |
// UKPostcodeValidator.swift | |
// Medio | |
// | |
// Created by Daniel Tavares on 20/03/2016. | |
// Copyright © 2016 Daniel Tavares. All rights reserved. | |
// References: http://stackoverflow.com/questions/164979/uk-postcode-regex-comprehensive | |
// References: http://benscheirman.com/2014/06/regex-in-swift/ | |
// Usage: UKPostcodeValidator.validate("W1D 5LH") | |
// |
OlderNewer