This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct ProbingDictionary<Key: Hashable, Value> { | |
enum Item: CustomStringConvertible { | |
case element(Key, Value) | |
case empty | |
case tombstone | |
var isEmpty: Bool { | |
if case .empty = self { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ObjectStorage.swift | |
// Soroush Khanlou | |
// | |
// Created by Soroush Khanlou on 3/8/19. | |
// Copyright © 2019 Soroush Khanlou. All rights reserved. | |
// | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// URLRequest.swift | |
// | |
// Created by Peter Prokop on 17/08/2017. | |
// Modified by Soroush Khanlou on 09/12/2018. | |
import Foundation | |
public extension URLRequest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct LazyUniquedSequence<Element>: Sequence { | |
let base: AnySequence<Element> | |
let isEqual: (Element, Element) -> Bool | |
init<S: Sequence>(_ sequence: S, isEqual: @escaping (Element, Element) -> Bool) where S.Element == Element { | |
self.base = AnySequence(sequence) | |
self.isEqual = isEqual | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SKSerialInputStream.h | |
// inputstream | |
// | |
// Created by Soroush Khanlou on 11/4/18. | |
// Copyright © 2018 Soroush Khanlou. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct LazyUniquedSequence<Element>: Sequence { | |
let base: AnySequence<Element> | |
let isEqual: (Element, Element) -> Bool | |
init<S: Sequence>(_ sequence: S, isEqual: @escaping (Element, Element) -> Bool) where S.Element == Element { | |
self.base = AnySequence(sequence) | |
self.isEqual = isEqual | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface HTTPMethod: NSString | |
+ (HTTPMethod *)GET; | |
+ (HTTPMethod *)POST; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package amal.global.amal | |
import android.content.Context | |
import android.graphics.Bitmap | |
import android.graphics.BitmapFactory | |
import android.util.LruCache | |
import com.google.firebase.storage.StorageReference | |
import com.jakewharton.disklrucache.DiskLruCache | |
import java.io.File | |
import java.security.MessageDigest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class PassThroughView: UIView { | |
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { | |
let result = super.hitTest(point, with: event) | |
if result == self { return nil } | |
return result | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct ReversibleRange<Bound>: Equatable where Bound: Comparable { | |
public let startingBound: Bound | |
public let endingBound: Bound | |
public init(startingBound: Bound, endingBound: Bound) { | |
self.startingBound = startingBound | |
self.endingBound = endingBound | |
} | |
public var isReversed: Bool { |