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
// Open the mail app on iOS | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"message:xxxxxxxx"]]; |
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 <OCMock/OCMock.h> | |
... | |
// The basic object | |
id obj = [[MyOjbect alloc] init]; | |
// Create the mock | |
id objMock = OCMPartialMock(obj); |
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 XCPlayground | |
import Foundation | |
... | |
XCPSetExecutionShouldContinueIndefinitely(true) |
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 <UIKit/UIKit.h> | |
@interface UIImage (UISegmentIconAndText) | |
+ (id) imageFromImage:(UIImage*)image string:(NSString*)string color:(UIColor*)color; | |
@end |
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
# Upgrading Xcode can wreak havok on your custom Alcatraz setup. | |
# Each plugin must list the UUIDs of Xcode that it supports. Thus | |
# with each new release we must update the list of UUIDs for each | |
# plugin we want to continue using. | |
# | |
# You can discover the UUID of an Xcode app bundle by running this command | |
defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID | |
# > 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 |
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
// Here is a manually curried function. | |
// maxA takes an int and returns a function, maxB, that takes an int and returns an int. | |
func maxA(a:Int) -> (Int) -> Int { | |
func maxB(b:Int) -> Int { | |
return a > b ? a : b | |
} | |
return maxB | |
} |
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
<!DOCTYPE html> | |
<html lang="html"> | |
<head> | |
<style> | |
.videoWrapper { | |
position: relative; | |
padding-bottom: 56.25%; /* 16:9 */ | |
padding-top: 25px; | |
height: 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
``` | |
UICTContentSizeCategoryXS | |
Caption 1 = {size: 11pts, weight:normal} | |
default = {size: 13pts, weight:normal} | |
Body = {size: 14pts, weight:normal} | |
Subhead = {size: 12pts, weight:normal} | |
Title 1 = {size: 25pts, weight:normal} |
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 Foundation | |
func async(callback:(Void -> Void)) { | |
dispatch_async(dispatch_get_main_queue(), { () -> Void in | |
callback() | |
}) | |
} | |
func after(delay:Double, closure:Void->Void) { | |
dispatch_after( |
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
alias xw="open *.xcworkspace" | |
alias xp="open *.xcodeproj" | |
function xcode { | |
# If the pattern matches a workspcace file, try to open it. | |
if stat -t -- *.xcworkspace >/dev/null 2>&1; then | |
xw | |
# Otherwise fall back to opening a project file. | |
else | |
xp |