>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found
/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
This file contains 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
def pp(tree: String, indentSize: Int = 2): String = { | |
var indentLevel = 0 | |
var outputTree = "" | |
tree foreach { char => char match { | |
case '(' => | |
indentLevel += 1 | |
outputTree += char.toString+'\n'+indents | |
case ')' => | |
indentLevel -= 1 | |
outputTree += "\n" + indents + char.toString |
This file contains 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 play.api.libs.json._ | |
import play.api.libs.functional.syntax._ | |
val r = ( | |
(__ \ "field1").readNullable[String] and | |
(__ \ "field2").readNullable[Int] | |
).tupled.filter(ValidationError("unexpected result")){ | |
case( Some(x), None ) => true; | |
case ( None, Some(x) ) => true; | |
case _ => false |
This file contains 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
/** | |
* Scala hex / decimal binary calculator | |
* (c) Mark Lister 2012 | |
* Licence Apache 2. | |
*/ | |
class BaseN(b: BigInt, val baseN: Int) extends BigInt(b.underlying) { | |
def n(x: Int) = new BaseN(b, x) | |
/** |
This file contains 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
# --- !Ups | |
CREATE TABLE users( | |
email VARCHAR(255) NOT NULL PRIMARY KEY, | |
name VARCHAR(255) | |
); | |
CREATE TABLE subjects( | |
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
title LONGTEXT NOT NULL, |