Skip to content

Instantly share code, notes, and snippets.

View Nek-12's full-sized avatar
💭
I may be slow to respond.

Nek.12 Nek-12

💭
I may be slow to respond.
View GitHub Profile
@Nek-12
Nek-12 / SKILL.md
Created June 24, 2026 17:26
kent.sh docs-writing skill
name docs-writing
description How to write public product documentation. Use when editing README.md, AGENTS.md, ./docs/ contents, any documentation website content, user guides and similar documentation pages.

Goal

Public docs should be stable, terse, standalone, and user-facing. Document the product as it is, not the story of how it got there.

Core rules

@Nek-12
Nek-12 / builder-clipboard-2296733280.png.base64
Last active May 28, 2026 13:46
deepteams/webp invalid ALPH chunk repro
iVBORw0KGgoAAAANSUhEUgAACuAAAAZgCAYAAACF4hOHAAAKoGlDQ1BJQ0MgUHJvZmlsZQAASImVlwdQk9kWx+/3pYeElhDphN6kCwSQEnrovdkISYBQQkgIKnZkcQVWFBERUARdFVGwAmJHFNui2MC6IIuIsi4WREXlfcAQ3H3z3pt3Zs7c3/xz7rnnnvnuzAkAZHm2UJgGywOQLsgShfm402Ni4+i4VwADlAAJWAA1NkcsZIaEBADEZta/28cHAJpc75pN5vr33/+rKXB5Yg4AUAjCCVwxJx3hE4gPc4SiLABQuxFdd2mWcJLbEaaKkAIR7pnkpGkenuSEKUaDqZiIMA+EqQDgSWy2KAkAEh3R6dmcJCQPyQ1hSwGXL0BYiLBLenoGF+EjCBshMYhGmszPSPghT9LfciZIc7LZSVKevsuU4T35YmEae/n/2Y7/belpkpkzDBEnJYt8wybPQ3r2R2qGv5QFCUHBM8znTtc0yckS38gZ5og94mZYnBbOmmEu29NfmictKGCGE/ne0hh+Fitihnlir/AZFmWESc9NFHkwZ5gtmq1Bkhop1ZN5LGn+nOSI6BnO5kcFSWtLDfefjfGQ6iJJmPQuPIGP++y53tI+pIt/uDufJd2blRzhK+0De7Z+noA5m1McI62Ny/P0mo2JlMYLs9ylZwnTQqTxvDQfqS7ODpfuzUI+ztm9IdIeprD9QmYYBAJrwACRWbxlWZPFe2QIl4v4SclZdCbywnh0loBjPpdubWltB8Dke53+HN73TL1DiIaf1VYhfXYYRODyrBYxBkBzEwC00VlNbycAssh3dVrMkYiyp7Wpt4QBRCAHqEAFaAJdYATMkMrsgBNwA17ADwSDCBALFgMOSAbpQASWgpVgHcgHhWAz2AYqQDXYAw6Aw+AYaAZnwEVwBdwAt8F98Bj0ggHwGoyAj2AcgiAcRIYokAqkBelDppA1xIBcIC8oAAqDYqF4KAkSQBJoJbQeKoRKoAqoBqqDjkKnoIvQNagLegj1QUPQ
@Nek-12
Nek-12 / LineChart.kt
Created June 23, 2025 07:33
Line chart animation in compose
val state = remember(line.points, animate) {
MutableTransitionState(if (animate) 0f else 1f).also { it.targetState = 1f }
}
val transition = rememberTransition(state, label = "transition")
val heightFraction by transition.animateFloat(
label = "height",
transitionSpec = {
tween(
@Nek-12
Nek-12 / RingtonePicker.android.kt
Created May 24, 2025 10:38
Android Ringtone picker contract with edge cases
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.media.RingtoneManager
import android.net.Uri
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContract
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
@Nek-12
Nek-12 / AppleCredentialLauncher.native.kt
Last active June 9, 2025 22:54
How to implement Apple Sign in in Kotlin Multiplatform
package pro.respawn.app.feature.account.thirdparty
import androidx.compose.runtime.Composable
import co.touchlab.kermit.Logger
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.cstr
import kotlinx.cinterop.memScoped
import kotlinx.cinterop.reinterpret
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.suspendCancellableCoroutine
@Nek-12
Nek-12 / DestinationScope.kt
Last active March 29, 2024 14:45
Koin <> Decompose Generic Component with injection
// warning - the descendants must be retained across config changes
@Stable
interface DestinationScope : KoinScopeComponent {
val coroutineScope: CoroutineScope
override fun equals(other: Any?): Boolean
override fun hashCode(): Int
}
val LocalDestinationScope = staticCompositionLocalOf<DestinationScope> {
@Nek-12
Nek-12 / DynamicBottomSheetScaffold.kt
Last active March 20, 2024 20:34
Dynamic non-modal bottom sheet for Compose that fixes existing issues with material3 implementation
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.windowInsetsPadding
@Nek-12
Nek-12 / StackNavigator.kt
Last active March 12, 2024 16:20
Decompose - Global navigation events with channel
internal class StackComponent(context: ComponentContext): Component {
private val results = Channel<NavResult<*>>(Channel.CONFLATED)
inline fun <reified R> sendResult(result: R) {
val config = stack.active.configuration
// or popWhile - bring desired page to the front
navigation.pop {
results.trySend(NavResult(config, result))
@Nek-12
Nek-12 / buld.gradle.kts
Created August 11, 2021 17:03
How to get your release application id as a buildConfig field
android {
defaultConfig {
applicationId = "com.nek.example" //be sure to follow the same order as here, or the id will be "null"
buildConfigField("String", "APPLICATION_ID_DEFAULT", "\"${android.defaultConfig.applicationId}\"")
//...
}
}
buildTypes {