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 TimeInterval { | |
var milliseconds: Int { | |
return Int((truncatingRemainder(dividingBy: 1)) * 1000) | |
} | |
var seconds: Int { | |
return Int(self) % 60 | |
} | |
var minutes: Int { |
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 '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; |
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 '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; |
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
// | |
// MockURLProtocol.swift | |
// APIClientTests | |
// | |
// Created by Daniel Cardona Rojas on 31/07/20. | |
// Copyright © 2020 Daniel Cardona Rojas. All rights reserved. | |
// | |
import Foundation |
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 UIKit | |
public typealias Action = (UIControl) -> Void | |
extension NSObject { | |
var uniqueId: String { | |
return String(describing: self) | |
} | |
} |
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 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? { |
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
# gen_ios_icons.sh | |
# Params: (filename) (width 1x) (height 1x) | |
# Get filename without an extension | |
filename=$1 | |
filename_length=${#1} | |
name_length=$((filename_length-4)) | |
name=${filename:0:$name_length} | |
mkdir $name | |
rsvg-convert -w $2 -h $3 $filename > $name/$name.png | |
rsvg-convert -w $((2*$2)) -h $((2*$3)) $filename > $name/[email protected] |
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 UIColor { | |
public convenience init?(hex: String) { | |
let r: CGFloat | |
let g: CGFloat | |
let b: CGFloat | |
let a: CGFloat | |
let start = hex.index(hex.startIndex, offsetBy: hex.hasPrefix("#") ? 1 : 0) | |
var hexColor = String(hex[start...]) | |
if hexColor.count == 6 { hexColor += "FF" } |
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
#! /usr/bin/awk -f | |
BEGIN { | |
print "\ | |
// This file is autogenerated do not modify\ | |
\ | |
import Foundation\ | |
"; | |
print "public struct TextResource {" | |
} |
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
#! /usr/bin/awk -f | |
BEGIN { | |
FS="\][ ]*[-]*[ ]*" | |
} | |
/^\[.*\]/ { | |
sub(/\[/, "", $1) | |
if (NR == 1) { | |
previous_commit_tag = $1 | |
commit_message = "\t- " $2 |