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
@Composable | |
fun PostFilterButton( | |
text: String, | |
selected: Boolean, | |
onClick: () -> Unit, | |
modifier: Modifier = Modifier | |
) { | |
Button( | |
onClick = onClick, | |
shape = RoundedCornerShape(50f), |
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
1. Download Git Bash (only if on Windows) | |
2. Go to your users folder and open the .ssh folder. Then open Git Bash / Terminal there and generate a key pair: | |
ssh-keygen -m PEM -t rsa | |
3. Copy the key to your server: | |
ssh-copy-id -i <keyname> <user>@<host> | |
5. Login to your Ubuntu server via SSH: | |
ssh -i <keyname> <user>@<host> |
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
1. Download Git Bash (only if on Windows) | |
2. Go to your users folder and open the .ssh folder. Then open Git Bash / Terminal there and generate a key pair: | |
ssh-keygen -m PEM -t rsa -b 2048 | |
3. Copy the key to your server: | |
ssh-copy-id -i <keyname> <user>@<host> | |
5. Login to your Ubuntu server via SSH: | |
ssh -i <keyname> <user>@<host> |
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
1. hiltvm (applicable in top-level) | |
@dagger.hilt.android.lifecycle.HiltViewModel | |
class $NAME$ @javax.inject.Inject constructor( | |
$PARAM$ | |
) : androidx.lifecycle.ViewModel() { | |
$END$ | |
} | |
2. vmstatefunc (applicable in class) | |
private val _$NAME$ = androidx.compose.runtime.mutableStateOf<$TYPE$>($INITIAL_VALUE$) |
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.content.Context | |
import android.net.ConnectivityManager | |
import android.net.NetworkCapabilities | |
import android.os.Build | |
fun hasInternetConnection(context: Context): Boolean { | |
val connectivityManager = | |
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
val activeNetwork = connectivityManager.activeNetwork ?: return false |