06:52 jakedouglas: [23:22:23] hmm. the example atmosphere code doesn't really click with me
06:52 casualjim: [23:22:34] yes because it's input and output
06:52 casualjim: [23:23:31] i'll map lines
06:52 casualjim: [23:23:33] https://github.com/scalatra/scalatra/blob/develop/example/src/main/scala/org/scalatra/ChatServlet.scala#L13
06:52 casualjim: [23:23:46] https://github.com/scalatra/scalatra/blob/develop/example/src/main/scala/org/scalatra/MeteorChatExample.scala#L53
06:52 casualjim: [23:23:53] that's the same point in the lifecycle
06:52 casualjim: [23:24:11] https://github.com/scalatra/scalatra/blob/develop/example/src/main/scala/org/scalatra/ChatServlet.scala#L22-36
06:52 casualjim: [23:24:27] https://github.com/scalatra/scalatra/blob/develop/example/src/main/scala/org/scalatra/MeteorChatExample.scala#L59-78
06:52 casualjim: [23:24:46] the "success" is just to force flushing the buffer it never arrives in the browser
06:52 casualjim: [23:25:14] https://github.com/scalatra/scalatra/blob
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
val bumpPatch = TaskKey[String]("bump-patch") | |
settings ++ Seq( | |
bumpPatch <<= (version) map { ver => | |
val Array(patch:Int, minor:Int, major:Int) = "0.0.1".split("\\.").reverse.map(_.toInt) | |
val newVer = "%d.%d.%d".format(major, minor, patch+1) | |
version := newVer | |
newVer | |
} | |
) |
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
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 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
trait ActorSpecification extends BaseSpecification | |
with ArgumentsArgs | |
with ArgumentsShortcuts | |
with MustThrownMatchers | |
with ShouldThrownMatchers | |
with FormattingFragments | |
with StandardResults | |
with StandardMatchResults | |
with PendingUntilFixed | |
with TimeHelpers |
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
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 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
# /etc/haproxy/haproxy.cfg, version 1.5 | |
global | |
maxconn 4096 | |
#user haproxy | |
#group haproxy | |
#daemon | |
defaults | |
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 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 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
package backchat | |
package web | |
import javax.servlet.http.{ HttpServletResponse, HttpServletRequest } | |
import org.scalatra._ | |
import collection.JavaConversions._ | |
object CORSSupport { | |
val ORIGIN_HEADER: String = "Origin" | |
val ACCESS_CONTROL_REQUEST_METHOD_HEADER: String = "Access-Control-Request-Method" |
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
upstream jetty { | |
server 127.0.0.1:12180; | |
} | |
server { | |
listen 80; | |
server_name www.api.backchat.io; | |
rewrite ^/(.*) http://api.backchat.io/$1 permanent; | |
} |
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
# 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" |