- Command palette ⌘⇧P
- Search files ⌘P
- Search file symbols ⌘R
- Search project symbols ⌘⇧R
- Goto definition ⌘⌥↓
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
let | |
region = "us-west-2"; | |
accessKeyId = "CORRECTAWSKEY"; | |
defaults = | |
{ config, pkgs, resources, ... }: | |
{ deployment.targetEnv = "ec2"; | |
deployment.ec2.accessKeyId = accessKeyId; | |
deployment.ec2.region = region; |
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 argonaut._, Argonaut._ | |
import org.scalacheck._, Prop._ | |
import scalaz._, Scalaz._ | |
object EncodingTestExample extends Properties("Encoding Json Test Example") { | |
case class Vehicle( | |
wheelsCount: Option[Int], | |
engineParts: List[String] | |
) |
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
// This should work with Scala 2.10.4 & scalaz 7.1, core, effect and concurrent packages | |
import scalaz.{ concurrent, Free, Functor, Monad, syntax } | |
import concurrent.Task | |
import Free.{freeMonad => _, _} | |
import syntax.monad._ | |
// Describe the set of actions - which are functors | |
sealed trait RedisF[+A] { | |
def map[B](fn: A => B): RedisF[B] |
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
using: "net.debasishg" %% "redisclient" % "2.11" | |
// GetRedis.apply will print out all the keys and values in a csv list | |
object GetRedis { | |
import com.redis.{RedisClient, RedisClientPool} | |
def apply = { | |
val rcp = new RedisClientPool( | |
sys.env.getOrElse("REDIS_HOST", "localhost"), | |
6379 | |
) |
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
Show hidden characters
{ | |
"cmd": ["sbt"], | |
"file_regex": "^\\[error\\] ([.a-zA-Z0-9/-]+[.]scala):([0-9]+):", | |
"selector": "source.scala", | |
"working_dir": "${project_path:${folder}}", | |
"variants": [ | |
{ | |
"name": "sbt_compile", | |
"cmd": ["${project_path:${folder}}/sbt compile"], |
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
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", | |
"dictionary": "Packages/Language - English/en_GB.dic", | |
"font_face": "Monaco", | |
"font_size": 10, | |
"ignored_packages": | |
[ | |
"Vintage", | |
"Theme - Refined" | |
], |
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> p | |
res6: spire.math.poly.MultivariatePolynomial[Double] = (2.0x + 5.0 + 3.0y) | |
scala> q | |
res7: spire.math.poly.MultivariatePolynomial[Double] = (xy + 2.0x + 1.0 + 5.0y) | |
scala> p * q | |
res8: spire.math.poly.MultivariatePolynomial[Double] = (2.0x^2y + 4.0x^2 + 3.0xy^2 + 21.0xy + 12.0x + 28.0y + 5.0 + 15.0y^2) | |
scala> p + q |
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
find regex: ^(.*)$ | |
where: *.scala, *.java etc etc... |
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
def legendres(i: Int) : List[Polynomial[Rational]] = { | |
val one = Polynomial(0 -> r"1/1") | |
val x = Polynomial(1 -> r"1/1") | |
lazy val leg : Stream[Polynomial[Rational]] = { | |
def loop(pnm1: Polynomial[Rational], pn: Polynomial[Rational], n: Int = 1) : Stream[Polynomial[Rational]] = { | |
pn #:: loop(pn, Polynomial(0 -> Numeric[Rational].fromInt(n + 1).reciprocal) * ( | |
(Polynomial(1 -> Numeric[Rational].fromInt(2 * n + 1)) * pn) + | |
(Polynomial(0 -> Numeric[Rational].fromInt(n).unary_-) * pnm1)), n + 1) | |
} | |
one #:: loop(one, x) |