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 ViewUserItem{ | |
| lazy val menu = Menu.params[(User, Items)]("User Slug", "User Slug", | |
| { | |
| case username :: slug :: Nil => | |
| (User.findByUsername(username), Items.findBySlug(slug)) match { | |
| case (Full(u), Full(i)) => | |
| Full((u, i)) | |
| case _ => | |
| Empty |
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 controllers | |
| import play.api._ | |
| import play.api.mvc._ | |
| import lib._ | |
| import net.liftweb.json._ | |
| import play.api.libs.json.Json | |
| import scala.util.{Failure, Success} | |
| import play.api.libs.concurrent.Execution.Implicits.defaultContext |
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 lib | |
| import com.twitter.finagle.ServiceFactory | |
| import org.jboss.netty.handler.codec.http._ | |
| import com.twitter.finagle.builder.ClientBuilder | |
| import com.twitter.finagle.http.Http | |
| //import com.twitter.finagle.{Http, Service} | |
| import com.twitter.conversions.time._ | |
| import org.jboss.netty.buffer.ChannelBuffers |
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
| > what-depends-on io.dropwizard.metrics metrics-core 3.1.1 | |
| [info] io.dropwizard.metrics:metrics-core:3.1.1 | |
| [info] +-com.github.vonnagy:service-container-metrics-reporting_2.11:1.0.1 [S] | |
| [info] | +-activator-service-container-tutorial:activator-service-container-tutorial:1.0.1 [S] | |
| [info] | | |
| [info] +-com.github.vonnagy:service-container_2.11:1.0.1 [S] | |
| [info] | +-activator-service-container-tutorial:activator-service-container-tutorial:1.0.1 [S] | |
| [info] | +-com.github.vonnagy:service-container-metrics-reporting_2.11:1.0.1 [S] | |
| [info] | +-activator-service-container-tutorial:activator-service-container-tutorial:1.0.1 [S] | |
| [info] | |
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 main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "github.com/gorilla/mux" | |
| "net/http" | |
| ) | |
| type API struct { |
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 main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "net/http" | |
| ) | |
| //In a struct, a third parameter in a variable/type declaration is called a tag | |
| type User struct { |
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
| /* | |
| CREATE TABLE users ( | |
| user_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, | |
| user_nickname VARCHAR(32) NOT NULL, | |
| user_first VARCHAR(32) NOT NULL, | |
| user_last VARCHAR(32) NOT NULL, | |
| user_email VARCHAR(128) NOT NULL, | |
| PRIMARY KEY (user_id), | |
| UNIQUE INDEX user_nickname (user_nickname) | |
| ) |
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
| 'use strict'; | |
| /* | |
| npm install --save elasticsearch | |
| create document | |
| https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference-2-1.html | |
| */ | |
| module.exports = function() { |
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
| /* | |
| ~/.aws/credentials | |
| [default] | |
| aws_access_key_id = <YOUR_ACCESS_KEY_ID> | |
| aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY> | |
| https://github.com/KDawg/S3DeployJS/blob/master/S3Deploy.js | |
| */ |
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
| # Base image | |
| FROM ruby:latest | |
| ENV HOME /home/rails/webapp | |
| # Install PGsql dependencies and js engine | |
| RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs |