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
module Fastlane | |
module Actions | |
module SharedValues | |
IPA_OUTPUT_PATH = :IPA_OUTPUT_PATH | |
end | |
class BuildSignedIpaAction < Action | |
def self.run(params) | |
workspace_path = params[:workspace_path] | |
scheme = params[:scheme] |
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 | |
class User { | |
let name: String | |
init(name: String) { | |
self.name = name | |
} | |
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
# | |
# Uncrustify Configuration File | |
# File Created With UncrustifyX 0.4.3 (252) | |
# | |
# Alignment | |
# --------- | |
## Alignment |
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/Foundation.h> | |
@interface ArrayMapper <InputType, OutputType> : NSObject | |
- (nonnull NSArray <OutputType> *)map:(nonnull NSArray <InputType> *)inputArray withBlock:(nonnull OutputType _Nonnull (^)(InputType _Nonnull obj))block; | |
- (nonnull NSArray <OutputType> *)flatMap:(nonnull NSArray <InputType> *)inputArray withBlock:(nonnull OutputType _Nullable (^)(InputType _Nonnull obj))block; | |
@end | |
@implementation ArrayMapper |
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
extension String { | |
/// For "TEST" returns ["T", "TE", "TES", "TEST"] | |
var keystrokeSubsequences: [String] { | |
let start = distance(from: startIndex, to: startIndex) | |
let end = distance(from: startIndex, to: endIndex) | |
return (start...end).map { index in | |
let substringEnd = self.index(startIndex, offsetBy: index) | |
let substring = self[..<substringEnd] | |
return String(substring) |
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 | |
extension UIColor { | |
convenience init?(hexRed red: Int, green: Int, blue: Int, alpha: Int = 255) { | |
guard red >= 0 && red <= 255 else { return nil } | |
guard green >= 0 && green <= 255 else { return nil } | |
guard blue >= 0 && blue <= 255 else { return nil } | |
self.init(red: CGFloat(red) / 255.0, |
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 Swinject | |
struct NamedRegistration<Service> { | |
let service: Service.Type | |
let name: String | |
} | |
extension NamedRegistration { | |
static func named<Service>(_ name: String) -> NamedRegistration<Service> { | |
return NamedRegistration<Service>(service: Service.self, name: name) |
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
protocol Creating { | |
associatedtype Arguments | |
associatedtype Service | |
func create(_ arguments: Arguments) -> Service | |
} | |
extension Creating where Arguments == Void { | |
func create() -> Service { | |
return create(()) | |
} |
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 GradientView: UIView { | |
init(style: GradientStyle) { | |
super.init(frame: .zero) | |
isUserInteractionEnabled = false | |
gradientLayer.colors = style.colors.map { $0.color.cgColor } | |
gradientLayer.locations = style.colors.map { NSNumber(value: $0.location) } | |
gradientLayer.startPoint = style.direction.startPoint |
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 | |
extension UIScrollView { | |
var viewport: CGRect { | |
return CGRect( | |
origin: CGPoint( | |
x: contentOffset.x + adjustedContentInset.left, | |
y: contentOffset.y + adjustedContentInset.top | |
), | |
size: CGSize( |
OlderNewer