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
package com.example.coroutine | |
import io.kotest.core.spec.style.DescribeSpec | |
import io.kotest.matchers.shouldBe | |
import kotlinx.coroutines.* | |
import kotlinx.coroutines.reactive.awaitFirstOrNull | |
import kotlinx.coroutines.reactor.mono | |
import org.jooq.DSLContext | |
import org.jooq.impl.DSL | |
import kotlin.coroutines.CoroutineContext |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.20796161890029907</real> |
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
#!/bin/bash | |
EXTERNAL_IP=$(dig +short myip.opendns.com @resolver1.opendns.com) | |
curl -sfL https://get.k3s.io | sh -s - \ | |
--disable=traefik \ | |
--no-deploy=traefik \ | |
--write-kubeconfig-mode=644 \ | |
--tls-san=${EXTERNAL_IP} |
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 { ApolloClient, ApolloLink, HttpLink, InMemoryCache, split } from '@apollo/client' | |
import { WebSocketLink } from '@apollo/client/link/ws' | |
const httpLink = new HttpLink({ | |
uri: '/graphql', | |
}) | |
const wsLink = new WebSocketLink({ | |
uri: `${getWebsocketURI()}/subscriptions`, | |
options: { |
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
/// <reference types="react-scripts" /> | |
declare module 'react-router' { | |
import type { Location, State } from 'history' | |
export type * from 'react-router' | |
export declare function useLocation<S extends State = State>(): Location<S> | |
} |
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 React from "react"; | |
import { proxy, useSnapshot } from "valtio"; | |
class Store { | |
public counter = 0; | |
public text = ""; | |
get double() { | |
return this.counter * 2; | |
} |
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
type Query { | |
post(where: PostWhereUniqueInput!): Post | |
findFirstPost( | |
where: PostWhereInput | |
orderBy: [PostOrderByInput!] | |
cursor: PostWhereUniqueInput | |
take: Int | |
skip: Int | |
distinct: [PostScalarFieldEnum!] | |
): Post |
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
// Before Coroutine | |
fun matches(exchange: ServerWebExchange): Mono<MatchResult> { | |
return Mono.just(exchange) | |
.map(ServerWebExchange::getRequest) | |
.map(ServerHttpRequest::getHeaders) | |
.filter { header -> header.containsKey(HttpHeaders.AUTHORIZATION)) } | |
.flatMap { MatchResult.match() } | |
.switchIfEmpty { MatchResult.notMatch() } | |
} |
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
interface IPubSub<T> { | |
publish(value: T): void; | |
subscribe(subscriber: Subscriber<T>): Disposer; | |
} | |
type Subscriber<T> = (value: T): void; | |
type Disposer = () => void; |
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 DatabaseContainer(spek: LifecycleAware) { | |
private val connectionFactory = ConnectionFactories.get("r2dbc:tc:postgresql:///test?TC_IMAGE_TAG=13") | |
private val repositoryFactory by spek.memoized { | |
val operations = R2dbcEntityTemplate(connectionFactory) | |
R2dbcRepositoryFactory(operations) | |
} | |
fun create() { | |
runBlocking { |
NewerOlder