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" |
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 | |
| package auth | |
| import model.User | |
| import org.scalatra.auth.{ ScentryConfig, ScentrySupport } | |
| import org.scalatra.ScalatraKernel | |
| import org.scalatra.auth.strategy.BasicAuthSupport | |
| /** |
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
| { | |
| "id":"source:twitter/5f08d6b0-e2ce-11e0-bbc2-005056c00008", | |
| "occurredAt":"2011-09-05T11:56:43.000Z", | |
| "actor":{ | |
| "objectType":"person", | |
| "id":"ro2cket", | |
| "displayName":"Skunk Works", | |
| "published":"2010-12-21T19:13:52.000Z", | |
| "image":{ | |
| "url":"http://a0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png" |
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
| #!/bin/sh | |
| curr=`dirname $0`/dist | |
| cp=`echo $(pwd)/$curr/*.jar|sed 's/ /:/g'` | |
| echo "the classpath:" | |
| echo $cp | |
| exec scala -classpath $cp $0 $@ | |
| !# |
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
| target |
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
| 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 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 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 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
| <dependencies> | |
| <exclude module="lift-common_2.9.0-1" /> | |
| <exclude module="lift-actor_2.9.0-1" /> | |
| <exclude module="lift-framework_2.9.0-1" /> | |
| <exclude module="lift-record_2.9.0-1" /> | |
| <exclude module="lift-util_2.9.0-1" /> | |
| <exclude module="lift-webkit_2.9.0-1" /> | |
| <exclude module="lift-json_2.9.0-1" /> | |
| <exclude module="lift-json-ext_2.9.0-1" /> | |
| <exclude module="lift-mongodb-record_2.9.0-1" /> |
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 PfExample { | |
| val Path = """/users/(.*)""".re // pretty non-sensical in real life | |
| def handleRequest: PartialFunction[Response] = { | |
| case Path(theUserId) => { | |
| // do heaps of stuff | |
| // create response | |
| } | |
| } |