I hereby claim:
- I am mreichelt on github.
- I am mreichelt (https://keybase.io/mreichelt) on keybase.
- I have a public key ASDe0J_nGJJs5XI-gKOUObaNPS447BwR4QI0z4KYmaxZ9go
To claim this, I am signing this object:
| fun TestCoroutineScope.runBlockingTest( | |
| testBody: suspend TestCoroutineScope.() -> Unit, | |
| ) { | |
| val regularEndOfTest = CancellationException() | |
| try { | |
| this.runBlockingTestKotlin { // import kotlinx.coroutines.test.runBlockingTest as runBlockingTestKotlin | |
| testBody() | |
| cancel(regularEndOfTest) | |
| } | |
| } catch (e: CancellationException) { |
| /** | |
| * Intersect two maps with same keys, but different data types. Preserves the order of the first map. | |
| * Returns a list of the combined type provided by the transformation. | |
| */ | |
| inline fun <Key, Value1, Value2, T> Map<Key, Value1>.intersectWith( | |
| other: Map<Key, Value2>, | |
| transformationFunction: (Value1, Value2) -> T): List<T> { | |
| return flatMap { oldEntry -> | |
| other.filterKeys { it == oldEntry.key } | |
| .map { transformationFunction(oldEntry.value, it.value) } |
| android { | |
| signingConfigs { | |
| release { | |
| // export these as environment variables like ORG_GRADLE_PROJECT_MYAPP_RELEASE_STORE_FILE | |
| // (prefix 'ORG_GRADLE_PROJECT_' is needed for Gradle project properties) | |
| storeFile rootProject.file('app/' + project.findProperty('MYAPP_RELEASE_STORE_FILE')) | |
| storePassword project.findProperty('MYAPP_RELEASE_STORE_PASSWORD') | |
| keyAlias project.findProperty('MYAPP_RELEASE_KEY_ALIAS') | |
| keyPassword project.findProperty('MYAPP_RELEASE_KEY_PASSWORD') | |
| } |
| #!/bin/bash | |
| # allow access from localhost | |
| xhost + 127.0.0.1 | |
| # run firefox with X11 forwarding and keep running until it quits | |
| docker run -e DISPLAY=host.docker.internal:0 jess/firefox |
| <?xml version="1.0" encoding="utf-8"?> | |
| <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent"> | |
| <android.support.constraint.Guideline | |
| android:id="@+id/guideline" | |
| android:layout_width="wrap_content" |
I hereby claim:
To claim this, I am signing this object:
| public class TestApp extends OurApp { | |
| @Override | |
| protected void createComponents() { | |
| OurTestComponent component = mock(OurTestComponent.class); | |
| // fixed the memory leak by using a plain stub (without invocation tracking) | |
| OurActivityLifecycleCallbacks callbacks = | |
| mock(OurActivityLifecycleCallbacks.class, withSettings().stubOnly()); | |
| when(component.activityLifecycleCallbacks()).thenReturn(mock(callbacks)); | |
| OurApp.setComponent(component); |
| public class TestApp extends OurApp { | |
| /** overrides method in OurApp that initializes our actual Dagger2 component */ | |
| @Override | |
| protected void createComponents() { | |
| OurTestComponent component = mock(OurTestComponent.class); | |
| // required so our App init call works properly, which registers these callbacks | |
| // WOAH, this is responsible for the memory leak!! But why? | |
| when(component.activityLifecycleCallbacks()) | |
| .thenReturn(mock(activityLifecycleCallbacks)); |
| OUTFILE=flinc/app/build/outputs/apksize.csv | |
| echo filesize > $OUTFILE | |
| # yep, that's for Mac. Use "stat -c %s" instead on Linux | |
| stat -f%z flinc/app/build/outputs/apk/app-release.apk >> $OUTFILE |
| android { | |
| // your android block goes here | |
| } | |
| apply plugin: 'com.getkeepsafe.dexcount' |