I hereby claim:
- I am fpg1503 on github.
- I am fpg1503 (https://keybase.io/fpg1503) on keybase.
- I have a public key ASDU6qes4rGLHgi4QuFxVydgxs2tY8JAR69otLKik8M63go
To claim this, I am signing this object:
// | |
// ImageFromUrl.swift | |
// | |
// Created by Francesco Perrotti-Garcia on 1/19/15. | |
// Copyright (c) 2015 Francesco Perrotti-Garcia. All rights reserved. | |
// | |
import Foundation | |
import UIKit | |
import ObjectiveC |
protocol DragViewDelegate { | |
var acceptedFileExtensions: [String] { get } | |
func dragView(dragView: DragView, didDragFileWith URL: NSURL) | |
} | |
class DragView: NSView { | |
required init?(coder: NSCoder) { | |
super.init(coder: coder) | |
registerForDraggedTypes([NSFilenamesPboardType, NSURLPboardType]) |
extension String { | |
mutating func appendLine(line: String = "") { | |
self += "\n\(line)" | |
} | |
mutating func appendMark(mark: String) { | |
self.appendLine() | |
self.appendLine("//MARK - \(mark)") | |
self.appendLine() | |
} |
import UIKit | |
/// A subclass of NSLayoutConstraint where the constant is in pixels and not points | |
final class PixelPerfectConstraint: NSLayoutConstraint { | |
@IBInspectable var constantInPixels: Int = 0 { | |
didSet { | |
constant = CGFloat(constantInPixels) / UIScreen.mainScreen().scale | |
} | |
} |
I hereby claim:
To claim this, I am signing this object:
enum Resize { | |
case current | |
case resize(CGSize) | |
} | |
extension UIImage { | |
func resize(_ resize: Resize) -> UIImage? { | |
guard case let .resize(size) = resize else { return self } | |
POST https://www1.sistemas.unicamp.br/Mobile/ConsultaSaldo
Key | Value |
---|---|
Content-Type | application/x-www-form-urlencoded |
// ([^#\n]*)\s#([\dA-F]{6}) | |
// (name: "$1", color: UIColor(hex: 0x$2)), | |
typealias NamedColor = (name: String, color: UIColor) | |
extension CGFloat { | |
var prettyString: String { | |
let formatter = NumberFormatter() | |
formatter.numberStyle = .decimal | |
formatter.roundingMode = .halfUp | |
formatter.maximumFractionDigits = 10 |
#!/usr/bin/perl -w | |
# Inspired on: | |
# settings: | |
# .swift files may be set as well, just set "swift" if needed | |
my $sourceFileExtension = "swift"; | |
# if set, the script will only check Localizable.strings files, otherwse all available .strings files | |
my $stringsFileName = "pt-BR.lproj/Localizable.strings"; |
struct DateFormat: DateFormatConvertible { | |
let dateFormat: String | |
init() { | |
dateFormat = "" | |
} | |
init(format: DateFormatConvertible) { | |
dateFormat = format.dateFormat | |
} |