This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 { |
This file contains hidden or 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 | |
| tail -n +0 $1 \ | |
| | nl -ba \ | |
| | fzf --multi \ | |
| --ansi \ | |
| --no-sort \ | |
| --reverse \ | |
| --tac \ | |
| --preview 'sed -n "$(({n}-4)),$(({n}+6))p" '$1' | nl -v $(({n}-4)) -ba' \ |
This file contains hidden or 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 | bitmask | | |
| +--------------------------------+---------------+ | |
| | mode (light, dark) | 0b0100 | | |
| | screen size (xs, sm, md, lg) | 0b0011 | | |
| +--------------------------------+---------------+ | |
| */ | |
| type Bits = number; |
This file contains hidden or 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.dom.* | |
| import react.styled | |
| import kotlinx.browser.document | |
| import org.w3c.dom.Window | |
| import io.grpc | |
| import org.graphql | |
| val greetStub = grpc.stub!("proto/greeter.proto") // Type Inference & Code Generation from file contents | |
| val Content = styled.div! { |
This file contains hidden or 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 | |
| gitlab_ci () { | |
| gitlab-runner exec docker "$1" \ | |
| --cache-dir=/tmp/gitlab-cache \ | |
| --docker-cache-dir=/tmp/gitlab-cache \ | |
| --docker-volumes=/tmp/gitlab-cache \ | |
| --docker-volumes="$PWD"/deploy:/deploy \ | |
| --env=DOCKER_CONFIG_JSON=/deploy/config.json \ | |
| --env=DEPLOY_KUBECONFIG=/deploy/kubeconfig \ |
This file contains hidden or 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 | |
| helm upgrade -i efk stable/elastic-stack -n kube-system \ | |
| --set elasticsearch.image.tag=6.7.0 \ | |
| --set kibana.image.tag=6.7.0 \ | |
| --set fluent-bit.backend.type=es \ | |
| --set fluent-bit.backend.es.host=efk-elasticsearch-client.kube-system.svc.cluster.local \ | |
| --set kibana.env.ELASTICSEARCH_HOSTS=http://efk-elasticsearch-client.kube-system.svc.cluster.local:9200 \ | |
| --set fluent-bit.enabled=true \ | |
| --set logstash.enabled=false |
This file contains hidden or 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
| export function TodoView() { | |
| const state = useState<State>(State.PENDING) | |
| const handleCreateTask(e: React.SyntheticEvent) { | |
| // TODO | |
| } | |
| return <div> | |
| <ol> | |
| {tasks.map((task) => <Task task={task} />)} |