Skip to content

Instantly share code, notes, and snippets.

@goungoun
goungoun / JSONSample.scala
Created October 17, 2018 02:56 — forked from takezoe/JSONSample.scala
Example of scala.util.parsing.json
import scala.util.parsing.json._
val result = JSON.parseFull("""
{"name": "Naoki", "lang": ["Java", "Scala"]}
""")
result match {
case Some(e) => println(e) // => Map(name -> Naoki, lang -> List(Java, Scala))
case None => println("Failed.")
}
@goungoun
goungoun / bashpath.sh
Created March 26, 2018 02:58 — forked from darrenderidder/bashpath.sh
Get path of running script in bash
#!/bin/bash
# A simple test script to demonstrate how to find the
# "absolute path" at which a script is running. Used
# to avoid some of the pitfals of using 'pwd' or hard-
# coded paths when running scripts from cron or another
# directory.
#
# Try it out:
# run the script from the current directory, then