Skip to content

Instantly share code, notes, and snippets.

View dalafiarisamuel's full-sized avatar
:electron:
Hey there 😊

Samuel Dalafiari dalafiarisamuel

:electron:
Hey there 😊
View GitHub Profile
package com.devtamuno.themoviedatabase.ui.components
import androidx.annotation.DrawableRes
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
@dalafiarisamuel
dalafiarisamuel / KtorTokenRefresh.md
Created August 17, 2026 18:19
KtorTokenRefresh

Ktor Token Refresh Interceptor (KMP)

This implementation provides a Ktor plugin for Kotlin Multiplatform that handles authorization headers and automatic token refresh upon receiving a 401 Unauthorized response.

Implementation

package networking

import io.ktor.client.HttpClient
@dalafiarisamuel
dalafiarisamuel / DynamicShortcut.kt
Created September 21, 2024 11:19
Add Ios Dynamic shorcuts to Kotlin Multiplatform App
import platform.UIKit.UIApplication
import platform.UIKit.UIApplicationShortcutIcon
import platform.UIKit.UIApplicationShortcutIconType
import platform.UIKit.UIApplicationShortcutItem
import platform.UIKit.shortcutItems
fun setDynamicAppShortcut() {
// Create an icon for the shortcut