I hereby claim:
- I am qwzybug on github.
- I am qwzybug (https://keybase.io/qwzybug) on keybase.
- I have a public key whose fingerprint is 410E E7B4 A821 19CF E0AD 0C9B E1D9 3BEA 9428 91DE
To claim this, I am signing this object:
extension NSData { | |
var SHA1: NSData { | |
var digest = [UInt8](count: Int(CC_SHA1_DIGEST_LENGTH), repeatedValue: UInt8(0)) | |
CC_SHA1(bytes, CC_LONG(length), &digest) | |
return NSData(bytes: digest, length: Int(CC_SHA1_DIGEST_LENGTH)) | |
} | |
var hex: String { | |
var hexString = "" | |
let hexTable = "0123456789abcdef" | |
let bytes = UnsafePointer<UInt8>(self.bytes) |
// Playground - noun: a place where people can play | |
import UIKit | |
enum Turnstile { | |
case Locked | |
case Unlocked | |
mutating func push() -> Bool { | |
switch self { |
'a' 61ffffffffffff7f01 UTF8 61 | |
[sunglasses] f09f988effffff7f01 UTF8 F09F988E | |
[multiply] c397ffffffffff7f01 UTF8 C397 |
I hereby claim:
To claim this, I am signing this object:
func &<T>(x: T, op: T -> T) -> T { | |
return op(x) | |
} | |
func &<T>(x: T, op: T -> ()) -> T { | |
op(x) | |
return x | |
} | |
attributes.transform3D = CATransform3DIdentity |
import UIKit | |
enum Angle { | |
case Radians(Double) | |
case Degrees(Double) | |
var radians: Double { | |
switch(self) { | |
case let .Radians(scalar): | |
return scalar |
// Playground - noun: a place where people can play | |
import Foundation | |
enum LazyVal<T, U> { | |
case Raw(T) | |
case Val(U) | |
case None | |
} |
import Cocoa | |
class TestClass { | |
@lazy var lazy: NSDate = { | |
return NSDate.date() | |
}() | |
} | |
let t = TestClass() | |
println(t.lazy) |
// | |
// UIApplication+DisplayedLanguage.m | |
// Crossfader | |
// | |
// Created by Devin Chalmers on 4/14/14. | |
// | |
// | |
#import "UIApplication+DisplayedLanguage.m.h" |
#!/usr/bin/ruby1.9.1 -Kw | |
# -*- coding: utf-8 -*- | |
# Dijkstra's single-source shortest path algorithm, from https://gist.github.com/roganartu/9407316#file-dijkstra-rb | |
class Edge | |
attr_accessor :src, :dst, :length | |
def initialize(src, dst, length = 1) | |
@src = src |