CREATE TABLE users (
id INTEGER PRIMARY KEY,
name VARCHAR(256) NOT NULL
)
CREATE TABLE groups (
id INTEGER PRIMARY KEY,
name VARCHAR(256) NOT NULL
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_URL=https://oss.sonatype.org/content/repositories/releases/com/github/seratch | |
| VERSION=1.6.5 | |
| for SCALA_VERSION in 2.9.1 2.9.2 2.9.3 2.10 | |
| do | |
| for NAME in scalikejdbc scalikejdbc-interpolation-core scalikejdbc-interpolation-macro scalikejdbc-interpolation scalikejdbc-config scalikejdbc-test scalikejdbc-mapper-generator-core scalikejdbc-mapper-generator scalikejdbc-play-plugin scalikejdbc-play-fixture-plugin | |
| do | |
| URL=${BASE_URL}/${NAME}_${SCALA_VERSION}/${VERSION}/${NAME}_${SCALA_VERSION}-${VERSION}.pom | |
| echo ${URL} | |
| curl --silent ${URL} | grep -3 scct | |
| done |
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 java.util.UUID | |
| import org.joda.time.DateTime | |
| import java.sql.SQLException | |
| import scala.Option | |
| import scalikejdbc.SQLInterpolation.SQLSyntaxSupport | |
| import util.control.Exception._ | |
| import java.sql.Connection | |
| import scalikejdbc._ | |
| import scalikejdbc.SQLInterpolation._ |
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 foo | |
| import scala.language.experimental.macros | |
| import scala.reflect.macros._ | |
| object ExampleMacros { | |
| def selectDynamicImpl(c: Context)(name: c.Expr[String]): c.Expr[String] = { | |
| import c.universe._ | |
| val _name: String = c.eval(c.Expr[String](c.resetAllAttrs(name.tree.duplicate))) |
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 scalikejdbc._ | |
| import scalikejdbc.SQLInterpolation._ | |
| // load settings | |
| Class.forName("org.hsqldb.jdbc.JDBCDriver") | |
| ConnectionPool.singleton("jdbc:hsqldb:mem:test", "", "") | |
| GlobalSettings.loggingSQLAndTime = LoggingSQLAndTimeSettings(enabled = true, logLevel = 'info) | |
| implicit val session = AutoSession |
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
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath group: 'org.twitter4j', name: 'twitter4j-core', version: '3.0.2' | |
| } | |
| } | |
| import twitter4j.* |
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
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath group: 'org.twitter4j', name: 'twitter4j-core', version: '3.0.2' | |
| } | |
| } | |
| import twitter4j.* |
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 sbt._ | |
| import Keys._ | |
| import play.Project._ | |
| object ApplicationBuild extends Build { | |
| val appName = "sample" | |
| val appVersion = "1.0-SNAPSHOT" | |
| val appDependencies = Seq( |
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
| # http://docs.amazonwebservices.com/elasticbeanstalk/latest/dg/create_deploy_Ruby_sinatra.html | |
| wget https://s3.amazonaws.com/elasticbeanstalk/cli/AWS-ElasticBeanstalk-CLI-2.2.zip | |
| unzip AWS-ElasticBeanstalk-CLI-2.2.zip | |
| mkdir eb_ruby | |
| cd eb_ruby | |
| echo "require './helloworld' | |
| run Sinatra::Application" > config.ru |
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
| access_key_id: xxx | |
| secret_access_key: yyy |