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
// The trick is to link the DeviceSupport folder from the beta to the stable version. | |
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
// Support iOS 13.2 devices (Xcode 11.2) with Xcode 11.1: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.2 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
// Xcode 10.3 to Xcode 11 | |
sudo ln -s /Applications/Xcode-11.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0 /Applications/Xcode-10.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions |
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
// | |
// SwipeableCell.swift | |
// Antony Alkmim | |
// | |
// Created by Antony Alkmim on 09/07/18. | |
// Inspired by: https://www.raywenderlich.com/62435/make-swipeable-table-view-cell-actions-without-going-nuts-scroll-views | |
// | |
import UIKit | |
import PINRemoteImage |
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
// | |
// UIViewController+ext.swift | |
// Antony Alkmim | |
// | |
// Created by Antony Alkmim on 03/07/18. | |
// Copyright © 2018 Antony Alkmim. All rights reserved. | |
// | |
import UIKit |
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
infix operator ?!: NilCoalescingPrecedence | |
@_transparent | |
public func ?!<T: OptionalType>(value: T, error: @autoclosure () -> Error) throws -> T.ValueType { | |
if let value = value.optionalValue { return value } | |
throw error() | |
} |
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
const calcularDigito = (str, peso) => { | |
var soma = 0; | |
var indice = str.length - 1; | |
var digito; | |
while (indice >= 0) { | |
digito = parseInt(str.substring(indice, indice + 1)); | |
soma += digito * peso[peso.length - str.length + indice]; | |
indice-- |
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
package com.myapp.app.ui.auth | |
import android.os.Build | |
import android.os.Bundle | |
import android.support.v4.content.ContextCompat | |
import android.support.v7.app.AppCompatActivity | |
import android.view.Gravity | |
import android.view.MenuItem | |
import android.view.View | |
import android.view.WindowManager |
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 Foundation | |
protocol UserDefaultsDelegate: class { | |
func theObject(forKey key: String) -> Any? | |
func setTheObject(_ object: Any, forKey key: String) | |
func removeTheObject(forKey key: String) | |
func synchronizeAll() | |
} | |
class UserDefaultsService: NSObject { |
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 Foundation | |
import RxSwift | |
extension HttpService: ReactiveCompatible { } | |
extension Reactive where Base: HttpServiceType { | |
func request(_ endpoint: Base.Target) -> Single<Data> { | |
return Single<Data>.create(subscribe: { [weak base] single in | |
let task = base?.request(endpoint, responseData: { result in |
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
// | |
// Billit.swift | |
// antonyalkmim | |
// | |
// Implementacao da classe boleto para identificar valor, data de vencimento e linha digitavel a partir de um codigo de barras | |
// ou identificar valor e data de vencimento a partir de uma linha digitavel. | |
// Todas as regras implementadas seguem a documentacao da FEBRABRAN (https://cmsportal.febraban.org.br/Arquivos/documentos/PDF/Layout%20-%20C%C3%B3digo%20de%20Barras%20-%20Vers%C3%A3o%205%20-%2001_08_2016.pdf) | |
// | |
// Created by Antony Alkmim on 26/01/18. | |
// |
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
opt_in_rules: # some rules are only opt-in | |
# - missing_docs | |
- attributes | |
- closure_end_indentation | |
- closure_spacing | |
- empty_count | |
- explicit_init | |
- explicit_top_level_acl | |
- extension_access_modifier | |
- fatal_error_message |