View Resolver.swift
@propertyWrapper | |
public struct Inject<Component> { | |
var component: Component | |
public init() { | |
self.component = Resolver.shared.resolve(Component.self) | |
} | |
public var wrappedValue: Component { |
View TimeInterval+Extensions.swift
extension TimeInterval { | |
var milliseconds: Int { | |
return Int((truncatingRemainder(dividingBy: 1)) * 1000) | |
} | |
var seconds: Int { | |
return Int(self) % 60 | |
} | |
var minutes: Int { |
View logging.dart
import 'dart:convert'; | |
import 'package:logger/logger.dart'; | |
import 'package:meta/meta.dart'; | |
mixin Logging { | |
Logger _logger; | |
Logger get log { | |
return _logger ??= Logger( |
View UIViewExtensions.swift
extension UIView { | |
func makeCircular() -> NSKeyValueObservation { | |
self.layer.cornerRadius = self.bounds.width/2 | |
clipsToBounds = true | |
let observation = observe(\UIView.bounds, changeHandler: { this, change in | |
this.layer.cornerRadius = this.bounds.width/2 | |
}) | |
return observation | |
} |
View circular_progress_border.dart
import 'package:flutter/material.dart'; | |
import 'dart:math'; | |
class CircularProgressBorder extends StatelessWidget { | |
final Color backgroundColor; | |
final Color progressColor; | |
final Color unfilledColor; | |
final double progress; | |
final double thickness; | |
final double offset; |
View dialog_controller.dart
import 'dart:async'; | |
import 'package:flutter/material.dart' as material; | |
import 'package:flutter/material.dart' show BuildContext, Widget, Navigator; | |
class DialogController { | |
final BuildContext context; | |
final Widget Function(BuildContext) builder; | |
Future<dynamic> value; |
View git_log_format.awk
#! /usr/bin/awk -f | |
BEGIN { | |
FS="\][ ]*[-]*[ ]*" | |
} | |
/^\[.*\]/ { | |
sub(/\[/, "", $1) | |
if (NR == 1) { | |
previous_commit_tag = $1 | |
commit_message = "\t- " $2 |
View MockURLProtocol.swift
// | |
// MockURLProtocol.swift | |
// APIClientTests | |
// | |
// Created by Daniel Cardona Rojas on 31/07/20. | |
// Copyright © 2020 Daniel Cardona Rojas. All rights reserved. | |
// | |
import Foundation |
View EZAction.swift
import UIKit | |
public typealias Action = (UIControl) -> Void | |
extension NSObject { | |
var uniqueId: String { | |
return String(describing: self) | |
} | |
} |
View UIApplication+Extensions.swift
extension UIApplication { | |
static var appVersion: String? { | |
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String | |
} | |
static var buildVersion: String? { | |
return Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String | |
} | |
static var fullVersion: String? { |
NewerOlder