Skip to content

Instantly share code, notes, and snippets.

@tkawachi
tkawachi / Main.scala
Last active June 9, 2022 01:25
Can't get operationName
package opname
import caliban.GraphQL.graphQL
import caliban.{CalibanError, GraphQLRequest, GraphQLResponse, RootResolver}
import caliban.wrappers.Wrapper.OverallWrapper
import zio.{UIO, ZIO}
case class Query(hello: String)
object Main {
@tkawachi
tkawachi / gpg_memo.md
Last active January 19, 2021 15:45
GPG memo

鍵の作成

$ gpg --gen-key

いろいろ聞かれるので答える。

鍵をなくした時や盗まれた時に無効化できるように revoke certificate を作る。

$ gpg --gen-revoke -o "revoke.cert" "KeyID"
@tkawachi
tkawachi / memo.md
Last active January 28, 2020 07:05
Dotty の launchIDE 時の手順

DottyIDEPlugin.scala

  1. .dotty-ide-artifact に language server の artifact 名を書く
    • ch.epfl.lamp:dotty-language-server_0.21:0.21.0-RC1 ← こういうやつ
  2. .dotty-ide.json にプロジェクトの情報を書く
  3. Visual studio code に lampepfl.dotty プラグインをインストール
    • code -n --force --install-extension lampepfl.dotty を実行 (-n は new window)
  4. Visual studio code を起動
  • プロジェクトディレクトリで code -n .
package controllers
import akka.stream.SinkShape
import akka.stream.scaladsl.{Broadcast, GraphDSL, Sink}
import akka.util.ByteString
import play.api.libs.streams.Accumulator
import play.api.mvc.BodyParser
import scala.concurrent.ExecutionContext
object BodyParserFuncs {
$ amm
Loading...
Welcome to the Ammonite Repl 1.3.3
(Scala 2.12.7 Java 1.8.0_212)
If you like Ammonite, please support our development at www.patreon.com/lihaoyi
@ trait A { def a(x: Int, y: Int): Int }
defined trait A
@ def a: A = { case (x: Int, y: Int) => x + y }
defined function a
import java.util
import io.radanalytics.operator.common.{AbstractOperator, EntityInfo, Operator}
import scala.beans.BeanProperty
import scala.jdk.CollectionConverters._
class Book(@BeanProperty var title: String,
@BeanProperty var authors: util.List[String])
extends EntityInfo {
AWSTemplateFormatVersion: '2010-09-09'
Description: >
AWS CloudFormation template to create a new VPC
or use an existing VPC for ECS deployment
in Create Cluster Wizard. Requires exactly 3
Instance Types for a Spot Request.
Parameters:
EcsClusterName:
Type: String
Description: >
AWSTemplateFormatVersion: '2010-09-09'
Description: >
AWS CloudFormation template to create a new VPC
or use an existing VPC for ECS deployment
in Create Cluster Wizard. Requires exactly 3
Instance Types for a Spot Request.
Parameters:
EcsClusterName:
Type: String
Description: >
package controllers
import akka.stream.SinkShape
import akka.stream.scaladsl.{Broadcast, GraphDSL, Sink}
import akka.util.ByteString
import play.api.libs.functional.{Applicative, Functor}
import play.api.libs.streams.Accumulator
import play.api.mvc.BodyParser
import scala.concurrent.ExecutionContext
@tkawachi
tkawachi / LambdaOp.hx
Last active May 16, 2018 04:20
Scala like functions for Haxe Option. Now published as http://lib.haxe.org/p/hxopt
import haxe.ds.Option;
using Lambda;
using OptionOp;
class LambdaOp {
public static function flatten<A>(it: Iterable<Option<A>>): Iterable<A> {
return it.filter(function(elem) {
return elem.isDefined();
}).map(function(elem) {