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
# RFC1422-compliant Javascript UUID function. Generates a UUID from a random | |
# number (which means it might not be entirely unique, though it should be | |
# good enough for many uses). See http://stackoverflow.com/questions/105034 | |
uuid = -> | |
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) -> | |
r = Math.random() * 16 | 0 | |
v = if c is 'x' then r else (r & 0x3|0x8) | |
v.toString(16) | |
) |
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 |
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
#!/usr/bin/python | |
# Based on diigo.py, which is copyright (c) 2008 Kliakhandler Kosta | |
# <Kliakhandler@Kosta.tk> and released under the GNU Public License. | |
# | |
# This hacked version is also released under the GNU Public License. | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
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) |
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 lib | |
import scala.concurrent.Future | |
import scala.concurrent.duration._ | |
import play.api.libs.concurrent.Execution.Implicits._ | |
object ConcurrentUtil { | |
import scala.language.{implicitConversions, postfixOps} |
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.duration._ | |
import play.api.libs.concurrent.Execution.Implicits._ | |
object WebServicesUtil { | |
import scala.language.{implicitConversions, postfixOps} | |
/** TRANSITIONAL: Simulate Play 2.0 await() for a Future, until code | |
* is refactored. |
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 SomeController extends Controller { | |
def signup = Action(parse.urlFormEncoded) { implicit request => | |
signupForm.bindFromRequest.fold( | |
{ form => // failure; repost | |
BadRequest(views.html.register.signup(form)) | |
}, | |
{ newUser => // success; create user and send confirmation |
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
implicit class UpCaser(val sc: StringContext) extends AnyVal { | |
def u(args: Any*): String = { | |
val strings = sc.parts.iterator | |
val expressions = args.iterator | |
var buf = new StringBuffer(strings.next) | |
while (strings.hasNext) { | |
buf append expressions.next | |
buf append strings.next | |
} |