Skip to content

Instantly share code, notes, and snippets.

View dsvoronin's full-sized avatar

Dmitriy Voronin dsvoronin

  • 05:05 (UTC +01:00)
View GitHub Profile
@dsvoronin
dsvoronin / clear_stale_branches.sh
Created November 9, 2022 22:03
Clear stale branches script
#!/usr/bin/env bash
set -e
SYNC_BRANCH="master"
CURRENT_BRANCH=$(git branch --show-current)
if [ "$SYNC_BRANCH" != "$CURRENT_BRANCH" ]; then
echo "ERROR: You should be on '$SYNC_BRANCH' branch to continue"
exit 1
fi
@dsvoronin
dsvoronin / locking.md
Last active September 27, 2021 10:28
Gradle dependency locking in multimodule project

Faced a problem with dependency locking mechanism:

Project is a multimodule android app where only app module is locked.

I expected that build will fail on simple, manual update of a regular(non dynamic) version until i rewrite locks. But it didn't.

For example i upgraded some version of my 3rd party dependency, let's call it com.dep:dep: from 1.0 to 1.2 and build finished correctly even with this particular dependency locked on 1.0 in app's gradle.lockfile

@dsvoronin
dsvoronin / build.gradle.kts
Created June 18, 2020 18:47
build.gradle.kts
subprojects {
apply(from = "${rootDir}/dependencies.gradle")
plugins.matching { it is AppPlugin || it is LibraryPlugin }.whenPluginAdded {
configure<BaseExtension> {
setCompileSdkVersion(30)
buildToolsVersion = "30.0.0"
@dsvoronin
dsvoronin / AvitoSdkProvider.kt
Last active June 18, 2020 21:29
Robolectric offline
package com.avito.android.util
import org.robolectric.pluginapi.Sdk
import org.robolectric.pluginapi.SdkProvider
import javax.annotation.Priority
@Priority(Integer.MAX_VALUE)
class AvitoSdkProvider : SdkProvider {
private val availableSdks = setOf(
package com.avito.android.rule
import android.app.Activity
import android.app.Application
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import androidx.test.platform.app.InstrumentationRegistry
import android.view.View
import android.view.ViewGroup
#!/usr/bin/env python3
import argparse
import json
import slackweb
import pandas
def process_outdated_dependencies(source_json):
@dsvoronin
dsvoronin / StarsView.kt
Last active September 2, 2020 10:53
Protools
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
class StarsView(context: Context, attrs: AttributeSet) : TickView(context, attrs) {
data class Star(val x: Float,
val y: Float,
import android.content.res.AssetManager;
import com.google.gson.Gson;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import rx.Observable;
public class AssetsReader {
private final Gson gson;
private final AssetManager assetManager;
@dsvoronin
dsvoronin / RxSimpleNoSQL.java
Last active August 29, 2015 14:06
RxSimpleNoSQL.java
import com.colintmiller.simplenosql.NoSQL;
import com.colintmiller.simplenosql.NoSQLEntity;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
import timber.log.Timber;
@dsvoronin
dsvoronin / Android Boxes
Last active August 29, 2015 14:06
boxes for android
~