XXX
|- .git
|- (project files)
YYY
|- .git
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
| struct Keycode { | |
| // Layout-independent Keys | |
| // eg.These key codes are always the same key on all layouts. | |
| static let returnKey : UInt16 = 0x24 | |
| static let enter : UInt16 = 0x4C | |
| static let tab : UInt16 = 0x30 | |
| static let space : UInt16 = 0x31 | |
| static let delete : UInt16 = 0x33 | |
| static let escape : UInt16 = 0x35 |
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
| @-moz-document domain('tpondemand.com') { | |
| .tau-board, | |
| .tau-cover-view, | |
| .tau-bubble-board__inner, | |
| .quick-add, | |
| .tau-teams-projects-manager .tau-teams-projects-search, | |
| .tau-teams-projects-manager .tau-teams-projects-search:after, | |
| .tau-bubble__inner, | |
| .system-info, | |
| .tau-in-text, |
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 Foundation | |
| import PlaygroundSupport | |
| /// A thread-safe array. | |
| public class SynchronizedArray<Element> { | |
| private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent) | |
| private var array = [Element]() | |
| public init() { } | |
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 NSImage { | |
| /// Returns the height of the current image. | |
| var height: CGFloat { | |
| return self.size.height | |
| } | |
| /// Returns the width of the current image. | |
| var width: CGFloat { | |
| return self.size.width |
- Proposal: SE-XXXX
- Authors: Chris Lattner, Joe Groff
Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.
This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.
Author: Chris Lattner
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
| // MIT License | |
| // Copyright (c) 2018 Boris Polania | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
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 Sequence { | |
| public func inspect( | |
| _ body: (Element) throws -> Void | |
| ) rethrows -> Self { | |
| for element in self { | |
| try body(element) | |
| } | |
| return 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
| class CRC32 { | |
| static var table: [UInt32] = { | |
| (0...255).map { i -> UInt32 in | |
| (0..<8).reduce(UInt32(i), { c, _ in | |
| (c % 2 == 0) ? (c >> 1) : (0xEDB88320 ^ (c >> 1)) | |
| }) | |
| } | |
| }() | |