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
// Api | |
interface CommandReceiver { | |
fun <R, T : Command<R>> processCommand(command: T) { | |
command.execute(this as R) | |
} | |
} | |
interface Command<R : CommandReceiver> { | |
fun execute(receiver: R) |
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 | |
function get_devices() { | |
all_devices=$(command adb devices) | |
# Drop the title | |
all_devices=${all_devices#"List of devices attached"} | |
# Drop any unauthorised devices (i.e. USB debugging disabled or authorisations revoked) | |
valid_devices=$(echo $all_devices | grep -v "([[:alnum:]-]+[[:space:]]+unauthorized$)" | grep -oE "([[:alnum:]-]+[[:space:]]+device$)") |
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
package ${PACKAGE_NAME}; | |
import javax.inject.Inject | |
internal class ${NAME}UseCase @Inject constructor( | |
) { | |
operator fun invoke() { | |
} |
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
@file:Suppress("NonAsciiCharacters") | |
package ${PACKAGE_NAME}; | |
import org.junit.Test | |
/** | |
* Tests for [${NAME}] | |
*/ | |
internal class ${NAME}Test { |
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
@Test | |
fun `$END$`() { | |
//given | |
// when | |
// then | |
} |
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
sudo reflector --verbose -l 5 -p https --sort rate --save /etc/pacman.d/mirrorlist && sudo pacman -Syyu |
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
@RunWith(JUnit4::class) | |
class $TestClassName$Test { | |
@get:Rule | |
val mockitoRule: MockitoRule = MockitoJUnit.rule() | |
@Before | |
fun setUp() { | |
} |
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
@Mock | |
private var $variable$: $variableType$ |
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
@Test | |
fun `$TestDescription$`() { | |
// ARRANGE | |
val sut: $TestModule$ = $TestModule$($Parameters$) | |
$END$ | |
// ACTION | |
// CHECK | |
} |
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.view.View | |
fun View.gone() = run { visibility = View.GONE } | |
fun View.visible() = run { visibility = View.VISIBLE } | |
fun View.invisible() = run { visibility = View.INVISIBLE } | |
infix fun View.visibleIf(condition: Boolean) = | |
run { visibility = if (condition) View.VISIBLE else View.GONE } |
NewerOlder