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
/* OS X Swift "Command Line Tool" */ | |
import Foundation | |
extension NSData { | |
func jstnMD5() -> String { | |
let result = NSMutableData(length: Int(CC_MD5_DIGEST_LENGTH))! | |
let resultBytes = UnsafeMutablePointer<CUnsignedChar>(result.mutableBytes) |
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
diff "DummyProjectForSwiftPods/Podfile.lock" "DummyProjectForSwiftPods/Pods/Manifest.lock" > /dev/null | |
if [[ $? != 0 ]] ; then | |
cat << EOM | |
error: The sandbox is not in sync with the DummyProjectForSwiftPods Podfile.lock. Run 'pod install' from the DummyProjectForSwiftPods directory or update your CocoaPods installation. | |
EOM | |
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
source 'https://github.com/CocoaPods/Specs.git' | |
platform :ios, '8.3' | |
use_frameworks! | |
pod 'FutureKit' | |
pod 'AlamoFire' |
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> | |
<body> | |
<script type='text/javascript'> | |
var _oai = function(a, c, d, e, g) { | |
if (a) | |
if (c) { | |
var h = Date.now(), | |
k = window.history.length, |
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
# Git branch in prompt. | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " |
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
// ---------------------------------------------------------------------- | |
// MARK: NSErrorType protocol, with JSON extensions for NSError | |
// ---------------------------------------------------------------------- | |
/** so if you have a ErrorType var, and you want to test for NSError ex (e is NSError), it always succeeds. | |
it can sometimes be hard to test for NSError. | |
but you can test for protocol conformance. | |
so now: | |
e as? NSErrorType |
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
// | |
// FutureKit+AlamoFire.swift | |
// | |
// Created by Michael Gray on 9/21/15. | |
// | |
import Foundation | |
import Alamofire | |
import FutureKit |
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
// | |
// FutureKit+RAC.swift | |
// | |
// Created by Michael Gray on 9/10/15. | |
// | |
import Foundation | |
import ReactiveCocoa | |
import FutureKit |
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
// | |
// RAC+Extensions.swift | |
// CoverPages | |
// | |
// Created by Morten Heiberg on 12/1/15. | |
// Copyright (c) 2015 Squarespace. All rights reserved. | |
// | |
import Foundation | |
import ReactiveCocoa |
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 FutureKit | |
private var startPromiseHandler = ExtensionVarHandler() | |
public extension Future { | |
fileprivate var startPromise : Promise<Void>? { | |
set(p) { | |
startPromiseHandler.setValueOn(self, value: p) | |
} | |
get { | |
return startPromiseHandler.getValueFrom(self) |
OlderNewer