This file contains 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
struct ListCellView: View { | |
struct Selection: Equatable { | |
let label: String | |
let frame: CGRect | |
} | |
@State private var cellFrame: CGRect = .zero | |
let label: String | |
let action: (Selection) async -> Void |
This file contains 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
/// One of the motivations for this gist is a protocol that receives a Generic value and needs to return a value that may or may not be an optional. | |
/// Something like: | |
/// | |
/// protocol Parser { | |
/// static func parse<T: Decodable>(data: Data) -> T? | |
/// } | |
/// | |
/// This causes the issue of having to check the response type, even when you don't want to accept a nil value (ever) | |
/// let response: String? = parser.parse(data: Data()) | |
/// if response == nil { |
This file contains 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 Combine | |
import PlaygroundSupport | |
func request<Failure: Error, Output: Publisher>(url: URLRequest, | |
session: URLSession = .shared, | |
queue: DispatchQueue = .main, | |
parser: @escaping (Data) -> Output, | |
parseError: @escaping (Error) -> Failure, | |
completion: @escaping (Result<Output.Output, Failure>) -> Void) -> AnyCancellable { |
This file contains 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
/// Method used to retry a UI Test check, and wait for a while before declaring failure. | |
/// This can be useful to bypass animation or screen transition failures. | |
/// The original snippet was extracted from [Javi](https://twitter.com/Javi) | |
/// on a [thread](https://twitter.com/Javi/status/1255181595515863042) regarding UI Test strategies. | |
/// | |
/// - Parameters: | |
/// - test: Block that will be evaluated on each test loop | |
/// - description: Description of the operation. Used on fail message | |
/// - timeout: Maximum time that will be waited before failing | |
/// - fatal: Indicator if the failure on the test block will be fatal to the test or not |
This file contains 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
function killdd() { | |
if pgrep -x "Xcode" > /dev/null | |
then | |
killall Xcode | |
fi | |
rm -rf ~/Library/Developer/Xcode/DerivedData | |
open $(xcode-select --print-path) | |
} |
This file contains 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 | |
//: This is a sample code of the resolution of the FizzBuz code test, explained by [Tom Scott on the YouTube](https://youtu.be/QPZ0pIK_wsc) | |
/// The InputRule protocol is used to abstract a type that have a specific rule | |
protocol InputRule { | |
associatedtype ModifierInput | |
var rule: ModifierInput { get } | |
} |
This file contains 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 | |
enum CardTypeError:Error { | |
case TypeNotFound | |
} | |
enum CardType:CustomStringConvertible { | |
case visa | |
case mastercard | |
case amex |
This file contains 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 publicação de conteúdo em redes sociais não é uma construção de um CV público. | |
Assim como a contribuição com projetos open source não se caracteriza, por si só, como um portfólio de venda. | |
Não é porque postei receitas e fiz checkin em restaurantes que tenho pretensão em ser crítico da Michelin. | |
Vocês indexam e expõe devs como se os mesmos estivessem aptos a serem bombardeados com spam de empresas e propostas de freelas ou projetos irrelevantes para o profissional. | |
Inclusive, listando tecnologias que a pessoa não domina, gerando uma propaganda falsa. | |
Foram além e infringiram regras do GitHub para coleção de dados: | |
https://twitter.com/ezefranca/status/808344095919894529 |
This file contains 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 android.support.test.runner.AndroidJUnit4; | |
import android.test.suitebuilder.annotation.LargeTest; | |
import org.junit.Rule; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import static android.support.test.espresso.Espresso.onView; | |
import static android.support.test.espresso.Espresso.pressBack; | |
import static android.support.test.espresso.action.ViewActions.click; |
NewerOlder