Skip to content

Instantly share code, notes, and snippets.

@elroid
elroid / CrashlyticsTree.kt
Created May 18, 2018 07:49
Crashlytics debug tree for Timber
import android.util.Log
import com.crashlytics.android.Crashlytics
import timber.log.Timber
import java.util.*
class CrashlyticsTree(val logLevel: Int) : Timber.Tree() {
override fun isLoggable(tag: String?, priority: Int): Boolean {
return priority >= logLevel
}
@elroid
elroid / BranchNetworkClient.java
Last active July 24, 2023 08:53
BranchRemoteInterface using OkHttp3
import org.json.JSONObject;
import java.io.IOException;
import io.branch.referral.network.BranchRemoteInterface;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
@elroid
elroid / CommitParser.kt
Last active July 10, 2023 09:44
A Kotlin script for generating release notes. Put directives in your commit messages, starting the line with specific flags (like #feature or @Fixes) and a human-readable description. Call the script as part of your build process, which gets the tags from git and prints a text file of release notes for your app distribution system.
package buildscript
import java.io.BufferedWriter
import java.io.File
import java.io.IOException
import java.util.concurrent.TimeUnit
const val DEBUG = false
val PREFIXES = listOf("#", "%", "@")