Skip to content

Instantly share code, notes, and snippets.

@tkawachi
tkawachi / memo.md
Last active Jan 28, 2020
Dotty の launchIDE 時の手順
View memo.md

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 .
View gist:59233ccd34e109be08c04be09fc79c6b
$ 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
View BookOperator.scala
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 {
View cfn_template.yml
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: >
View gist:a4803e3782c660c343317b3509faa173
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: >
View BodyParserFuncs.scala
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 {
View BodyParserInstances.scala
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
View RedirectHackPlugin.scala
import java.net.{HttpURLConnection, URI, URL}
import sbt.plugins.IvyPlugin
import sbt.{AllRequirements, AutoPlugin, Keys, Logger, MavenRepository, Patterns, PluginTrigger, Plugins, Resolver, URLRepository}
import scala.collection.mutable
import scala.util.control.NonFatal
object RedirectHackPlugin extends AutoPlugin {
View gist:d1349a7b59ec742d5b9d5480d00e244d
$ peco-src
failed MSpanList_Insert 0x6b6000 0x1596717189b31 0x0
fatal error: MSpanList_Insert
runtime stack:
runtime.throw(0x5f713b)
/usr/local/Cellar/go/1.3/libexec/src/pkg/runtime/panic.c:520 +0x69
runtime.MSpanList_Insert(0x6105e8, 0x6b6000)
/usr/local/Cellar/go/1.3/libexec/src/pkg/runtime/mheap.c:618 +0x8a
MHeap_FreeLocked(0x60c5e0, 0x6b6000)
View package.scala
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}
import scalaz.std.scalaFuture._
import scalaz.{ContT, Kleisli}
package object smt {
type FutureCont[A] = ContT[Future, A, A]
type DBActionz[A] = Kleisli[FutureCont, Context, A]