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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
implicit class PagePatternHelper(val sc: StringContext) extends AnyVal { | |
def page(args: Any*): PagePattern = { | |
val template = sc.standardInterpolator(treatEscapes, args) | |
val templateUrl = rl.Uri(template) | |
val path = templateUrl.path | |
val routeMatcher = new SinatraRouteMatcher(path) | |
val queryMultiParams = rl.MapQueryString.parseString(templateUrl.query.rawValue) | |
val queryParams = queryMultiParams.mapValues(_.head) |
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
object GOption { | |
def some[A](a: A): GOption[A] = new GOption[A] { | |
def cata[B](n: => B, s: A => B): B = sys.error("Implement me") | |
} | |
def none[A]: GOption[A] = new GOption[A] { | |
def cata[B](n: => B, s: A => B): B = sys.error("Implement me") | |
} | |
} | |
trait GOption[+A] { |
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
abstract class BaseResource(implicit protected val swagger: Swagger) | |
extends ScalatraServlet with FutureSupport with JacksonJsonSupport with SwaggerSupport with Imports { | |
override protected val applicationName = Some("messaging-api") | |
protected def applicationDescription = "Messaging Services API" | |
protected implicit val defaultTimeout = Timeout(5 seconds) | |
override val jsonpCallbackParameterNames: Iterable[String] = Some("callback") |
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
#---- run this section just once ----# | |
export GOPATH="${HOME}/go" | |
export GO15VENDOREXPERIMENT='1' | |
` | |
cd $GOPATH/src/github.com/go-swagger/go-swagger | |
go get -u github.com/asaskevich/govalidator | |
go get -u github.com/naoina/denco | |
go get -u github.com/go-swagger/scan-repo-boundary/makeplans |
OlderNewer