I hereby claim:
- I am bartschuller on github.
- I am bartschuller (https://keybase.io/bartschuller) on keybase.
- I have a public key whose fingerprint is AE09 9E16 74C8 DB1E 4DB5 DC97 B984 8FE4 22CA 46BD
To claim this, I am signing this object:
| import scala.concurrent.{ Await, Future } | |
| import scala.concurrent.duration._ | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| object FutMain { | |
| def main(args: Array[String]): Unit = { | |
| val part1 = (1 to 3).map(successful) | |
| val part2 = Seq(iffed(4)) | |
| val part3 = (5 to 7).map(successful) | |
| val total = Future.sequence(part1 ++ part2 ++ part3) |
| #!/bin/sh | |
| curl -XPUT localhost:9200/_template/logstash -d '{"template":"logstash-*","settings":{"index.refresh_interval":"5s"},"mappings":{"_default_":{"dynamic_templates":[{"string_fields":{"mapping":{"index":"analyzed","omit_norms":true,"type":"string","fields":{"raw":{"index":"not_analyzed","ignore_above":256,"type":"string"}}},"match_mapping_type":"string","match":"*"}}],"properties":{"geoip":{"dynamic":true,"path":"full","properties":{"location":{"type":"geo_point"}},"type":"object"},"@version":{"index":"not_analyzed","type":"string"}},"_all":{"enabled":true}}},"aliases":{}}' |
I hereby claim:
To claim this, I am signing this object:
| @(elements: helper.FieldElements) | |
| @************************************************** | |
| * Generate input according twitter bootstrap rules * | |
| **************************************************@ | |
| <div class="control-group @if(elements.hasErrors) {error}"> | |
| <label class="control-label" for="@elements.id">@elements.label</label> | |
| <div class="controls"> | |
| @elements.input | |
| <span class="help-inline">@elements.errors(elements.lang).mkString(", ")</span> |
| name := "delegation" | |
| scalaVersion := "2.10.0" | |
| libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-reflect" % _) |
| // some data to interpolate | |
| val attributes = Attributes("a"->"data wins", "b" -> "data loses") | |
| val attributeValue = "one" | |
| val nodes = Group(Elem("hi", Attributes()), Text(" there")) | |
| // Scala 2.10's pluggable string interpolation | |
| // Here xml"" means: create an Anti-XML element | |
| val xml = xml"""<foo a="overridden" $attributes b="literal wins">blie <b attr=$attributeValue/> bla $nodes</foo>""" |
| @(helloForm: Form[(String,Int,Option[String])]) | |
| @import helper._ | |
| @main(title = "The 'helloworld' application") { | |
| <h1>Configure your 'Hello world':</h1> | |
| @form(action = routes.Application.sayHello, args = 'id -> "helloform") { |
| // Compile this with scala 2.9.x and an extra option: | |
| // scalac -Xexperimental dyn.scala | |
| /** | |
| * Example to show off the Dynamic trait. | |
| * | |
| * Create an instance, call methods on it (the methods return this | |
| * so you can chain calls), then call result. | |
| **/ | |
| class ListBuilder extends Dynamic { |
| import io.Source | |
| import java.io.File | |
| object Stuff { | |
| val Import = """.*@import\s*"(.*?)".*""".r | |
| def allLessFiles(initial: File): Set[File] = | |
| Set(initial) ++ Source.fromFile(initial).getLines().flatMap[File](_ match { | |
| case Import(file) => allLessFiles(new File(initial.getParentFile, file)) | |
| case _ => Set.empty |
| val a = List(1,2,3,4) | |
| val b = List("A","B","C","D") | |
| val c = Map() ++ a.zip(b) |