Bash magic oneliners

Getting the absolute path for current directory in script This thing is helpful if you want to decouple your script login from pwd (the actual directory you have runned the script from): DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) What it is doing: Get the relative path of…

Read More

Scala: Case Class from tuple!

There is a way to create a Case Class using the tuple. Put another way: you can use a Case Class as a function to create values from tuples. // simple demo case class case class Klass(a: String, b: String) { println(a + b) } // usage // dot notation Klass.tupled(("hello", "world"…

Read More