Skip to content

Instantly share code, notes, and snippets.

View danielgallegovico's full-sized avatar
🖖
Multiverse explorer

Daniel Gallego Vico danielgallegovico

🖖
Multiverse explorer
View GitHub Profile
@danielgallegovico
danielgallegovico / Triple.java
Last active June 16, 2016 11:01
Container to ease passing around a tuple of three objects.
/*
* Copyright (C) 2016 Daniel Gallego Vico.
*
* 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
@danielgallegovico
danielgallegovico / Quadruple.java
Created June 16, 2016 11:04
Container to ease passing around a tuple of four objects.
/*
* Copyright (C) 2016 Daniel Gallego Vico.
*
* 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
/*
* Copyright (C) 2017 Daniel Gallego Vico.
*
* 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
@danielgallegovico
danielgallegovico / build.gradle
Created November 7, 2017 13:36
Kotlin source folder support
android {
...
// Add Kotlin folders inside flavor/build type specific folders as source files
sourceSets.all {
java.srcDirs += "src/${name}/kotlin"
}
...
}
@danielgallegovico
danielgallegovico / RegexToFilterTagsInAndroidLogcat
Created May 31, 2018 11:50
Regex to filter tags in Android Logcat
^((?!tag1|tag2|tag3).)*$
@danielgallegovico
danielgallegovico / utils.gradle
Last active March 28, 2019 16:22
Utility methods for automated generation of versionName & versionCode in Android apps using semantic versioning tags
/**
* Get the version name from the latest Git tag.
* e.g. last tag v3.0.1 -> versionName 3.0.1
*/
def computeVersionName() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', "--git-dir=${rootProject.rootDir}/.git", "--work-tree=${rootProject.rootDir}", 'describe', '--abbrev=0', '--tags'
standardOutput = stdout
}