- Project builds & runs on required iOS versions
- Date/times are displayed in correct timezone
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; | |
NS_ASSUME_NONNULL_BEGIN | |
@protocol MFBPreviewableCollectionView | |
- (nullable NSIndexPath *)mfb_previewableCollectionIndexPathForItemAtPoint:(CGPoint)point; | |
- (CGRect)mfb_previewableCollectionItemRectForIndexPath:(NSIndexPath *)indexPath; |
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 Swift | |
func LCS<T: Equatable>(a: [T], b: [T]) -> [[UInt]] { | |
let rows = a.count + 1 | |
let cols = b.count + 1 | |
var matrix: [[UInt]] = Array(count: rows, repeatedValue: Array(count: cols, repeatedValue: 0)) | |
for i in 1..<rows { |
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 | |
if git status | grep -i 'HEAD detached' > /dev/null 2>&1; then | |
echo "You should not commit while in detached state, either create a new brach or checkout existing one before committing." | |
exit 1 | |
fi |
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
// Make Optional a monad | |
extension Optional { | |
// Scala style, define `flatMap` directly | |
func flatMap<U>(f: (a: T) -> Optional<U>) -> Optional<U> { | |
switch (self) { | |
case .None: return nil | |
case .Some(let value): return f(a: 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
protocol ISubscriber { | |
typealias Element | |
func disposable() -> RACCompoundDisposable | |
func sendNext(e: Element) | |
func sendError(e: NSError) | |
func sendCompleted() | |
} |
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
Pod::Spec.new do |s| | |
s.name = "ReactiveCocoa" | |
s.version = "3.0-dev" | |
s.summary = "A framework for composing and transforming streams of values." | |
s.homepage = "https://github.com/blog/1107-reactivecocoa-is-now-open-source" | |
s.author = { "Josh Abernathy" => "[email protected]" } | |
s.source = { :git => "https://github.com/ReactiveCocoa/ReactiveCocoa.git", :commit => "7fe93c972aed2dc1f1c9ac1b75cd955d1773fd35" } | |
s.license = 'MIT' | |
s.description = "ReactiveCocoa (RAC) is an Objective-C framework inspired by Functional Reactive Programming. It provides APIs for composing and transforming streams of values." | |
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
static RACSignal *BodyImageURLs(NSString *postBody) | |
{ | |
NSRange (^lastRangeFromMatch)(NSTextCheckingResult *) = ^(NSTextCheckingResult *match) { | |
if (match == nil) { | |
return NSMakeRange(NSNotFound, 0); | |
} | |
else { | |
return [match rangeAtIndex:match.numberOfRanges - 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
find . -name '*.p12' -depth 1 -type f | sed 's/^\.\/\(.\)/\1/' | xargs -I '{}' openssl pkcs12 -passin 'pass:' -in '{}' -out '{}'.pem -nodes |
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 | |
function fetchProvisioningProfiles() | |
{ | |
ios profiles:download:all --type development | |
DEVELOPMENT_RESULT=$? | |
if [ "$DEVELOPMENT_RESULT" -ne "0" ]; then | |
return 1 | |
fi |