Plan to hang around after the Typelevel Summit, because this year, Northeast Scala Symposium 2016 will be held at the same location on March 4th and 5th. RSVPs open January 16th. Join in the fun!
This file contains 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 org.apache.spark.sql.types._ | |
import org.apache.spark.sql._ | |
object Implicits { | |
def schemaAsCode(schema: StructType, indentation: Int = 2): String = { | |
def prettyStruct(st: StructType, indentationLevel: Int): String = { | |
val indentSpaces = " " * (indentationLevel * indentation) | |
val prefix = s"${indentSpaces}StructType(List(\n" | |
val fieldIndentSpaces = " " * ((indentationLevel + 1) * indentation) | |
val fieldStrings: Seq[String] = for (field <- st.fields) yield { |
This file contains 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
package org.clapper | |
import scala.language.implicitConversions | |
import contextual._ | |
object ThingTest1 { | |
case class Thing(s: String) |
This file contains 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 scala.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import java.util.Date | |
import java.text.SimpleDateFormat | |
import fs2._ | |
// id and gender should really be more strongly-typed, but | |
// this is just a demo... | |
case class Person(id: Int, | |
firstName: String, |
This file contains 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
object StaticFile { | |
// Various necessary imports. Notes: | |
// | |
// 1. fs2 is necessary. See https://github.com/functional-streams-for-scala/fs2 | |
// 2. streamz is necessary. See https://github.com/krasserm/streamz | |
// 3. Apache Tika is used to infer MIME types from file names, because it's more reliable and | |
// fully-featured than using java.nio.file.Files.probeContentType(). | |
// | |
// If using SBT, you'll want these library dependencies and resolvers: |
This file contains 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
package grizzled.testutil | |
import java.io.{PrintWriter, OutputStreamWriter} | |
import java.net.InetAddress | |
import java.text.SimpleDateFormat | |
import java.util.Date | |
import scala.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.io.Source |
I hereby claim:
- I am bmc on github.
- I am bmc (https://keybase.io/bmc) on keybase.
- I have a public key whose fingerprint is B57B 6B4B 451A F540 4D21 BEA4 1588 40B4 A8A7 FD98
To claim this, I am signing this object:
This file contains 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
libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) => | |
// If we're compiling on 2.11, we need to haul the reflection library | |
// in separately, since it's no longer bundled in 2.11. | |
if (sv.startsWith("2.11.")) { | |
deps :+ "org.scala-lang" % "scala-reflect" % "2.11.0" | |
} | |
else { | |
deps | |
} |
This file contains 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
package views | |
object LocalHelpers { | |
/** Default target for offsite anchors. | |
*/ | |
val OffSiteAnchorTarget = "link" | |
/** Convert a symbol to a string, for use in HTML. | |
*/ |
This file contains 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 scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent._ | |
import scalaz._ | |
import Scalaz._ | |
import scala.async.Async.{async, await} | |
import lib.ScalazUtil | |
// Stubs, to get this to compile. Fill in with real stuff later. | |
case class User(username: String, password: String) | |
case class GitHubData(user: User) |
NewerOlder