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
describe "Fail test" do | |
it "always fails" do | |
(1).should.equal 2 | |
end | |
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
NSURLConnection | NSURLSession | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connectionShouldUseCredentialStorage: | | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler: | |
| N |
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 | |
infix operator +=! { associativity right precedence 90 } // Int32 or Int64 | |
infix operator -=! { associativity right precedence 90 } // Int32 or Int64 | |
postfix operator ++! {} // Int32 or Int64 | |
postfix operator --! {} // Int32 or Int64 | |
infix operator |=! { associativity right precedence 90 } // UInt32 | |
infix operator &=! { associativity right precedence 90 } // UInt32 |
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
Thread 5Queue : com.apple.root.user-initiated-qos (concurrent) | |
#0 0x000000010f181d2b in objc_release () | |
#1 0x000000010f1831d1 in (anonymous namespace)::AutoreleasePoolPage::pop(void*) () | |
#2 0x00000001125037ce in _dispatch_root_queue_drain () | |
#3 0x0000000112503059 in _dispatch_worker_thread3 () | |
#4 0x00000001128cb4de in _pthread_wqthread () | |
#5 0x00000001128c9341 in start_wqthread () |
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
enum APIError : ErrorType { | |
// Can't connect to the server (maybe offline?) | |
case ConnectionError(error: NSError) | |
// The server responded with a non 200 status code | |
case ServerError(statusCode: Int, error: NSError) | |
// We got no data (0 bytes) back from the server | |
case NoDataError | |
// The server response can't be converted from JSON to a Dictionary | |
case JSONSerializationError(error: ErrorType) | |
// The Argo decoding Failed |
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 | |
protocol Domain { | |
associatedtype Parent = Domain | |
static var name: String { get } | |
static var fullName: String { get } | |
} |
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
PHFetchResult *result = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum | |
subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary | |
options:nil]; | |
PHAssetCollection *assetCollection = result.firstObject; | |
NSLog(@"%@", assetCollection.localizedTitle); | |
// Camera Roll |
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
// | |
// libuuid sample program | |
// | |
// library install for debian | |
// $ sudo apt-get install uuid-dev | |
// | |
// compile | |
// $ gcc uuid_test.c -luuid -o uuid_test | |
// | |
#include <stdio.h> |
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
@interface NSObject (Debounce) | |
- (void)debounce:(SEL)action delay:(NSTimeInterval)delay; | |
@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
// | |
// debounce-throttle.swift | |
// | |
// Created by Simon Ljungberg on 19/12/16. | |
// License: MIT | |
// | |
import Foundation | |
extension TimeInterval { |
OlderNewer