Skip to content

Instantly share code, notes, and snippets.

import RxSwift
import RxCocoa
@dynamicMemberLookup
protocol DynamicMemberLookupableObservableType: AssociateObservable {
subscript<T>(dynamicMember keyPath: KeyPath<Value, T>) -> Observable<T> { get }
}
extension DynamicMemberLookupableObservableType {
subscript<T>(dynamicMember keyPath: KeyPath<Value, T>) -> Observable<T> {
#!/bin/bash
BUILD_DIRECTORY="Build"
function archive_project() {
project_name=$1
framework_name=$2
# Archive iOS project.
xcodebuild archive\
//
// ViewController.swift
// SampleApp
//
// Created by minsOne on 2022/01/18.
//
import UIKit
import PinLayout
import FlexLayout
- Supports opening documents in place LSSupportsOpeningDocumentsInPlace
- Application supports iTunes file sharing UIFileSharingEnabled
alias pip3='pip3 --trusted-host pypi.org --trusted-host files.pythonhosted.org'
alias cXed='rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState && xed .'
alias clearXcode='rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState'
tuist graph -t -f dot && sed -E '/(Testing)|(Example)/d' graph.dot > /tmp/tuist_graph.dot
dot -Tpdf /tmp/tuist_graph.dot -o graph.pdf && open graph.pdf
dot -Tpng /tmp/tuist_graph.dot -o graph.png
rm graph.dot
@minsOne
minsOne / query-param.codable.swift
Created July 14, 2021 04:35 — forked from RobertMenke/query-param.codable.swift
Swift Codable to URL Query String
import Foundation
import DictionaryCoding
/// Note: This relies on the DictionaryCoding package https://github.com/elegantchaos/DictionaryCoding
struct QueryParamEncoder {
func encode<T: Encodable>(_ item: T) throws -> String {
let encoder = DictionaryEncoder()
let encoded: [String: Any] = try encoder.encode(item)
let queryParams = encodeDictionary(encoded)
@minsOne
minsOne / dynamicMemberLookup Builder
Last active July 13, 2023 07:22
dynamicMemberLookup Builder
// refer: https://woowabros.github.io/swift/2021/02/18/swift-dynamic-features.html
@dynamicMemberLookup
public struct Builder<Base: AnyObject> {
private var base: Base
public init(_ base: Base) {
self.base = base
}
alias cXed='rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState && xed .'
@minsOne
minsOne / KaleidoscopeView.swift
Created March 18, 2021 05:06 — forked from izakpavel/KaleidoscopeView.swift
An animation with a kaleidoscope effect
import SwiftUI
struct HalfShape: Shape {
let left: Bool
func path(in rect: CGRect) -> Path {
return Path { path in
let width = rect.width
let height = rect.height