Skip to content

Instantly share code, notes, and snippets.

View YK-Unit's full-sized avatar
🐬
swimming in computing-ocean

YorkFish YK-Unit

🐬
swimming in computing-ocean
View GitHub Profile
@YK-Unit
YK-Unit / RawRepresentableExtension
Created April 9, 2018 03:18 — forked from aryaxt/RawRepresentableExtension
Swift enum -> Get an array of all cases
extension RawRepresentable where Self: Hashable {
private static func iterateEnum<T: Hashable>(_: T.Type) -> AnyIterator<T> {
var index = 0
let closure: () -> T? = {
let next = withUnsafePointer(to: &index) {
$0.withMemoryRebound(to: T.self, capacity: 1) { $0.pointee }
}
guard next.hashValue == index else { return nil }
@YK-Unit
YK-Unit / git-flow.md
Created November 9, 2016 07:11 — forked from yesmeck/git-flow.md
Git 开发流程

Git 协作流程

master 分支

master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。

develop 分支

开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。