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
/// A class tracking a sequence/sets of events | |
public class EventCompleter<Event: OptionSet> { | |
/// The set tracking all inserted events | |
public private(set) var eventSet: Event = [] | |
/// The target set that will notify a completion | |
public private(set) var targetSet: Event = [] | |
private var continuation: CheckedContinuation<Void, Error>? |
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 | |
import UIKit | |
open class ArrangedViewContainer: UIView | |
{ | |
public private(set) var hiddenViews = Set<UIView>() | |
private var observations: Set<NSKeyValueObservation> = Set() | |
open private(set) var arrangedSubviews = [UIView]() | |
private var invalidated = false | |
private var viewConstraints: [NSLayoutConstraint] = [] |
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
class Nested<T: Decodable>: Decodable | |
{ | |
let value: T | |
enum DecodeError: Error | |
{ | |
case nestedKeyPathNotConfigure | |
case keyNotConfigured | |
} |
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
infix operator ??= : AdditionPrecedence | |
extension Optional { | |
static func ??= (_ rhs: inout Self, _ lhs: Self) { | |
if rhs == nil { | |
rhs = lhs | |
} | |
} | |
} |
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
#!/bin/sh | |
if ! head -1 "$1" | grep -qE "^(feat|fix|chore|docs|test|style|refactor|perf|build|ci|revert)(\(.+?\))?: .{1,}$"; then | |
echo "Aborting commit. Your commit message is invalid." >&2 | |
exit 1 | |
fi | |
if ! head -1 "$1" | grep -qE "^.{1,88}$"; then | |
echo "Aborting commit. Your commit message is too long." >&2 | |
exit 1 | |
fi | |
# echo "$(cat $1)" | commitlint |
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 'dart:async'; | |
import 'package:flutter/material.dart'; | |
typedef DialogShowHandler<T> = Future<T> Function(); | |
class DialogController { | |
late DialogShowHandler _showDialog; | |
late Function _closeDialog; | |
Completer? _dialogCompleter; |
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 'package:mocktail/mocktail.dart'; | |
import 'package:meta/meta.dart'; | |
import 'package:bloc/bloc.dart'; | |
import 'dart:async'; | |
import 'package:test/test.dart'; | |
abstract class Callable<T> { | |
void call([T? arg]) {} | |
} |
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 AttributeMatcher { | |
enum Comparison { | |
case equal, regex | |
} | |
let name: String | |
let value: String | |
let comparison: Comparison |
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 class DependencyResolver | |
{ | |
public typealias Factory<T> = () -> T | |
public static let shared = DependencyResolver() | |
var factoryDict: TypeDict<Factory<Any>> = [:] | |
public init() {} |
NewerOlder