Skip to content

Instantly share code, notes, and snippets.

View rcaos's full-sized avatar
🇵🇪
Working from home

Jeans Ruiz rcaos

🇵🇪
Working from home
View GitHub Profile
@davidhq
davidhq / mpv_install.md
Last active August 16, 2022 03:22
mpv ◈ Media Player binary -- Install macOS / linux / windows
@nunogoncalves
nunogoncalves / BetterDecodingError.swift
Last active January 26, 2024 08:37
Better Decoding Error Messages
import Foundation
enum BetterDecodingError: CustomStringConvertible {
case dataCorrupted(_ message: String)
case keyNotFound(_ message: String)
case typeMismatch(_ message: String)
case valueNotFound(_ message: String)
case any(_ error: Error)
@gkostadinov
gkostadinov / ImaggaRouter.swift
Created November 1, 2018 10:21
Ray Wenderlich Alamofire Tutorial - Imagga API V2
//
// ImaggaRouter.swift
// PhotoTagger
//
import Foundation
import Alamofire
public enum ImaggaRouter: URLRequestConvertible {
static let baseURLPath = "https://api.imagga.com/v2"
@skabber
skabber / exportOptions.plist
Last active April 14, 2024 20:47
Export Options Plist Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>app-store</string>
<key>teamID</key>
<string>XXXXXXXXXX</string>
<key>uploadBitcode</key>
<true/>
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 1, 2024 15:48
Swift Concurrency Manifesto
@TheCodedSelf
TheCodedSelf / RxSwiftBindToButton.swift
Created May 13, 2017 17:16
RxSwift: Bind to button taps
import UIKit
import RxSwift
import RxCocoa
let button = UIButton()
button.rx.tap.bind {
print("button tapped")
}
@soggybag
soggybag / CustomTextField.swift
Created April 30, 2016 06:14
Adds border, corner radius, and padding to the UITextField. These properties can be set via the attribute inspector in storyboard.
import UIKit
@IBDesignable
class CustomTextField: UITextField {
var padding: UIEdgeInsets {
get {
return UIEdgeInsets(top: 0, left: paddingValue, bottom: 0, right: paddingValue)
}
}
@kumabook
kumabook / Observable.swift
Last active March 12, 2022 06:47
Observer pattern with swift protocol extension
import Foundation
public protocol Observer: Equatable {
associatedtype EventType
func listen(_ event: EventType)
}
public protocol Observable {
associatedtype ObserverType: Observer
associatedtype EventType
@parmentf
parmentf / GitCommitEmoji.md
Last active April 30, 2024 17:34
Git Commit message Emoji
@oleksii-demedetskyi
oleksii-demedetskyi / ServiceLocator.swift
Last active December 12, 2020 05:04
Service locator in swift
//: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
class ServiceLocator {
private var registry : [String: Any] = [:]
func registerService<T>(service: T) {