Skip to content

Instantly share code, notes, and snippets.

View Narayan-Dhingra's full-sized avatar
🧑‍🚀
Hustling

Narayan Dhingra Narayan-Dhingra

🧑‍🚀
Hustling
View GitHub Profile
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
{
"mcpServers": {
"maestro": {
"command": "npx",
"args": [
"-y",
"@sharpdeveye/maestro-workflow-mcp"
],
"env": {
"MAESTRO_DRIVER": "ios"
@Narayan-Dhingra
Narayan-Dhingra / github-gist-code.kt
Created July 30, 2026 14:37
iOS-like Predictive Back Animation in Kotlin Multiplatform (Compose)
import androidx.compose.animation.core.Animatable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import com.arkivanov.decompose.ExperimentalDecomposeApi
import com.arkivanov.decompose.extensions.compose.stack.animation.predictiveback.PredictiveBackAnimatable
@Narayan-Dhingra
Narayan-Dhingra / github-gist-code.kt
Created July 30, 2026 16:12
iOS Camera Bridge in Compose Multiplatform
package app.snookalook.mobile.bridges
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.addressOf
import kotlinx.cinterop.useContents
@Narayan-Dhingra
Narayan-Dhingra / github-gist-code.kt
Created July 30, 2026 16:14
iOS Mapbox WKWebView Bridge in Compose Multiplatform
package app.snookalook.mobile.bridges
import app.snookalook.mobile.util.ErrorReporter
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
@Narayan-Dhingra
Narayan-Dhingra / kmp-android-apple-signin.md
Created July 30, 2026 16:27
Apple Sign-In on Android with Kotlin Multiplatform

Mastering Apple Sign-In on Android in Kotlin Multiplatform: The Chrome Custom Tabs Approach

Building Snook-A-Look in Kotlin Multiplatform meant sharing as much UI and business logic as possible. But when it came to authentication, we hit a classic platform disparity: Apple Sign-In. On iOS, it's a breeze with native APIs. On Android, it's a completely different beast involving OAuth web flows.

We didn't want to pollute our shared Compose UI with platform-specific auth logic. We needed a clean expect/actual bridge that could seamlessly suspend a KMP coroutine, launch the web flow on Android, and resume the KMP coroutine with the auth payload.

Here is exactly how we engineered a resilient Apple Sign-In flow on Android using Chrome Custom Tabs and Kotlin Coroutines.

The Challenge: Coroutine Suspension Across Activities

@Narayan-Dhingra
Narayan-Dhingra / kmp-map-choreography.md
Created July 30, 2026 16:27
Unified Map Choreography Engine in Jetpack Compose

Architecting a Unified Map Choreography Engine in Jetpack Compose and Mapbox

When building Snook-A-Look, we wanted the app to open with a jaw-dropping map experience on Android. We didn't want the user to just open a static map—we wanted a dynamic, narrative-driven 120fps choreography that guides the user from the UAE overview, zooms into the Dubai club cluster, and finally lands on their exact location.

Because we needed seamless transitions regardless of GPS availability, permissions, or network speed, we built a Unified Map Choreography Engine using Jetpack Compose LaunchedEffect and the Mapbox SDK.

Here’s how we architected this complex state machine without a single stutter.

The Problem: Asynchronous GPS and UX Narrative

@Narayan-Dhingra
Narayan-Dhingra / scope-fence-skill.md
Created August 2, 2026 14:54
AI Scope Fence Skill - Prevent Agent Hallucinations and Scope Creep
name scope-fence-generator
description Analyzes casual human text input and converts it into a rigid, structured SCOPE-FENCE before any execution begins, preventing AI hallucination and wasted tokens.

Intent

When the user provides a casual request, do not immediately start executing tools or writing code. Instead, process the request to extract explicit boundaries and produce a SCOPE-FENCE.

Process

/*
* Copyright 2026 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software