Skip to content

Instantly share code, notes, and snippets.

View andrewmunn's full-sized avatar

Andrew Munn andrewmunn

  • Lindy
  • San Francisco
View GitHub Profile
@andrewmunn
andrewmunn / joinToString.kt
Created February 28, 2018 07:33
JoinToString
/**
* 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 = "",
@andrewmunn
andrewmunn / joinTo.kt
Last active February 28, 2018 07:36
Iterable.JoinTo
/**
* 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 = "",
@andrewmunn
andrewmunn / config.yml
Last active September 10, 2019 21:05
Split Gradle
...
- 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}
;;
...
@andrewmunn
andrewmunn / build.gradle
Last active September 10, 2019 21:55
Configuring the root build.gradle to allow parallel test runs on CircleCi
subprojects {
afterEvaluate { project ->
if (project.plugins.findPlugin('android') ?: project.plugins.findPlugin('android-library')) {
android {
... // other config
testOptions {
unitTests.all {
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mymodule:testDebugUnitTest'.
> No tests found for given includes: [TestClassNames](--tests filter)
// 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;