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 / Mergeable.swift
Created May 13, 2018 12:39
Mergeable Protocol Example
import Foundation
protocol Mergeable {
func merge(_ target: Self)
}
extension Mergeable {
func merge(_ target: Self) {
guard let source = self as? NSObject else { return }
@GeekTree0101
GeekTree0101 / ChatFlowLayoutExample.swift
Created June 6, 2018 03:14
Texture Chat Application UICollectionView Flow Layout Example
import Foundation
import AsyncDisplayKit
class ChatFlowLayoutExample: UICollectionViewFlowLayout {
private var topVisibleItem = Int.max
private var bottomVisibleItem = -Int.max
private var offset: CGFloat = 0.0
private var visibleAttributes: [UICollectionViewLayoutAttributes]?
private var isPrepend: Bool = false
@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 / ASVideoNode-Feed-Example.swift
Last active January 13, 2021 03:01
Simple Video Feed Performance Improvement Experiment
import AsyncDisplayKit
struct VideoProcessing {
private static let loadOperation: OperationQueue = {
let operationQueue = OperationQueue()
operationQueue.maxConcurrentOperationCount = 3
operationQueue.name = "com.VideoFeedController.VideoLoaderOperation"
operationQueue.qualityOfService = .utility
return operationQueue
}()