Prints something like this:
In 2018 you made 2488 commits in 134 projects.
The average length of a commit message was 62 characters.
Commits per weekday
Monday 334 ******************************************
| #!/usr/bin/env bash | |
| # I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
| # well, so I wrote my own script to do the simple job of converting package names. | |
| # | |
| # You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
| # | |
| # It'll run faster on a clean build because then there are fewer files to scan over. | |
| # | |
| # Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
| import android.graphics.Canvas; | |
| import android.graphics.Paint; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.text.style.ReplacementSpan; | |
| public class CircleTextSpan extends ReplacementSpan { | |
| private final int backgroundColor; | |
| private final int textColor; |
| /* | |
| * Copyright (C) 2016 Jesse Wilson | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| if (hasProperty("publishFlavors") && hasProperty("publishTypes")) { | |
| afterEvaluate { | |
| publishFlavors.splitEachLine(",") { | |
| it.each { flavor -> | |
| publishTypes.splitEachLine(",") { | |
| it.each { type -> | |
| publish.dependsOn "publish${type.capitalize()}${flavor.capitalize()}Release" | |
| } | |
| } | |
| } |
| # sudo su and run the following | |
| sudo aptitude update | |
| # install all dependencies | |
| sudo aptitude -y install \ | |
| python-pip \ | |
| python2.7-dev \ | |
| libssl-dev \ | |
| libcurl4-openssl-dev \ |
| import org.junit.rules.TestRule; | |
| import org.junit.runner.Description; | |
| import org.junit.runners.model.Statement; | |
| /** Got flaky tests? Shampoo them away. */ | |
| public final class ShampooRule implements TestRule { | |
| private final int iterations; | |
| public ShampooRule(int iterations) { | |
| if (iterations < 1) throw new IllegalArgumentException("iterations < 1: " + iterations); |
| import android.util.Log; | |
| import com.squareup.leakcanary.AnalysisResult; | |
| import com.squareup.leakcanary.DisplayLeakService; | |
| import com.squareup.leakcanary.HeapDump; | |
| import retrofit.RestAdapter; | |
| import retrofit.RetrofitError; | |
| import retrofit.http.Multipart; | |
| import retrofit.http.POST; | |
| import retrofit.http.Part; | |
| import retrofit.mime.TypedFile; |
| import android.content.Context; | |
| import android.os.Debug; | |
| import java.io.File; | |
| public class OomExceptionHandler implements Thread.UncaughtExceptionHandler { | |
| private static final String FILENAME = "out-of-memory.hprof"; | |
| public static void install(Context context) { | |
| Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler(); |
| def installAll = tasks.create('installAll') | |
| installAll.description = 'Install all applications.' | |
| android.applicationVariants.all { variant -> | |
| installAll.dependsOn(variant.install) | |
| // Ensure we end up in the same group as the other install tasks. | |
| installAll.group = variant.install.group | |
| } |