This file contains hidden or 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
org.gradle.daemon = true | |
org.gradle.parallel = true | |
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8org.gradle.daemon = true |
This file contains hidden or 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
if [ ! -z "${IDE}" -a "${IDE}" == "AndroidStudio" ]; then | |
cd $OLDPWD; | |
fi |
This file contains hidden or 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
object TimeUtils { | |
fun millisToShortDHMS(duration: Long): String { | |
var res = "" // java.util.concurrent.TimeUnit; | |
val days = TimeUnit.MILLISECONDS.toDays(duration) | |
val hours = TimeUnit.MILLISECONDS.toHours(duration) - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration)) | |
val minutes = TimeUnit.MILLISECONDS.toMinutes(duration) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(duration)) | |
val seconds = TimeUnit.MILLISECONDS.toSeconds(duration) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)) | |
val millis = TimeUnit.MILLISECONDS.toMillis(duration) - TimeUnit.SECONDS.toMillis(TimeUnit.MILLISECONDS.toSeconds(duration)) |
This file contains hidden or 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
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
This file contains hidden or 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
inline fun <reified T : Any> zipLiveData(vararg liveItems: LiveData<*>): LiveData<List<T>> { | |
return MediatorLiveData<List<T>>().apply { | |
val zippedObjects = mutableListOf<T>() | |
liveItems.forEach { | |
addSource(it, { item -> | |
zippedObjects.add(item as T) | |
if (zippedObjects.size == liveItems.size) | |
value = zippedObjects | |
}) | |
} |
This file contains hidden or 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
apply plugin: 'jacoco' | |
jacoco { | |
toolVersion = '0.8.2' | |
} | |
tasks.withType(Test) { | |
jacoco.includeNoLocationClasses = true | |
} |
This file contains hidden or 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
apply plugin: 'org.sonarqube' | |
afterEvaluate { | |
def flavor = "DEV" | |
def variant = "devDebug" | |
def testTaskName = "test${variant.capitalize()}UnitTest" | |
def junitReportsPath = "build/outputs/androidTest-results/connected/flavors/$flavor/" | |
def ecFileName = "" | |
project.tasks[testTaskName].reports.junitXml.destination = junitReportsPath |
This file contains hidden or 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
void main() { | |
Carro c1 = Carro("Fusca"); | |
c1.acelerar(50); | |
c1.abastecer(50); | |
} | |
class Carro extends Automovel with Combustivel { | |
String nome; | |
Carro(this.nome); |
This file contains hidden or 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
void main() { | |
Carro c1 = Carro("Fusca"); | |
Carro c2 = Carro("Brasilia"); | |
Carro c3 = Carro("Chevete"); | |
final carros = {1:c1 ,2: c2}; | |
carros[3] = c3; | |
print ("Lista $carros"); |
This file contains hidden or 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
void main() { | |
Carro c1 = Carro("Fusca"); | |
Carro c2 = Carro("Brasilia"); | |
Carro c3 = Carro("Chevete"); | |
//List<Carro> carros = List<Carro>(); | |
//carros.add(c1); | |
//carros.add(c2); | |
//carros.add(c3); | |
var carros = [c1, c2, c3]; |
OlderNewer