Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am uzzu on github.
  • I am uzzu (https://keybase.io/uzzu) on keybase.
  • I have a public key ASCRvrRRul-5a-k-F9exubU5zdSaxKsQwhKq2X3VHV3y5Qo

To claim this, I am signing this object:

@uzzu
uzzu / TestScopeExtensions.kt
Last active July 13, 2022 03:50
kotlinx.coroutines.test 1.6.x + StateFlowの状態遷移を検証するためのヘルパー
package co.uzzu.coroutines.testing
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.test.TestScope
@uzzu
uzzu / MockitoSuspendableExtension.kt
Last active July 11, 2022 14:40
mockito-kotlin 4.x + kotlinx.coroutines 1.6.x で doReturnから始めたい + delayをサボりたい人向けのKotlin extensions
package co.uzzu.coroutines.testing.mockito
import kotlin.coroutines.Continuation
import kotlin.coroutines.intrinsics.startCoroutineUninterceptedOrReturn
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.test.TestScope
import org.mockito.Mockito
import org.mockito.internal.invocation.InterceptedInvocation
import org.mockito.invocation.InvocationOnMock
name: Sync maven central secrets
on:
workflow_dispatch:
inputs:
DRY_RUN:
description: 'Dry run'
required: true
default: false
jobs:
build:
initscript {
repositories {
maven(url ="https://plugins.gradle.org/m2/")
}
dependencies {
classpath("gradle.plugin.com.dorongold.plugins:task-tree:1.5")
}
}
rootProject {
@uzzu
uzzu / diagram.main.kts
Last active August 30, 2020 15:01
structurizr-ktx 0.0.3
@file:Repository("http://jcenter.bintray.com")
@file:DependsOn("com.structurizr:structurizr-core:1.5.0")
@file:DependsOn("com.structurizr:structurizr-plantuml:1.5.0")
@file:DependsOn("co.uzzu.structurizr.ktx:dsl:0.0.3")
import co.uzzu.structurizr.ktx.dsl.*
import co.uzzu.structurizr.ktx.dsl.model.*
import co.uzzu.structurizr.ktx.dsl.view.*
import com.structurizr.io.plantuml.StructurizrPlantUMLWriter
import com.structurizr.model.*
@uzzu
uzzu / diagram.main.kts
Created August 29, 2020 10:25
structurizr-ktx 0.0.2
@file:Repository("http://jcenter.bintray.com")
@file:DependsOn("com.structurizr:structurizr-core:1.5.0")
@file:DependsOn("com.structurizr:structurizr-plantuml:1.5.0")
@file:DependsOn("co.uzzu.structurizr.ktx:dsl:0.0.2")
import co.uzzu.structurizr.ktx.dsl.*
import co.uzzu.structurizr.ktx.dsl.model.*
import co.uzzu.structurizr.ktx.dsl.view.*
import com.structurizr.io.plantuml.StructurizrPlantUMLWriter
import com.structurizr.model.*
@uzzu
uzzu / diagram.main.kts
Last active August 29, 2020 10:24
structurizr-ktx 0.0.1
@file:Repository("https://dl.bintray.com/uzzu/maven")
@file:DependsOn("com.structurizr:structurizr-core:1.5.0")
@file:DependsOn("com.structurizr:structurizr-plantuml:1.5.0")
@file:DependsOn("co.uzzu.structurizr.ktx:dsl:0.0.1")
import co.uzzu.structurizr.ktx.dsl.*
import co.uzzu.structurizr.ktx.dsl.model.*
import co.uzzu.structurizr.ktx.dsl.view.*
import com.structurizr.Workspace
import com.structurizr.io.plantuml.StructurizrPlantUMLWriter
function javaenv() {
local err specified
if [[ -z `echo $1` ]]; then
echo $JAVA_HOME
return
fi
err=`/usr/libexec/java_home -v $1 2>&1 >/dev/null`
if [[ -n $err ]] then
echo $err
return
@uzzu
uzzu / whenObectAdded-stacktrace.txt
Created November 15, 2019 07:35
whenPluginAdded(whenObjectAdded)がどういうあれで呼ばれてんの
at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1$1.run(DefaultCollectionCallbackActionDecorator.java:100)
at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.reapply(DefaultUserCodeApplicationContext.java:60)
at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:97)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.interna