How to setup: https://cloud.google.com/text-to-speech/docs/create-audio-text-command-line?hl=es-419
List of voices: https://cloud.google.com/text-to-speech/docs/voices?hl=es-419
| val CaptainCrunch = Lib("../android-common--lib-android-captain-crunch", "com.adevinta.android:captaincrunch" to ":captaincrunch") | |
| val AndroidExtensions = Lib("../android-common--lib-android-extensions", "com.adevinta.android:android-extensions" to ":android-extensions") | |
| val Barista = Lib("../Barista", "com.schibsted.spain:barista" to ":library") | |
| val AbTestingRunner = Lib( | |
| "../android-common--lib-abtesting-runner", | |
| "com.adevinta.android:abtesting" to ":abtesting", | |
| "com.adevinta.android:abtesting-apptimize" to ":abtesting-apptimize", | |
| "com.adevinta.android:abtesting-optimizely" to ":abtesting-optimizely", | |
| "com.adevinta.android:abtesting-debug" to ":abtesting-debug", | |
| "com.adevinta.android:abtesting-debugdrawer" to ":abtesting-debugdrawer", |
| void main() async { | |
| Stopwatch stopwatch = new Stopwatch()..start(); | |
| var p1 = delay(Duration(seconds: 2)); | |
| var p2 = delay(Duration(seconds: 4)); | |
| await p1; | |
| await p2; | |
| print('Executed in ${stopwatch.elapsed}'); |
| import com.google.firebase.perf.FirebasePerformance | |
| object FirebasePerformanceWrapper { | |
| fun <T> trace(name: String, block: () -> T): T { | |
| val trace = runCatching { FirebasePerformance.getInstance().newTrace(name) }.getOrNull() | |
| trace?.start() | |
| val result = block() | |
| trace?.stop() | |
| return result |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.concurrent.CompletableFuture; | |
| import java.util.stream.Collectors; | |
| import java.util.stream.Stream; | |
| class SyncAsync { | |
| public static void main(String[] args) { | |
| for (int i = 0; i < 10; i++) { | |
| new Thread(() -> { |
| git log --after={2019-06-01} --pretty=format: --name-only | sort | uniq -c | sort -rg | grep "\.java" | head -10 |
| git log --name-status $* --after='2018-01-01 00:00:00' | \ | |
| grep -E '^[A-Z]\s+' | \ | |
| cut -c3-500 | \ | |
| sort | \ | |
| uniq -c | \ | |
| grep -vE '^ {6}1 ' | \ | |
| sort -n | \ | |
| grep -E '.+\.java?' | \ | |
| tail -n 20 | \ | |
| sort -n -r |
| fun fibKotlinClass(n: Int): String { | |
| return when (n) { | |
| 1, 2 -> "class Fib$n" | |
| else -> "class Fib$n(val fibM1: Fib${n - 1}, val fibM2: Fib${n - 2})" | |
| } | |
| } | |
| fun fibKotlinKoinFactory(n: Int): String { | |
| return when (n) { | |
| 1, 2 -> "factory { Fib$n() }" |
| open class Counter(context: Context) { | |
| open var count: Int = 0 | |
| open fun hit() = count++ | |
| } |
| package com.sloydev.macookbuk.infrastructure.extensions | |
| import android.arch.lifecycle.* | |
| fun <T, R> LiveData<T>.map(transformation: (T) -> R): LiveData<R> { | |
| return Transformations.map(this, transformation) | |
| } | |
| fun <A, B, C> LiveData<A>.zipWith(other: LiveData<B>, zipFunc: (A, B) -> C): LiveData<C> { | |
| return ZippedLiveData<A, B, C>(this, other, zipFunc) |