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 ProductionConfig{ | |
def main(args: Array[String]): Unit = { | |
Application.run( | |
Config( | |
ConfigService.getString("db.host"), | |
ConfigService.getInt("db.port") | |
) | |
) | |
} | |
} |
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 ProductionConfig{ | |
def main(args: Array[String]): Unit = { | |
val config = Config("db.production-server.com",12345) | |
if(args(0) == "serialize") | |
println( toJson( config ) ) | |
else | |
Application.run( config ) | |
} | |
} |
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 Application{ | |
def run(config: Config): Unit = { | |
val db = connectToDb( config.dbHost, config.dbPort ) | |
... | |
} | |
} | |
case class Config( | |
dbHost: String, | |
port: Int | |
) |
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 Application{ | |
def main(args: Array[String]): Unit = { | |
val config = Config.get( args(0) ) | |
val db = connectToDb( config.dbHost, config.dbPort ) | |
... | |
} | |
} | |
object Config{ | |
def get(config: 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
object Application{ | |
def main(args: Array[String]): Unit = { | |
val config = Config.get( args(0) ) | |
val db = connectToDb( config.dbHost, config.dbPort ) | |
... | |
} | |
} | |
object Config{ | |
def get(config: String) = { | |
val reader = config_library.ConfigReader( config + “.conf” ) |
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 | |
sbt --error ";set showSuccess := false; $*" |
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
% sbtx dependencyGraph | |
... blah blah ... | |
[info] *** Welcome to the sbt build definition for Scala! *** | |
[info] Check README.md for more information. | |
[error] Not a valid command: dependencyGraph | |
[error] Not a valid project ID: dependencyGraph | |
% sbtx -Dplugins=graph dependencyGraph | |
... blah blah ... |
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 Tests._ | |
object stagedBuild extends Build { | |
lazy val mainProject = Project( | |
id="main", | |
base=file("."), | |
settings = sharedSettings ++ Seq( | |
slick <<= codeGenTask, // register manual sbt command |
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 scala.concurrent._ | |
import scala.concurrent.duration._ | |
trait SynchronousExecutionContext | |
object SynchronousExecutionContext extends ExecutionContext with SynchronousExecutionContext { | |
def execute( runnable: Runnable ): Unit = runnable.run | |
def reportFailure( cause: Throwable ): Unit = throw new Exception( cause ) | |
} |
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
# name: Agnoster | |
# agnoster's Theme - https://gist.github.com/3712874 | |
# A Powerline-inspired theme for FISH | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a | |
# [Powerline-patched font](https://gist.github.com/1595572). | |
## Set this options in your config.fish (if you want to :]) |