- Install bloop
1.0.0-M11by following the Bloop installation instructions. Then, make sure you start up the bloop server on the background and to generate the configuration files by runningbloopInstallin your build tool. - Install IntelliJ 2018.2 EAP and then enable the nightly version of the Scala Plugin by opening Preferences | Languages & Frameworks | Scala | Updates tab and selecting the Nightly plugin update channel:

- check for updates and download the Scala plugin Nightly release.
- Reboot IntelliJ. The Scala plugin should now have version 2018.2.277 or higher (check in Preferences | Plugins)
- Open the "Find Action" search box (usual hotkey Shift+Ctrl+A or shift+cmd+A) and search for "bsp". The search box will show the full action name: "Enable experime
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
| apply plugin: 'application' | |
| apply plugin: 'scala' | |
| repositories { | |
| mavenLocal() | |
| mavenCentral() | |
| } | |
| ext { | |
| scalaBinaryVersion = "2.12" |
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
| task resolveDependencies { | |
| setDescription "Resolves all projects dependencies from the repository." | |
| setGroup "Build Server" | |
| doLast { | |
| rootProject.allprojects { project -> | |
| project.buildscript.configurations.forEach { configuration -> | |
| if (configuration.canBeResolved) { | |
| configuration.resolve() | |
| } |
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 monix.eval.Task | |
| import java.util.concurrent.TimeUnit | |
| import scala.concurrent.duration._ | |
| /** Request limiter for APIs that have quotas per second, minute, hour, etc. | |
| * | |
| * {{{ | |
| * // Rate-limits to 100 requests per second | |
| * val limiter = TaskLimiter(TimeUnit.SECONDS, limit = 100) | |
| * |
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
| Welcome to the Ammonite Repl 0.8.0 | |
| (Scala 2.11.8 Java 1.8.0_91) | |
| @ import scala.util.Try | |
| import scala.util.Try | |
| @ val listOfTries: List[Try[String]] = List(Try("a"), Try("b"), Try("c")) | |
| listOfTries: List[Try[String]] = List(Success("a"), Success("b"), Success("c")) | |
| // I have a List[Try[String]] but I actually want a Try[List[String]]. |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
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
| /** | |
| * USB HID Keyboard scan codes as per USB spec 1.11 | |
| * plus some additional codes | |
| * | |
| * Created by MightyPork, 2016 | |
| * Public domain | |
| * | |
| * Adapted from: | |
| * https://source.android.com/devices/input/keyboard-devices.html | |
| */ |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
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
| // scala 2.7 simple type constraint. This can only constrain a type parameter of this function. | |
| // Below, in ListW.sumint28, we can't use this approach because we want to constrain T, | |
| // a type param of the enclosing trait. | |
| def sumint27A[T <: Int](l: List[T]) : Int = l.reduceLeft((a: Int, b: Int) => a + b) | |
| trait IntLike[X] extends (X => Int) | |
| object IntLike { | |
| implicit val intIntLike: IntLike[Int] = new IntLike[Int] { def apply(x: Int) = identity(x) } | |
| } |
NewerOlder