This file contains hidden or 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
[buildPlans.IosevkaNano] | |
family = "Iosevka Nano" | |
spacing = "normal" | |
serifs = "sans" | |
noCvSs = true | |
exportGlyphNames = false | |
[buildPlans.IosevkaNano.variants] | |
inherits = "ss20" |
This file contains hidden or 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 Xcutils < Formula | |
desc 'A collection of utilities that aid with the use of the Xcode CLI, packaged as a single SwiftPM Package.' | |
homepage 'https://github.com/JosephDuffy/xcutils' | |
url 'https://github.com/JosephDuffy/xcutils/archive/v0.1.2-rc2.tar.gz' | |
sha256 '82200150a8d6ce1e91f7258724716e52fb1c932e78bafb596d40e32388c39583' | |
license 'MIT' | |
version '0.1.2' | |
def install | |
system 'swift', 'build', |
This file contains hidden or 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 SpmPlayground < Formula | |
desc "Command line tool to create an Xcode project with a Playground and an SPM library ready for use in it" | |
homepage "https://github.com/finestructure/SPMPlayground" | |
url "https://github.com/finestructure/SPMPlayground/archive/0.4.0.tar.gz" | |
sha256 "774868a14a8bc5f5002979613543463fee7f381b7349b865e956a1a44fbf3940" | |
version '0.4.0' | |
depends_on :xcode => ["11.0", :build, :test] | |
def install |
This file contains hidden or 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 RxRelay | |
import RxSwift | |
@propertyWrapper | |
public struct BehaviorRelayWrapping<T> { | |
private let subject: BehaviorRelay<T> | |
// MARK: PropertyWrapper | |
public let wrappedValue: Observable<T> |
This file contains hidden or 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
found_rbenv='' | |
rbenvdirs=("$HOME/.rbenv" "$HOME/.local/rbenv" "/usr/local/opt/rbenv" "/usr/local/rbenv" "/opt/rbenv") | |
for rbenvdir in "${rbenvdirs[@]}" ; do | |
if [ -z "$found_rbenv" ] && [ -d "$rbenvdir/versions" ]; then | |
found_rbenv=true | |
if [ -z "$RBENV_ROOT" ]; then | |
RBENV_ROOT=$rbenvdir | |
export RBENV_ROOT | |
fi |
This file contains hidden or 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 wrapper around a repeating timer that does not require invalidation. | |
final class Pendulum { | |
let timer: Timer | |
init(seconds: TimeInterval, closure: @escaping () -> ()) { | |
timer = Timer.scheduledTimer( | |
withTimeInterval: seconds, | |
repeats: true, | |
block: { _ in | |
closure(); |
This file contains hidden or 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 Request where Response: Decodable { | |
func handle( | |
response: Result<Data, Error>, | |
completion: (Result<Response, Error>) -> Void) { | |
completion(Result { | |
try JSONDecoder().decode(Response.self, from: response.get()) | |
}) | |
} | |
} |
This file contains hidden or 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
dispatchPrecondition( | |
condition: DispatchPredicate.onQueue(DispatchQueue.main) | |
) |
This file contains hidden or 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 type representing an alternative of one of two types. | |
/// | |
/// By convention, and where applicable, `Left` is used to indicate failure, while `Right` is used to indicate success. (Mnemonic: “right” is a synonym for “correct.”) | |
/// | |
/// Otherwise, it is implied that `Left` and `Right` are effectively unordered alternatives of equal standing. | |
public enum Either<Left, Right> { | |
case left(Left) | |
case right(Right) | |
/// Returns the value of `Left` instances, or `nil` for `Right` instances. |
NewerOlder