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
# nginx - web server | |
description "nginx web server" | |
author "Graham Edgecombe <[email protected]>" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
expect fork | |
respawn |
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
//Usage: | |
//override def pomPostProcess(node: Node): Node = mcPom(moduleConfigurations)(super.pomPostProcess(node)) | |
trait McPom { self: DefaultProject => | |
import scala.xml._ | |
def mcPom(mcs: Set[ModuleConfiguration])(node: Node): Node = { | |
//make sure we have a trailing slash so we deduplicate URLs properly | |
def cleanUrl(url: String) = url match { | |
case null => "" |
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
<% iterations.each do |iteration| %> | |
<h2 id='Sprint_<%= iteration.number %>' style='display:inline'>Sprint <%= iteration.number %></h2><i> - ends <%= iteration.finish.strftime("%Y-%m-%d") %></i><a href='#Sprint_<%= iteration.number %>' class='anchor'> ¶</a> | |
<ul> | |
<% iteration.stories.each do |story| %> | |
<li class='story'><h3 style='display:inline'><i>Story <%= story.id %> (<%= story.current_state %>)</i></h3> | |
<small class='taskCount'><i><%= " - #{story.tasks.size} tasks defined" if story.respond_to?(:tasks) %></i></small> | |
<p class='storyDescription'><span class="storyIngress"><%= story.name%></span><br><span class="storyRest" style="color:grey"></span></p> | |
<% end %> | |
</ul> | |
<% end %> |
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
trait HandlerArgs { | |
def isInitial: Boolean | |
} | |
case object InitialArgs { val isInitial = true } | |
case object ContinuationArgs { val isInitial = false } | |
class Handler extends ((Request, HandlerArgs) => Response) | |
class Middleware extends (Handler => Handler) |
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 javax.servlet.annotation._ | |
import grizzled.generator._ | |
import scala.annotation._ | |
import scala.util.Random | |
trait Request | |
case object Request extends Request | |
trait Handler extends (Request => Response) |
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
# Source accepts the protocol region:// with the host as the bucket | |
# access_key_id and secret_access_key are just that | |
# for the eu-west-1 region: | |
s3_file "/var/bulk/the_file.tar.gz" do | |
source "s3-eu-west-1://your.bucket/the_file.tar.gz" | |
access_key_id your_key | |
secret_access_key your_secret | |
owner "root" | |
group "root" |
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 Main { | |
def main(args: Array[String]) { | |
MySquerylScheme.initialize() | |
WebServer("src/main/webapp", Config.webServerPort) { server => | |
server.inContext("/api") { context => | |
context.mount("validate", new ValidateApp) | |
context.mount("channels", new MessageChannelApp) | |
context.mount("streams", new StreamsApp) |
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
case class Paginator[A]( | |
val adapter: Adapter[A], | |
val currentPage: Int = 1, | |
val maxPerPage: Int = 10 | |
) extends PaginatorLike[A] { | |
assert(maxPerPage > 0, "Max per page must be greater than zero") | |
assert(currentPage > 0, "Current page must be greater than zero") |
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
class HttpMethod | |
object HttpPostMethod extends HttpMethod { override def toString = "POST" } | |
object HttpGetMethod extends HttpMethod { override def toString = "GET" } | |
object HttpDeleteMethod extends HttpMethod { override def toString = "DELETE" } | |
object HttpPutMethod extends HttpMethod { override def toString = "PUT" } | |
trait Param { | |
def name: String | |
def description: 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
package com.matygo.controllers | |
import java.io.File | |
import java.io.PrintWriter | |
import java.io.StringWriter | |
import scala.collection.JavaConversions.mapAsScalaMap | |
import org.scalatra.ScalatraKernel.MultiParamsKey | |
import org.scalatra.ContentTypeInferrer | |
import org.scalatra.util.MultiMap | |
import org.scalatra.CookieSupport | |
import org.scalatra.RouteMatcher |
OlderNewer