Skip to content

Instantly share code, notes, and snippets.

View nethergrim's full-sized avatar
🦖

Andrii Drobiazko nethergrim

🦖
View GitHub Profile
@nethergrim
nethergrim / nvmlink
Last active November 30, 2023 11:40 — forked from MeLlamoPablo/nvmlink
Creates a symlink to /usr/bin/node after using nvm
@nethergrim
nethergrim / build.gradle
Created June 29, 2021 15:55
Generate versionCode for Android using current time, incremented each minute.
/**
* Constructs a version code as: {(now).minutes - (1 Jan 2021).minutes}* Which means that version code will be incremented each minute.
* The greatest value Google Play allows for versionCode is 2100000000.
* There are ~525600 minutes in a year, so greatest value will be reached after 3995 years.
* */
static def versionCodeDate() {
def millisInMinute = 60 * 1000
def startDate = new GregorianCalendar(2021, Calendar.JUNE, 1)
def startDateMinutePrecision = startDate.getTimeInMillis() / millisInMinute
def now = new GregorianCalendar()
-Xms512m
-Xmx2g
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
@nethergrim
nethergrim / CrashlyticsTree.java
Last active October 23, 2022 01:41
Android advanced logging to Crashlytics with Timber
import com.crashlytics.android.Crashlytics;
import timber.log.Timber;
public class CrashlyticsTree extends Timber.DebugTree {
@Override
protected void log(int priority, String tag, String message, Throwable t) {
Crashlytics.log(message);
@nethergrim
nethergrim / build.gradle
Last active March 3, 2021 13:50
🚀 build.gradle which forces all subprojects to use a single version of support library
ext {
supportlib_version = '28.0.0'
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex')) {
@nethergrim
nethergrim / MapPrinter.java
Created March 16, 2017 09:33
Utility class to print Java Map content to console.
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class MapPrinter {
private static final String INDENT_FOUR_SPACES = " ";