Some useful docker commands

Jul - 25 2016

kill all UP docker containers docker stop $(docker ps | awk ‘/Up/ { print $1}’) 2>/dev/null || echo ‘There are no running containers!’     remove all Exited Docker images rm $(docker ps -a | awk ‘/Exited/ { print $1}’) 2>/dev/null || echo ‘Nothing to remove’     running in interaction mode – while linking […]

Scala with FSM

Jul - 15 2016

FSM stands for Finite State Machine. Lets break this down, State : State is a description of the status of a system that is waiting to execute a transition. A transition is a set of actions to be executed when a condition is fulfilled or when an event is received. Its the best way to […]

Scala field Validation using “require”

Jul - 08 2016

Something i often forget about to easily   When we create a Case Class we should valid the field values   case class Person(FirstName: String, LastName: String) { require(!FirstName.isEmpty, “Person.FirstName.empty”) require(FirstName.length < 64, “Person.FirstName.sizeExceeded”) require(FirstName.matches(“^[a-zA-Z](((?!__)[a-zA-Z0-9_])*[a-zA-Z0-9])?$”), “Person.FirstName.mustStartWithLetter”) require(!LastName.isEmpty, “Person.LastName.empty”) require(LastName.length < 64, “Person.LastName.sizeExceeded”) require(LastName.matches(“^[a-zA-Z](((?!__)[a-zA-Z0-9_])*[a-zA-Z0-9])?$”), “Person.LastName.mustStartWithLetter”) }

Scala DuckTyping

Jul - 07 2016

Duck Typing is Defined as In duck typing, a programmer is only concerned with ensuring that objects behave as demanded of them in a given context, rather than ensuring that they are of a specific class But its best put “If it looks like a duck and quacks like a duck, it’s a duck” Its […]