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 | |
# List connected devices (-l for long output) | |
adb devices | |
# Restart adbd listening on TCP on PORT | |
adb tcpip 5555 | |
# Get IP address (Wi-Fi) of connected device | |
adb shell ip addr show wlan0 |
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/zsh | |
# Buttery powered state | |
adb shell dumpsys battery | grep powered | |
# Unplug battery | |
adb shell dumpsys battery unplug | |
# Reset battery | |
adb shell dumpsys battery reset |
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
import android.arch.lifecycle.LiveData | |
import android.arch.lifecycle.MediatorLiveData | |
import android.arch.lifecycle.MutableLiveData | |
fun <X, Y> LiveData<X>.map(func: (X?) -> Y?): MutableLiveData<Y?> { | |
return MediatorLiveData<Y>().apply { | |
addSource(this@map) { x -> value = func(x) } | |
} | |
} |
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
/** | |
* Read property with {@code propertyName} from file with {@code fileName}. | |
* <p> | |
* Example of property file content:<br> | |
* api_key=5c7f743fe85eae73489af35c1a387a05 | |
* apiSecret=12345678910 | |
* | |
* @return Value of specified property. | |
* @throws GradleException if file not found or there is no specified property in a file. | |
*/ |