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 | |
# 2012 - Ben Clayton (benvium). Calvium Ltd | |
# Found at https://gist.github.com/2568707 | |
# | |
# This script installs a .mobileprovision file without using Xcode. Unlike Xcode, it'll | |
# work over SSH. | |
# | |
# Requires Mac OS X (I'm using 10.7 and Xcode 4.3.2) | |
# |
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 | |
# Create a RAM disk with same perms as mountpoint | |
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions | |
# Usage: sudo ./xcode_ramdisk.sh start | |
USERNAME=$(logname) | |
TMP_DIR="/private/tmp" | |
RUN_DIR="/var/run" | |
SYS_CACHES_DIR="/Library/Caches" |
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
#import <CoreImage/CoreImage.h> | |
#import <QuartzCore/QuartzCore.h> | |
- (BOOL) imageHasFaces:(UIImage*) originalImage { | |
if (originalImage == nil) { | |
return NO; | |
} | |
CIImage* image = originalImage.CIImage; | |
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
NSString* gKKeyCounter = @"numbersOfTimeTheViewWithGKWasOpen"; | |
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; | |
if ([userDefaults integerForKey:gKKeyCounter] > 10) { | |
[self startGK]; //The method that initializes and start gesture kit | |
} | |
else { | |
[userDefaults setInteger:[userDefaults integerForKey:gKKeyCounter]+1 forKey:gKKeyCounter]; | |
[userDefaults synchronize]; | |
} |
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
https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/freeProductCodeWizard?code= |
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
// Extend UILabel with a method which sets font, to be used by UIAppearance | |
extension UILabel | |
{ | |
func setFontName(fontName:String) | |
{ | |
self.font = UIFont(name: fontName, size: self.font.pointSize) | |
} | |
} | |
// Somewhere in the code, call the extension method on the UIAppearance proxy object of UILabel, example: |
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
let array = [1, 2, 3, 4, 5, 6] | |
array.map { (value) -> [Int] in | |
print(value) | |
return [value] | |
} | |
array.lazy.map { (value) -> [Int] in | |
print("value: \(value)") | |
return [value+1] |
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
let mixedArray = [1, "2", 3, "4", 5, 6] | |
let resultA = mixedArray.flatMap({ $0 as? String }) | |
resultA.first | |
let resultB = mixedArray.lazy.flatMap({ $0 as? String }) | |
resultB.first |
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
let array = [1, 2, 3, 4, 5, 6] | |
array.map { (value) -> [Int] in | |
print(value) | |
return [value] | |
} | |
array.lazy.map { (value) -> [Int] in | |
print("value: \(value)") | |
return [value] |
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
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode |
OlderNewer