Skip to content

Instantly share code, notes, and snippets.

View ChristianKienle's full-sized avatar
🐶
Coconut Shock

Christian Kienle ChristianKienle

🐶
Coconut Shock
  • Apple
  • Cupertino
View GitHub Profile
/*
Cocoa64.tops
We now have a more powerful tool for 64-bit conversions; please see ConvertCocoa64 in the same directory.
This script converts Cocoa sources to 64-bit.
Assumes careful inspection of changes and additional hand edits.
Please refer to the "64-Bit Transition Guide for Cocoa" more info about this script:
http://developer.apple.com/documentation/Cocoa/Conceptual/Cocoa64BitGuide/index.html
sdsdasdasdadds
@ChristianKienle
ChristianKienle / gist:7514453
Last active December 28, 2015 14:19
Invoke +newUUID to create a new UUID
curl https://demo.obcl.io/Service \
-X POST \
-d '{"selector" : "newUUIDString", "arguments" : []}'
#import <Foundation/Foundation.h>
@interface NSURLResponse (Connect)
#pragma mark - Properties
@property (readonly) BOOL isHTTPResponse;
@property (readonly) NSHTTPURLResponse *HTTPResponse;
@end
#import <Foundation/Foundation.h>
@class CKRecordID;
@interface CKCPartialErrorItem : NSObject
@property (strong) NSError *error;
@property (strong) CKRecordID *recordID;
@end
@class CKRecord;
public enum QueryResult {
case Success(ResultSet)
case Failure(SQLError)
}
func ==(a:QueryResult, b:QueryResult) -> Bool {
switch(a) {
case .Success(_):
switch (b) {
case .Success(_): return true
var isSuccess:Bool {
switch self {
case .Success(let result) : return true
case .Failure(let error) : return false
}
}
var queryResult = self.database.executeQuery("SELECT * FROM PERSON", arguments:[])
XCTAssertTrue(queryResult.isSuccess)
queryResult.consume { resultSet in
var name:String = resultSet.value(0)
XCTAssertEqual("Christian", "Name")
}
0 swift 0x0000000102db6968 llvm::sys::PrintStackTrace(__sFILE*) + 40
1 swift 0x0000000102db6e54 SignalHandler(int) + 452
2 libsystem_platform.dylib 0x00007fff94535f1a _sigtramp + 26
3 swift 0x0000000102cc3e7b llvm::FoldingSet<llvm::AttributeSetNode>::NodeEquals(llvm::FoldingSetImpl::Node*, llvm::FoldingSetNodeID const&, unsigned int, llvm::FoldingSetNodeID&) const + 59
4 swift 0x000000010217e2ef swift::irgen::ProtocolInfo::getConformance(swift::irgen::IRGenModule&, swift::CanType, swift::irgen::TypeInfo const&, swift::ProtocolDecl*, swift::ProtocolConformance const&) const + 207
5 swift 0x0000000102181363 swift::irgen::emitPolymorphicArguments(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::SILFunctionType>, swift::CanTypeWrapper<swift::SILFunctionType>, llvm::ArrayRef<swift::Substitution>, swift::irgen::Explosion&) + 819
6 swift 0x00000001021c3f31 swift::SILVisitor<(anonymous na
import Foundation
public class Statement {}
public protocol Bindable {
func bindTo(statement:Statement, atIndex:Int32) -> Bool
}
public enum UpdateResult {
case Success
}
public class Database {