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
tailrec fun fizzbuzz(vararg args: Int) { | |
if (args.isEmpty()) return | |
val arg = args[0] | |
when { | |
arg % 15 == 0 -> print("FizzBuzz") | |
arg % 3 == 0 -> print("Fizz") | |
arg % 5 == 0 -> print("Buzz") | |
} |
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
suspend fun getCards() = | |
service.getCards() | |
.async(IO.async()) | |
.fix() | |
.map { response -> | |
when (response.code()) { | |
200 -> response.body()?.cards?.right() ?: NoContent.left() | |
204 -> NoContent.left() | |
404 -> NoInternetConnection.left() | |
401 -> NotAllowedError.left() |
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 android.app.Activity | |
import android.app.Dialog | |
import android.content.Context | |
import android.view.View | |
import androidx.fragment.app.Fragment | |
import androidx.test.platform.app.InstrumentationRegistry | |
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation | |
import com.facebook.testing.screenshot.Screenshot | |
import com.facebook.testing.screenshot.ViewHelpers |
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
/** | |
* We often run into a problem with functions that select DOM nodes like | |
* `cy.get`, where in between the `cy.get` call and the next item in the chain, | |
* the DOM element that `cy.get` found ends up being removed from the DOM. This | |
* can affect code as simple as: | |
* | |
* cy.get('button').click(); | |
* | |
* When it fails sporadically, it uses the following error message: | |
* |
OlderNewer