This file contains hidden or 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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>CSS Cursor Test</title> | |
| <style> | |
| html, | |
| body { | |
| margin: 0; |
This file contains hidden or 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
| protocol P0 { | |
| associatedtype Parent: P0 | |
| } | |
| protocol P1: P0 {} | |
| protocol P2: P1 { | |
| associatedtype X: P4 where X.Parent == Self | |
| } |
This file contains hidden or 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
| public struct Fibonacci<Number: FixedWidthInteger>: Sequence { | |
| public let startsAtZero: Bool | |
| public init(startAtZero: Bool = true) { | |
| startsAtZero = startAtZero | |
| } | |
| public func makeIterator() -> Iterator { | |
| return .first(startsAtZero: startsAtZero) | |
| } |
This file contains hidden or 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
| public struct Lazy<T> { | |
| private let initialization: () -> T | |
| public private(set) lazy var: T = self.initialization() | |
| public init(initialization: () -> T) { | |
| self.initialization = initialization | |
| } | |
| public init(other: Lazy<T>) { |
This file contains hidden or 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 UIKit | |
| open class LayerView<Layer: CALayer>: UIView { | |
| public final override class var layerClass: Swift.AnyClass { | |
| return Layer.self | |
| } | |
| public final var concreteLayer: Layer { | |
| return layer as! Layer | |
| } |
This file contains hidden or 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
| //ObjC | |
| typedef NS_OPTIONS(NSUInteger, SomeOptions) { | |
| SomeOptionsStarted, | |
| SomeOptionsWorking, | |
| SomeOptionsFailed, | |
| SomeOptionsFinished | |
| }; | |
| // Swift | |
| // Generated: |
This file contains hidden or 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
| Verifying that +ffried is my blockchain ID. https://onename.com/ffried |
This file contains hidden or 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
| - (UIImage *)fixRotation | |
| { | |
| if (self.imageOrientation == UIImageOrientationUp) return self; | |
| CGAffineTransform transform = CGAffineTransformIdentity; | |
| switch (self.imageOrientation) { | |
| case UIImageOrientationDown: | |
| case UIImageOrientationDownMirrored: | |
| transform = CGAffineTransformTranslate(transform, self.size.width, self.size.height); | |
| transform = CGAffineTransformRotate(transform, M_PI); |
This file contains hidden or 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
| extension UIImage { | |
| public func imageRotatedByDegrees(degrees: CGFloat) -> UIImage { | |
| let radiansToDegrees: (CGFloat) -> CGFloat = { | |
| return $0 * (180.0 / CGFloat(M_PI)) | |
| } | |
| let degreesToRadians: (CGFloat) -> CGFloat = { | |
| return $0 / (180.0 * CGFloat(M_PI)) | |
| } | |
| // calculate the size of the rotated view's containing box for our drawing space |
This file contains hidden or 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 UIKit | |
| import Security | |
| class Keychain { | |
| class func save(key: String, data: NSData) -> Bool { | |
| let query: [String: AnyObject] = [ | |
| kSecClass : kSecClassGenericPassword, | |
| kSecAttrAccount : key, | |
| kSecValueData : data ] |
NewerOlder