Skip to content

Instantly share code, notes, and snippets.

View GeekTree0101's full-sized avatar
🚀

David Ha (小河) GeekTree0101

🚀
View GitHub Profile
@GeekTree0101
GeekTree0101 / elixir.gif
Last active November 14, 2023 12:55
elixir.gif
elixir.gif
@GeekTree0101
GeekTree0101 / TheProgrammersBrain34page.swift
Created January 15, 2022 02:36
TheProgrammersBrain34page.swift
enum CouponStatus {
case notExist
case retry
case expired
case active
case get
case used
extension Router: Delegate {
func dismissAndPresentWriteForm(_ groupID: Int?) {
self.viewController?.present(WriteFormViewController(), animated: true)
}
}
class 제이가만든뷰컨트롤러 {
var selectedGroupID: Int? {
struct ViewModel {
let id: Int
let name: String
let hasLock: Bool
}
let groups: [FleaMarketGroup] = ...
let viewModels: [ViewModel] = groups.map { hasLock: true } + [ViewModel( hasLock: false)]
@GeekTree0101
GeekTree0101 / abstractCase.swift
Last active November 1, 2021 02:44
Usecase 추상화 vs 실객체
protocol FeedUsecase { }
final class BusinessFeedUsecase: FeedUsecase {
init(repo: ArticleRepositoryProtocol) { ... }
}
final class FleaMarketFeedUsecase: FeedUsecase {
init(repo: ArticleRepositoryProtocol) { ... }
import Foundation
import HaihwanFoundation
struct AppDependency {
let networking: NetworkingLogic
let authWorker: AuthWorkerLogic
let propertyWorker: PropertyWorkerLogic
@GeekTree0101
GeekTree0101 / dx.swift
Created June 19, 2020 03:53
Texture DX experiment
import AsyncDisplayKit
import BonMot
// MARK: - Action
extension TestNode {
public var didTapButton: () -> Void {
return buttonNode.on(.touchUpInside)
}
@GeekTree0101
GeekTree0101 / Syncronizer.swift
Last active February 27, 2020 03:12
Domain Model Syncronizer
protocol Syncronizable {
func isSyncronizable(from value: Self?) -> Bool
}
class Syncronizer {
static let shared = Syncronizer()
@GeekTree0101
GeekTree0101 / test.swift
Created January 22, 2020 07:23
상태 검증 vs 행위 검증
class Object {
var isEnabled: Bool = false
func test() {
isEnabled = true
}
}
class SpyObject: Object {