Run with Scala CLI (https://scala-cli.virtuslab.org/):
scala-cli run .
And then go to http://localhost:9991
Happy coding, Scala is great.
Run with Scala CLI (https://scala-cli.virtuslab.org/):
scala-cli run .
And then go to http://localhost:9991
Happy coding, Scala is great.
package webm | |
import scala.collection.{GenMap, GenTraversableOnce} | |
import scala.language.experimental.macros | |
import scala.reflect.macros.blackbox | |
import scala.scalajs.js | |
import scala.scalajs.js.| | |
object FunctionMacro { |
import cats.{Applicative, Monad} | |
import cats.implicits._ | |
abstract class Foo[+M[_[_]], F[_]](implicit val M: M[F]) | |
trait Bar[F[_]] extends Foo[Applicative, F] { def bar = Applicative[F] } | |
trait Baz[F[_]] extends Foo[Monad, F] { def baz = Monad[F] } | |
class User[F[_]: Monad] extends Bar[F] with Baz[F] | |
object Test { |
Old | New | |
---|---|---|
.hidden | .d-none | |
.hidden-xs-up | .d-none | |
.hidden-xs | .d-none .d-sm-[value] | |
.visible-xs | .d-sm-none | |
.visible-xs-block | .d-block .d-sm-none | |
.visible-xs-inline | .d-inline .d-sm-none | |
.visible-xs-inline-block | .d-inline-block .d-sm-none | |
.hidden-xs-down | .d-none .d-sm-[value] | |
.hidden-sm | .d-sm-none .d-md-[value] |
#!/usr/bin/env amm | |
import scala.xml.{Elem, Node, Text, XML} | |
def quoteString(s: String) = | |
'"' + | |
s.replace("\n", "\\n").replace("\"", "\\\"") + | |
'"' |
# kubernetes - is an open source system for managing containerized | |
# applications across multiple hosts, providing basic mechanisms for | |
# deployment, maintenance, and scaling of applications. | |
# See: https://kubernetes.io | |
function __kubectl_no_command | |
set -l cmd (commandline -poc) | |
if not set -q cmd[2] | |
return 0 | |
end |
// originally by @SethTisue, see http://stackoverflow.com/questions/40622878/how-do-i-tell-sbt-to-use-a-nightly-build-of-scala-2-11-or-2-12/40622879#40622879 | |
resolvers += "nightlies" at "https://scala-ci.typesafe.com/artifactory/scala-release-temp/" | |
scalaVersion := { | |
val propsUrl = new URL("https://scala-ci.typesafe.com/job/scala-2.12.x-integrate-bootstrap/lastSuccessfulBuild/artifact/jenkins.properties/*view*/") | |
val props = new java.util.Properties | |
props.load(propsUrl.openStream) | |
props.getProperty("version") | |
} | |
scalaBinaryVersion := "2.12" |
I'm going to start off by motivating what I'm doing here. And I want to be clear that I'm not "dissing" the existing collections implementation or anything as unproductively negative as that. It was a really good experiment, it was a huge step forward given what we knew back in 2.8, but now it's time to learn from that experiment and do better. This proposal uses what I believe are the lessons we can learn about what worked, what didn't work, and what is and isn't important about collections in Scala.
This is going to start out sounding really negative and pervasively dismissive, but bear with me! There's a point to all my ranting. I want to be really clear about my motivations for the proposal being the way that it is.
def pp(tree: String, indentSize: Int = 2): String = { | |
var indentLevel = 0 | |
var outputTree = "" | |
tree foreach { char => char match { | |
case '(' => | |
indentLevel += 1 | |
outputTree += char.toString+'\n'+indents | |
case ')' => | |
indentLevel -= 1 | |
outputTree += "\n" + indents + char.toString |
Problem: When linking to the raw version of a gist, the link changes with each revision.
Solution:
To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/
To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]