Skip to content

Instantly share code, notes, and snippets.

View kevin-lee's full-sized avatar
🏠
Working from home

Kevin Lee kevin-lee

🏠
Working from home
View GitHub Profile
@kevin-lee
kevin-lee / StringInterpolation.scala
Last active August 26, 2017 07:15
Customized String interpolation example
/**
* @author Kevin Lee
* @since 2016-04-09
*/
object StringInterpolation extends App {
implicit class EscapeNewLineAndDoubleQuote(val sc: StringContext) extends AnyVal {
def esc(args: Any*): String = {
val strings = sc.parts.iterator
val expression = args.iterator
@kevin-lee
kevin-lee / JProfiler-with-Docker.md
Created August 10, 2016 15:55
JVM Profiler with Docker

JProfiler with Docker

Docker

DockerFile

DockerFile should have JProfiler installation.

RUN wget <JProfiler file location> -P /tmp/ && \
  tar -xzf /tmp/<JProfiler file> -C /usr/local && \
  rm /tmp/<JProfiler file>
@kevin-lee
kevin-lee / README.md
Created February 25, 2017 10:38
Shellscript to install fonts for macOS and Linux

How to Use

# Move the the folder where the fonts are available. This script supports only otf and ttf.
# Then simply run the script like
$ ./path/to/script/install-fonts.sh 

Or you can add an alias to the ~/.bashrc or ~/.zshrc

alias install-fonts='/path/to/script/install-fonts.sh' 
@kevin-lee
kevin-lee / fibonacci.hs
Last active June 14, 2018 14:32
Examples of Fibonacci number function
fib 0 = 0
fib 1 = 1
fib 2 = 1
fib n = fib (n - 1) + fib (n - 2)
-- Get the 100th number
fib 100
-- But it takes too long.
-- You can do it with zipWith like the following line and it works much faster
fibs = 0 : 1 : 1 : zipWith (+) (drop 1 fibs) (drop 2 fibs)
@kevin-lee
kevin-lee / 1-XShapeIn2DCollection.md
Last active October 13, 2019 12:10
Fill 2D collection to draw X shape / Multiplication table

Drawing X shape in 2D collection

Common Error Type

case class Error(message: String)