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 androidx.compose.foundation.ScrollState | |
import androidx.compose.foundation.VerticalScrollbar | |
import androidx.compose.foundation.gestures.FlingBehavior | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.ColumnScope | |
import androidx.compose.foundation.layout.PaddingValues | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.foundation.lazy.LazyColumn | |
import androidx.compose.foundation.lazy.LazyListScope |
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
FAILURE: Build failed with an exception. | |
* What went wrong: | |
A problem occurred configuring root project 'ComposeBug'. | |
> Failed to notify project evaluation listener. | |
> Cannot change attributes of dependency configuration ':generatedByKspKotlinJsApiDependenciesMetadata' after it has been resolved | |
> Cannot change attributes of dependency configuration ':generatedByKspKotlinJsImplementationDependenciesMetadata' after it has been resolved | |
> Cannot change attributes of dependency configuration ':generatedByKspKotlinJsCompileOnlyDependenciesMetadata' after it has been resolved | |
> Cannot change attributes of dependency configuration ':generatedByKspKotlinJsRuntimeOnlyDependenciesMetadata' after it has been resolved | |
> Cannot change attributes of dependency configuration ':generatedByKspKotlinJsIntransitiveDependenciesMetadata' after it has been resolved |
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
e: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering | |
File being compiled: /home/sproctor/Code/ScrapReceipts/ReceiptsApp/common/data/src/commonMain/kotlin/com/scraptickets/data/iscrapapp/IscrapDataSourceImpl.kt | |
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:50) | |
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:239) | |
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:235) | |
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invokeSequential(performByIrFile.kt:68) | |
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:55) | |
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:41) | |
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96) | |
at org.jetbrai |
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 io.ktor.application.* | |
import io.ktor.auth.* | |
import io.ktor.request.* | |
class SecretAuthenticationProvider internal constructor(config: Configuration) : AuthenticationProvider(config) { | |
internal val key: (ApplicationCall) -> String? = config.key | |
internal val expectedKey: String? = config.expectedKey | |
class Configuration internal constructor(name: String?) : AuthenticationProvider.Configuration(name) { |
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 io.ktor.serialization.* | |
import io.ktor.server.application.* | |
import io.ktor.server.auth.* | |
import io.ktor.server.request.* | |
class SecretAuthenticationProvider internal constructor(config: Config) : AuthenticationProvider(config) { | |
internal val key: (ApplicationCall) -> String? = { call -> call.request.header("secret") } | |
private val expectedKey: String = config.expectedKey ?: throw Exception("No key provided") |
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
val client = HttpClient() | |
val response = client.post<HttpResponse> { | |
url("https://$domain/oauth/token") | |
header("content-type", "application/x-www-form-urlencoded") | |
body = "grant_type=authorization_code&client_id=$clientId&code_verifier=$verifier" + | |
"&code=$code&redirect_uri=$encodedRedirectUri" | |
} | |
println("response: ${response.readText()}") |
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
val code = suspendCancellableCoroutine { continuation -> | |
val server = HttpServer.create(InetSocketAddress(5789), 0) | |
server.createContext("/callback") { http -> | |
val parameters = http.requestURI.query?.let { decodeQueryString(it) } | |
val code = parameters?.get("code") ?: throw RuntimeException("Received a response with no code") | |
sendResponse(http) | |
continuation.resume(code) |
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
class AuthenticationManager { | |
fun authenticateUser( | |
domain: String, | |
clientId: String, | |
redirectUri: String, | |
scope: String, | |
audience: String, | |
) { | |
val verifier = createVerifier() |
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
@file:JsModule("use-error-boundary") | |
@file:JsNonModule | |
package externals | |
import react.* | |
external interface ErrorState { | |
var didCatch: Boolean? | |
var error: Any? |
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 TimeDisplay(viewModel: TimeDisplayViewModel) { | |
val properties: Map<String, Long> by viewModel.properties.collectAsState() | |
var timeRemaining by rememeber { mutableStateOf(0) } | |
Text(timeRemaining.toString) | |
val timeProperty = properties["time"] | |
LaunchedEffect(timeProperty) { | |
val currentTime = System.currentTimeMillis() |
NewerOlder