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
/* | |
* Written by Thomás Horta, 2023-12-21. | |
*/ | |
import androidx.compose.foundation.ScrollState | |
import androidx.compose.foundation.horizontalScroll | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.verticalScroll | |
import androidx.compose.ui.Modifier |
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
open class ViewModelSlice { | |
protected lateinit var viewModelScope: CoroutineScope | |
private set | |
fun init(viewModel: ViewModel) { | |
viewModelScope = viewModel.viewModelScope | |
afterInit() | |
} | |
protected open fun afterInit() {} |
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 kotlinx.coroutines.CancellationException | |
import kotlinx.coroutines.TimeoutCancellationException | |
/** | |
* Very similar to [runCatching] but it's better suited for use inside suspend functions, as it | |
* properly propagates [CancellationException], which are required for correct structured | |
* concurrency in Coroutines. | |
* | |
* Calls the specified function [block] with `this` value as its receiver and returns its | |
* encapsulated result if invocation was successful, catching any [Throwable] exception that was |
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
# vars | |
projects_dir=$HOME/Projects | |
example_dir=$projects_dir/example | |
example_dir_android=$example_dir/example-android | |
# cd aliases | |
alias cd-proj='cd $projects_dir' | |
alias cd-ex='cd $example_dir' | |
alias cd-ex-android='cd $example_dir_android' |