Skip to content

Instantly share code, notes, and snippets.

View KoCMoHaBTa's full-sized avatar
🚀
🌔

Milen Halachev KoCMoHaBTa

🚀
🌔
  • Plovdiv, Bulgaria
View GitHub Profile
@KoCMoHaBTa
KoCMoHaBTa / CustomStateObject.swift
Created December 9, 2021 12:40 — forked from DevAndArtist/CustomStateObject.swift
Custom `StateObject` which should be backwards compatible with iOS 13.
import SwiftUI
import Combine
/// The idea is to use State to create a storage object which will be
/// cached and restored by the framework. Then during the update phase we
/// re-inject the object into a nested ObservableObject and subscribe to the
/// ObjectType’s objectWillChange to forward to the _MessageForwarder’s
/// objectWillChange which is already subscribed by the framework as it’s an
/// inner dynamic property of our custom PW which is also a dynamic property.
@propertyWrapper
//
// GMSMapView+ClusterKit.swift
// ClusterKit
//
// Created by Milen Halachev on 5.06.20.
// Copyright © 2020 Elders. All rights reserved.
//
import Foundation
import GoogleMaps
@KoCMoHaBTa
KoCMoHaBTa / MultipartFormData.swift
Last active August 10, 2018 23:12
Multipart Form Data implementation on Swift
//
// MultipartFormData.swift
// https://gist.github.com/KoCMoHaBTa/a4a422cd5daa1c040ca3ab6803202c70
//
// Created by Milen Halachev on 20.07.18.
// Copyright © 2018 Milen Halachev. All rights reserved.
//
import Foundation
@KoCMoHaBTa
KoCMoHaBTa / - Codable Utilities.md
Last active June 11, 2018 08:08
A set of utilities related to Swift Codable API
@KoCMoHaBTa
KoCMoHaBTa / ct.swift
Last active April 27, 2018 12:32
testing if carthage will respect a raw gist file as binary dependecy
//is carthage awesome?
//does gist files change their URLs when modified?
//they do if the file name changes, but do they if only the content changes?
//aprantly, urls changes by revision, howeve, if we skip the second hash (this is probably the revision) - it gets the latest revision.
//
// UserDefaults+Date.swift
// https://gist.github.com/KoCMoHaBTa/78b58cbc920a90faa169ec3c54594d25
//
// Created by Milen Halachev on 7/17/17.
// Copyright © 2017 Milen Halachev. All rights reserved.
//
import Foundation
//
// URLRequest+HTTPMethod.swift
// https://gist.github.com/KoCMoHaBTa/871ac300f258c452902cf5657ea39f9a
//
// Created by Milen Halachev on 2/21/17.
// Copyright © 2017 Milen Halachev. All rights reserved.
//
import Foundation
//
// URLEncodingUtilities.swift
// https://gist.github.com/KoCMoHaBTa/05396e94ed84cb70eb5abd0c91b8452f
//
// Created by Milen Halachev on 7/11/17.
// Copyright © 2016 Milen Halachev. All rights reserved.
//
import Foundation
#!/usr/bin/swift
import Foundation
//Sets the build number into a given Info.plist using the following format 1.2.3.456 where 456 is the build number. This also work if you have a single number for a build number, eg 567.
let usage = "Sets the build number into a given Info.plist using the following format 1.2.3.456 where 456 is the build number.\nThis also work if you have a single number for a build number, eg 567.\n\nUsage: set_build_number.swift <Info.plist path> <build number>\n"
extension String: Error {}
@KoCMoHaBTa
KoCMoHaBTa / OSStatus.swift
Last active February 9, 2023 11:57
OSStatus Utilities
//https://gist.github.com/KoCMoHaBTa/d90dd89c5af4f194848486e78fd39f96
import Foundation
let OSStatusErrorCodeMessageMapping: [OSStatus: String] = [
//the following lines are autogenerated trough OSStatusErrorCodeMessageMappingParser from swift's SecBase (CMD + click on any OSStatus code)
errSecSuccess: "errSecSuccess - No error.",
errSecUnimplemented: "errSecUnimplemented - Function or operation not implemented.",