Skip to content

Instantly share code, notes, and snippets.

View MMnasrabadi's full-sized avatar
🤠
i am happy

Mohammad Mohammadi Nasrabadi MMnasrabadi

🤠
i am happy
View GitHub Profile
import Foundation
protocol TransformerType {
associatedtype BaseType
associatedtype TypeForCoding: Codable
static var encodeTransform: (BaseType) throws -> TypeForCoding { get }
static var decodeTransform: (TypeForCoding) throws -> BaseType { get }
}
@propertyWrapper
@MMnasrabadi
MMnasrabadi / Demo.swift
Created June 20, 2020 11:20 — forked from AliSoftware/Demo.swift
NestableCodingKey: Nice way to define nested coding keys for properties
struct Contact: Decodable, CustomStringConvertible {
var id: String
@NestedKey
var firstname: String
@NestedKey
var lastname: String
@NestedKey
var address: String
enum CodingKeys: String, NestableCodingKey {
@MMnasrabadi
MMnasrabadi / fazl-cheshmak-zan.sh
Last active June 25, 2020 11:34 — forked from iamvee/fazl-cheshmak-zan.sh
This is from the grace of my Lord
echo "\033[31;32m \033[0m"
echo "\033[31;32m ## \033[0m"
echo "\033[31;32m ### \033[0m"
echo "\033[31;32m ###** #########*####**** \033[0m"
echo "\033[31;32m ## ############********* #* \033[0m"
echo "\033[31;32m *######***** ### #* \033[0m"
echo "\033[31;32m # * #* \033[0m"
echo "\033[31;32m ## # # ## ###' #*