Skip to content

Instantly share code, notes, and snippets.

@SubSide
SubSide / LocalNavController.kt
Created January 16, 2023 14:29
Example for providing a CompositionLocal for the NavController so you don't need to pass it around
import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.navigation.NavController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
@dovahkiin98
dovahkiin98 / FadingEdge.kt
Last active April 29, 2024 14:57
A Jetpack Compose implementation of the `fadingEdge` effect.
import androidx.compose.foundation.ScrollState
import androidx.compose.material.MaterialTheme
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.debugInspectorInfo
final class PublicKeyPinner {
/// Stored public key hashes
private let hashes: [String]
public init(hashes: [String]) {
self.hashes = hashes
}
/// ASN1 header for our public key to re-create the subject public key info
private let rsa2048Asn1Header: [UInt8] = [
@f3401pal
f3401pal / app\build.gradle.kts
Last active January 5, 2024 13:53
Multi-module Android project with Kotlin DSL for Gradle
plugins {
`android-base-app`
`android-base`
id("io.fabric")
}
android {
defaultConfig {
versionCode = 20
versionName = "1.6.3"
@codediodeio
codediodeio / database.rules.json
Last active January 28, 2024 19:07
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}