Skip to content

Instantly share code, notes, and snippets.

View r4zzz4k's full-sized avatar

Andrew Mikhaylov r4zzz4k

View GitHub Profile
@r4zzz4k
r4zzz4k / TransformerMapCatch.java
Created September 11, 2015 08:19
Different RxJava utilities
package com.ebooks.ebookreader.utils.rx;
import rx.Observable;
public class TransformerMapCatch<T, R> implements Observable.Transformer<T, R> {
private FuncThrowable1<? super T, ? extends R> mFunc;
public TransformerMapCatch(FuncThrowable1<? super T, ? extends R> func) {
mFunc = func;
}
@r4zzz4k
r4zzz4k / AndroidManifest.xml
Last active August 13, 2016 12:28
Utility that automatically generates intent-filter to process files by extensions
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" ...>
<application ...>
<activity ...>
<!--suppress AndroidElementNotAllowed -->
<intent-filter-ext exts="mp3,ogg" max-nesting="16" tools:ignore="MissingPrefix"/>
</activity>
</application>
</manifest>
@r4zzz4k
r4zzz4k / keybase.md
Last active August 13, 2016 12:27
keybase.md

Keybase proof

I hereby claim:

  • I am r4zzz4k on github.
  • I am r4zzz4k (https://keybase.io/r4zzz4k) on keybase.
  • I have a public key ASBXQoBXPu7xoTDvWD4KG7p27DFyrfU8QJ0178YSyvOuswo

To claim this, I am signing this object:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDb7KHWgjUbN09fHxOSse6V0LYXHD4z7bT5QLQ8quoXsrm1hbS2A35tKFJRPbVBLvZHnqZXLrIx6a16m098I8OzGBiveVDorscTojCoAtAVeUTlaS1AI7vUJuMq/zpQAeVYTd/iS8mW8jAelUOCXXczEkxBCLtA8/qReVN6Vn+T3cQi8loaipJVOSPejneoxHGIByTMOu6/y8nhYTO2eaxY4Yi7vtLwJKeHuA5ABnUGAHrhE6gJDu4XXa8QtIdEYbFKSa7tAANCeWopAJXGhwrubEEXAckMxOAZCvUkf1rwKVaQEpW7R3iqIcKwa6epxkbIqN4BFyZiT1rV4mZb0n0XMncpPZx4NP/W+7mVOQd85IvFHIGi39+F4UrUZw60LkDIychn++G19dKoHxnvM0JAjTkzxWLLguMTynL63hznOPBccF1GfuhxkbL0z5WeBLeGpT+cMxuYVEHByP/SAFTly1xfr0lYWANxiNcJeJiWbzOHekvthd4leIMOUBsKsXi9nUns45Xwv+hfu8hX+RMNRxPnMu3UYyFW1pZOW1VTSJuz6AqZQQTE9zcjT6ilYrsri0PPey1cJG9qEDROdTlL4eg+aEo48wBuUkm0Xpp6KkOF2VSbaMf8Xz/1dilt8VeBQwnGVUtPPawR4ep92dH/paahY7U1xG2ckTB+nKqbuw== a.mihailov@mobidev.biz
@r4zzz4k
r4zzz4k / 00. gen.sh
Last active September 13, 2018 16:02
cinterop dependent libraries
#!/bin/sh
export PATH="$HOME/.konan/kotlin-native-linux-0.8.2/bin:$PATH"
echo "> gobj"
echo ">> cinterop"
[ -d gobj_interop-build ] || cinterop -def gobj.def -verbose true -o gobj_interop > ./gobj.log
echo ">> klib info"
klib info ./gobj_interop.klib > ./gobj.info
echo ">> klib contents"
@r4zzz4k
r4zzz4k / sample.kt
Created July 15, 2019 13:11
kotlinx.serlialization + Array<Any>
package sample
import kotlinx.serialization.*
import kotlinx.serialization.internal.StringDescriptor
import kotlinx.serialization.json.*
object ToStringSerializer: KSerializer<Any> {
override val descriptor: SerialDescriptor =
StringDescriptor.withName("toString")
@r4zzz4k
r4zzz4k / android.kt
Created October 15, 2019 18:23
inkremental/anvil DSL
package trikita.anvil.dsl
import android.view.*
import android.widget.LinearLayout
import trikita.anvil.Anvil
import trikita.anvil.attr
// weight constants
const val FILL = ViewGroup.LayoutParams.MATCH_PARENT
const val MATCH = ViewGroup.LayoutParams.MATCH_PARENT
@r4zzz4k
r4zzz4k / sdk15.json
Last active December 20, 2019 21:03
Inkremental metadata sample
{
"name": "Sdk",
"views": [
{
"name": "FragmentBreadCrumbs",
"plainType": {
"type": "class",
"canonicalName": "android.app.FragmentBreadCrumbs"
},
"attrs": [