Author: Chris Lattner
This file contains 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
#delete all the remote tags with the pattern your looking for, ie. DEV- | |
git tag | grep <pattern> | xargs -n 1 -i% git push origin :refs/tags/% | |
#delete all your local tags | |
git tag | xargs -n 1 -i% git tag -d % | |
#fetch the remote tags which still remain | |
git fetch |
This file contains 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 | |
class AsyncOperation: Operation { | |
enum State: String { | |
case isReady, isExecuting, isFinished | |
} | |
override var isAsynchronous: Bool { | |
return true | |
} |
This file contains 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
final class CacheLRU<Key: Hashable, Value> { | |
private struct CachePayload { | |
let key: Key | |
let value: Value | |
} | |
private let capacity: Int | |
private let list = DoublyLinkedList<CachePayload>() | |
private var nodesDict = [Key: DoublyLinkedListNode<CachePayload>]() |
This file contains 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 | |
typealias EmptyClosure = () -> Void | |
final class MyEW { | |
let onDo: EmptyClosure | |
init(onDo: @escaping EmptyClosure) { | |
self.onDo = onDo | |
} |