Skip to content

Instantly share code, notes, and snippets.

@lfaoro
lfaoro / Casted.swift
Created October 23, 2015 10:55
Generated with Cast (cast.lfaoro.com)
publicGist
@lfaoro
lfaoro / Casted.swift
Created October 23, 2015 10:54
Generated with Cast (cast.lfaoro.com)
http://is.gd/4GXoBf
@lfaoro
lfaoro / a.rb
Created September 18, 2015 14:07
http://git.io/vnt10
@lfaoro
lfaoro / a.rb
Created September 18, 2015 14:06
test
@lfaoro
lfaoro / a.rb
Created September 18, 2015 14:06
test
@lfaoro
lfaoro / a.rb
Created September 18, 2015 14:06
test
@lfaoro
lfaoro / a.rb
Created September 18, 2015 14:05
test
let pb = NSPasteboard.generalPasteboard()
func parsePB() {
if let data = pb.stringForType("public.utf8-plain-text") {
print(data)
}
if let data = pb.dataForType("public.rtf") {
let rtf = try! NSAttributedString(data: data, options: [:], documentAttributes: nil)
Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-700.0.52.2/src/llvm/include/llvm/Support/Casting.h, line 230.
0 swiftc 0x000000010ae7dbbb llvm::sys::PrintStackTrace(__sFILE*) + 43
1 swiftc 0x000000010ae7e2fb SignalHandler(int) + 379
2 libsystem_platform.dylib 0x00007fff86e96f1a _sigtramp + 26
3 libsystem_platform.dylib 0x00007fc1a070a980 _sigtramp + 428292736
4 libsystem_c.dylib 0x00007fff8dd979b3 abort + 129
5 libsystem_c.dylib 0x00007fff8dd5fa99 basename + 0
6 swiftc 0x0000000108e796a2 swift::DependencyGraphImpl::loadFromBuffer(void const*, llvm::MemoryBuffer&) + 3090
7 swiftc 0x0000000108e78a5f swift::DependencyGraphImpl::loadFromPath(void const*, llvm::StringRef) + 95
8 swiftc 0x0000000108e727bf swift::driver::Compilation::performJobsImpl() + 1903
import Cocoa
import SwiftyJSON
import RxSwift
import RxCocoa
enum ConnectionError: ErrorType {
case InvalidData(String), NoResponse(String)
}
/**