View custom-git-describe.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static String buildDescribeString(String tag, int commitsCount, /* org.ajoberstar.grgit.Commit */ headCommit) { | |
return "$tag-$commitsCount-g${headCommit.id.substring(0, 7)}" | |
} | |
String unreleasedDescribe() { | |
def headCommit = grgit.head() | |
def commitsCount = grgit.log().size() | |
return buildDescribeString("unreleased", commitsCount, headCommit) | |
} |
View Log.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Log.swift | |
* Copyright (c) 2020 Daniel San <daniel.samrocha@gmail.com> | |
* Created by Daniel San on 17/01/2020. | |
*/ | |
import Foundation | |
struct Log { |
View fix-wm-class-on-linux.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Update WM_CLASS | |
fault_tolerance=0 | |
beta_timeout=50 | |
while true; do | |
wids=$(timeout 2 xdotool search --sync --onlyvisible --class "jetbrains-studio") | |
if [ -z "$wids" ] ; then | |
if [ $fault_tolerance -eq 0 ]; then | |
fault_tolerance=1 |
View load-env-files.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task loadEnv(dependsOn: ":app:build") { | |
file(rootProject.projectDir).listFiles({ | |
it.isFile() && it.name.endsWith(".env") | |
} as FileFilter).each { file -> | |
file.withInputStream { inputStream -> | |
def properties = new Properties() | |
properties.load(inputStream) | |
properties.stringPropertyNames().forEach { name -> | |
ext.setProperty(name, properties.getProperty(name)) | |
} |
View apk-better-name.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.jayway.com/2015/03/13/producing-better-named-android-apks-with-gradle/ | |
// https://stackoverflow.com/questions/44239235/android-gradle-3-0-0-alpha2-plugin-cannot-set-the-value-of-read-only-property | |
android.applicationVariants.all { variant -> | |
def appName | |
// Check if an applicationName property is supplied; if not use the name of the parent project. | |
if (project.hasProperty("applicationName")) { | |
appName = applicationName | |
} else { | |
appName = parent.name | |
} |
View apk-better-name.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.jayway.com/2015/03/13/producing-better-named-android-apks-with-gradle/ | |
android.applicationVariants.all { variant -> | |
def appName | |
// Check if an applicationName property is supplied; if not use the name of the parent project. | |
if (project.hasProperty("applicationName")) { | |
appName = applicationName | |
} else { | |
appName = parent.name | |
} |