Skip to content

Instantly share code, notes, and snippets.

View twyatt's full-sized avatar

Travis Wyatt twyatt

View GitHub Profile
@twyatt
twyatt / ChannelSendExceptions.kt
Created April 15, 2021 08:11
Exceptions thrown when sending to closed/cancelled Channel
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.coroutineScope
suspend fun main() = coroutineScope<Unit> {
val receive = Channel<Int>()
receive.cancel() // ReceiveChannel
// java.util.concurrent.CancellationException: RendezvousChannel was cancelled
runCatching { receive.send(1) }.onFailure { println(it) }
val send = Channel<Int>()
@twyatt
twyatt / Package.swift
Last active August 3, 2023 16:55
Datadog 1.22.0 xcodebuild failure
// swift-tools-version:5.8
import PackageDescription
let package = Package(
name: "MyPackage",
platforms: [
.iOS(.v11)
],
products: [
@twyatt
twyatt / settings.gradle.kts
Created July 6, 2024 06:11
Include sibling projects as composite builds via `local.properties`
// Configure sibling composite projects (`../<project>`) by adding `composite.<project>=true` to `local.properties`.
java.util.Properties()
.apply {
rootProject.projectDir
.resolve("local.properties")
.normalize()
.takeIf(File::exists)
?.let { java.io.FileInputStream(it) }
?.use(::load)
}