Skip to content

Instantly share code, notes, and snippets.

View OneSadCookie's full-sized avatar

Keith Bauer OneSadCookie

View GitHub Profile
@OneSadCookie
OneSadCookie / keybase.md
Created July 23, 2019 11:00
keybase.md

Keybase proof

I hereby claim:

  • I am onesadcookie on github.
  • I am onesadcookie (https://keybase.io/onesadcookie) on keybase.
  • I have a public key ASBQklqH9TTCtV8ht0YGzxtp_m4vsT9p0A01sR6FqpBbRAo

To claim this, I am signing this object:

import Foundation
protocol SerializableToUserDefaults {
static func read(from defaults: UserDefaults, key: String) -> Self
func write(to defaults: UserDefaults, key: String)
}
extension String: SerializableToUserDefaults {
static func read(from defaults: UserDefaults, key: String) -> String {
return defaults.string(forKey: key)!
import CoreMedia
protocol PixelContainer { }
protocol Source {
typealias PixelContainerType: PixelContainer
func frameAtTime(time: CMTime) -> PixelContainerType?
protocol Output {
func isSameAs(o: Output) -> Bool
}
extension Output where Self: Equatable {
func isSameAs(o: Output) -> Bool {
guard let o = o as? Self else { return false }
extension Array where Element: Equatable {
mutating func remove(e: Element) {
for (i, f) in self.enumerate() {
if e == f {
self.removeAtIndex(i)
}
}
}
enum TheirError: ErrorType {
case Something
}
enum MyError: ErrorType {
case CouldNot(TheirError)
let odds = [ "a": 1, "c": 3, "e": 5 ]
let evens = [ "b": 2, "d": 4, "f": 6 ]
extension Dictionary {
func mergeWith(other: [Key: Value]) -> [Key: Value] {
var result = self
for (k, v) in other {
result[k] = v
}
func computeValue() -> Int {
return 3
}
let x: Int = {
switch computeValue() {
case 0:
return 1
case let value:
return value
Deck.swift:27:16: error: cannot invoke initializer for type 'Card' with an argument list of type '(suit: Suit, rank: Rank, back: Back, facing: Facing)'
return Card(
^
Deck.swift:27:20: note: expected an argument list of type '(suit: Suit, rank: Rank, back: Back, facing: Facing)'
return Card(
^
__ZN13CVDisplayLink11runIOThreadEv:
00002450 pushl %ebp
00002451 movl %esp, %ebp
00002453 pushl %ebx
00002454 pushl %edi
00002455 pushl %esi
00002456 subl $0x21c, %esp ## imm = 0x21C
0000245c calll 0x2461
00002461 popl %edi
00002462 movl 0x2dbbf(%edi), %eax