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
target |
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
-- Based upon https://github.com/TimWolla/haproxy-auth-request/ | |
-- http://w3.impa.br/~diego/software/luasocket/ | |
local http = require("socket.http") | |
-- Doucmentation (if still works): | |
-- https://www.arpalert.org/src/haproxy-lua-api/1.9/index.html | |
-- Split 'str'-ing by 'pat'-tern | |
function splitString(str, pat) |
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
case class Account(var amount: Int) | |
import MoneyTransfer._ | |
class MoneyTransfer private (src: Account with SourceRole, | |
dst: Account with DestinationRole, | |
amount: Int) { | |
def transfer(): Unit = { | |
src transfer amount | |
} |
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
/** Akshaal, 2012. http://akshaal.info */ | |
import language.experimental.macros | |
import scala.reflect.macros.Context | |
import scala.annotation.Annotation | |
/** | |
* Macros for traversing over annotated elements. | |
* | |
* See http://www.akshaal.info/2012/08/scala-210-annotated-fields-macro.html for more information. |
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
// --------------------------------------------------------------------------------------------- | |
// Here is the definition of TypedKeyMap | |
import scala.language.implicitConversions | |
import scala.language.higherKinds | |
import scala.language.existentials | |
import scala.collection.immutable.{ MapLike, HashMap } | |
trait TypedKey { | |
type Value |