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
// fetch and display trending gifs from giphy using the giphy api via axios | |
import React, { useEffect, useState } from 'react'; | |
import axios from 'axios'; | |
interface Trending { | |
id: string; | |
title: string; | |
images: { | |
fixed_height: { | |
url: string; |
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
FAILURE: Build failed with an exception. | |
* What went wrong: | |
Execution failed for task ':mymodule:testDebugUnitTest'. | |
> No tests found for given includes: [TestClassNames](--tests filter) |
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
subprojects { | |
afterEvaluate { project -> | |
if (project.plugins.findPlugin('android') ?: project.plugins.findPlugin('android-library')) { | |
android { | |
... // other config | |
testOptions { | |
unitTests.all { |
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
... | |
- run: | |
command: | | |
TESTFILES=$(circleci tests glob "**/src/test/java/your/app/package/**/*Test.*" | circleci tests split --split-by=timings | tr ' ' $'\n' | sed -e 's/.*\//--tests /g' | sed -e 's/.kt//g' | sed -e 's/.java//g' | tr '\n' $' ') | |
echo ./gradlew testDebug ${TESTFILES} | |
./gradlew testDebug ${TESTFILES} | |
;; | |
... |
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
/** | |
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. | |
* | |
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] | |
* elements will be appended, followed by the [truncated] string (which defaults to "..."). | |
*/ | |
public fun <T, A : Appendable> Iterable<T>.joinTo( | |
buffer: A, | |
separator: CharSequence = ", ", | |
prefix: CharSequence = "", |
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
/** | |
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. | |
* | |
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] | |
* elements will be appended, followed by the [truncated] string (which defaults to "..."). | |
*/ | |
public fun <T> Iterable<T>.joinToString( | |
separator: CharSequence = ", ", | |
prefix: CharSequence = "", | |
postfix: CharSequence = "", |
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
fun toSingleLineStringForDisplay() = | |
listOfNotNull(street1, street2, street3, street4, city, "$state $postalCode") | |
.joinToString() |
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
fun toSingleLineStringForDisplay() = buildString { | |
append(street1, ", ") | |
street2?.let { append(it, ", ") } | |
street3?.let { append(it, ", ") } | |
street4?.let { append(it, ", ") } | |
append("$city, $state $postalCode") | |
} |
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
fun toSingleLineStringForDisplay(): String { | |
val sb = StringBuilder() | |
sb.append(street1).append(", ") | |
if (street2 != null) { | |
sb.append(street2).append(", ") | |
} | |
if (street3 != null) { | |
sb.append(street3).append(", ") | |
} | |
if (street4 != null) { |
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
/** | |
* Builds new string by populating newly created [StringBuilder] using provided [builderAction] | |
* and then converting it to [String]. | |
*/ | |
public inline fun buildString(builderAction: StringBuilder.() -> Unit): String = | |
StringBuilder().apply(builderAction).toString() |
NewerOlder