I hereby claim:
- I am mg6maciej on github.
- I am mg6maciej (https://keybase.io/mg6maciej) on keybase.
- I have a public key ASDxHRuoFjOpaQnCgcWQalTLR3ATQ5iBOEA0I3Ixkjudgwo
To claim this, I am signing this object:
pragma solidity ^0.4.23; | |
contract ComposableRegistry { | |
function ownerOf(address erc721, uint tokenId) public view returns (address); | |
function parent(address erc721, uint tokenId) public view returns (address, uint); | |
function transfer(address toErc721, uint toTokenId, address erc721, uint tokenId) public; | |
function transferToAddress(address to, address erc721, uint tokenId) public; | |
} |
I hereby claim:
To claim this, I am signing this object:
import android.content.Context | |
import android.content.pm.ProviderInfo | |
import android.support.v4.content.FileProvider | |
class FileProviderHack : FileProvider() { | |
override fun attachInfo(context: Context, info: ProviderInfo) { | |
try { | |
super.attachInfo(context, info) | |
} catch (ex: SecurityException) { |
import com.squareup.moshi.JsonAdapter | |
import com.squareup.moshi.Moshi | |
import com.squareup.moshi.Types | |
import java.lang.reflect.Type | |
// val adapter = moshi.listAdapter<MyModel>() | |
// val adapter = moshi.mapAdapter<String, List<MyModel>>(valueType = listType<MyModel>()) | |
inline fun <reified E> Moshi.listAdapter(elementType: Type = E::class.java): JsonAdapter<List<E>> { | |
return adapter(listType<E>(elementType)) |
Serious change (e.g. public function name) | |
tests in the same module | |
▇▇▇▇▇▇▇▇ 15% :compileKotlin (0:02.743) | |
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 66% :compileTestKotlin (0:11.629) | |
▇▇▇▇▇▇▇▇▇▇ 19% :junitPlatformTest (0:03.323) | |
tests in separate module | |
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 34% :compileKotlin (0:02.646) | |
▇▇▇▇▇▇▇▇▇▇▇▇ 21% :core-tests:compileTestKotlin (0:01.579) |
fun <T> stubbable(function: KCallable<T>) = object : ReadWriteProperty<Any?, T> { | |
override fun getValue(thisRef: Any?, property: KProperty<*>) = throw UnsupportedOperationException() | |
override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) { | |
val args = listOf(thisRef) + function.parameters.drop(1).map { anyList<Any>() } | |
whenever(function.call(*args.toTypedArray())).thenReturn(value) | |
} | |
} |
fun <T> List<T>.betterMinus(other: List<T>): List<T> { | |
return if (other.isEmpty()) { | |
this | |
} else { | |
(this - other.first()).betterMinus(other.subList(1, other.size)) | |
} | |
} |
import android.app.Activity | |
import android.app.Application | |
import android.os.Bundle | |
import io.reactivex.disposables.Disposable | |
import io.reactivex.functions.Consumer | |
fun Activity.disposeOnDestroy() = Consumer<Disposable> { disposable -> | |
application.registerActivityLifecycleCallbacks(object : Application.ActivityLifecycleCallbacks { | |
override fun onActivityDestroyed(activity: Activity) { |