Skip to content

Instantly share code, notes, and snippets.

View ivanglushko's full-sized avatar
🧜‍♂️
Sailing in the storm

Ivan Glushko ivanglushko

🧜‍♂️
Sailing in the storm
View GitHub Profile
@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active May 25, 2024 22:48
Files for PlayStation BIOS Files NA-EU-JP
@Revolucent
Revolucent / UIView+Rx.swift
Created October 5, 2018 02:53
isFirstResponder observable with RxSwift
import RxCocoa
import RxSwift
import UIKit
extension Reactive where Base: UIView {
var isFirstResponder: Observable<Bool> {
return Observable
.merge(
methodInvoked(#selector(UIView.becomeFirstResponder)),
methodInvoked(#selector(UIView.resignFirstResponder))
@cprovatas
cprovatas / Data+PrettyPrint.swift
Created May 23, 2018 15:52
Pretty print JSON string from Data in Swift 4.1 (especially useful printing to Xcode console)
import Foundation
extension Data {
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription
guard let object = try? JSONSerialization.jsonObject(with: self, options: []),
let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]),
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil }
return prettyPrintedString
}
@Frizlab
Frizlab / MyAnyHashable.swift
Created May 31, 2017 13:13
A Simple AnyHashable Implementation
protocol HashableBox {
func unbox<T : Hashable>() -> T?
var hashValue: Int {get}
func isEqual(_ other: HashableBox) -> Bool
}
struct ConcreteHashableBox<Base : Hashable> : HashableBox {