Skip to content

Instantly share code, notes, and snippets.


Oleksii Malovanyi almozavr

  • Lviv, UA
View GitHub Profile
almozavr / DelegatingPagingSource.Kt
Created Oct 8, 2021
Link ContainerHost intent capabilities with the Paging library
View DelegatingPagingSource.Kt
package com.example.paging
import androidx.paging.PagingSource
import androidx.paging.PagingState
import org.orbitmvi.orbit.ContainerHost
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
import org.orbitmvi.orbit.syntax.simple.intent
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
almozavr / jacoco.gradle
Last active Jan 5, 2021
Gradle Jacoco config for Android (3.x plugin) with kotlin and custom excludes support
View jacoco.gradle
apply plugin: "jacoco"
jacoco {
toolVersion = deps.test.jacocoVersion
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
almozavr /
Last active Sep 30, 2020
Parcelable helper to wrap object convertable with gson
public class ObjectGsonParceler {
private final Gson gson;
public ObjectGsonParceler(Gson gson) {
this.gson = gson;
public Parcelable wrap(Object instance) {
try {
String json = encode(instance);
almozavr / app_build.gradle
Created Jun 26, 2014
Workaround to bypass library's BuildConfig.DEBUG (always true, always release build type) via custom variable
View app_build.gradle
// Application
apply plugin: 'android'
repositories {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
almozavr / UnsafeCast.kt
Created Feb 5, 2018
Custom UnsafeCast rule for detekt
View UnsafeCast.kt
package io.techery.detekt.extensions.rules
import io.gitlab.arturbosch.detekt.api.*
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.*
* Whitelist-able unsafe cast check. E.g.
* UnsafeCast:
View jenkins-android-pipeline-utils.groovy
#!/usr/bin/env groovy
def runBuild(String nodeName = null, notifyGithub = true, Closure<Void> job) {
if (nodeName) node(nodeName) { runBuildInternally(job, notifyGithub) }
else runBuildInternally(job, notifyGithub)
private def runBuildInternally(Closure<Void> job, boolean notifyGithub) {
withGithubNotifier(notifyGithub) {
decorateBuild {
almozavr /
Last active May 17, 2016
Timber logger service wrapper for Janet ActionService
public class TimberServiceWrapper extends ActionServiceWrapper {
private final String serviceTag;
public TimberServiceWrapper(ActionService actionService) {
this(actionService, null);
public TimberServiceWrapper(ActionService actionService, String tag) {
almozavr / build.gradle
Created May 5, 2016
AndroidTDDBootStrap app Flavor Dimensions test
View build.gradle
* The MIT License (MIT)
* Copyright (c) 2016 Piasy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
almozavr / gist:7692154
Created Nov 28, 2013
Launchrock mail with bad encoding for cyrillic texts
View gist:7692154
Received: by with SMTP id y13csp11267icl;
Thu, 28 Nov 2013 05:45:34 -0800 (PST)
X-Received: by with SMTP id fa9mr36830100wjc.29.1385646333791;
Thu, 28 Nov 2013 05:45:33 -0800 (PST)
Return-Path: <>
Received: from ( [])
by with ESMTP id pr7si23213775wjc.164.2013.
for <>;
Thu, 28 Nov 2013 05:45:33 -0800 (PST)
View activity_login
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android=""