- Java
- SBT
- Conscript
- Scalas
- Homebrew (Not necessary if Java and SBT are already installed).
- Cask
.gist .line-numbers { | |
line-height: 1.2; | |
} |
curl https://raw.githubusercontent.com/Kevin-Lee/GitHub-Wikifier/master/pre-commit > .git/hooks/pre-commit; | |
chmod +x .git/hooks/pre-commit; |
This is a modified version of GitHub Wide. I didn't write it entirely but modified a bit.
Change Applies to
to URLs matching the regexp
and put the following pattern.
https://github.com/[^/]+/[^/]+/(((wiki|issues)([?/][^/]*)*)|(pull/[0-9]+(([\/])((?!files).)*)?))
Run the following command to create ~/.ssh
folder if it doesn't already exist and set the right access permission.
{ { { mkdir ~/.ssh && echo "No ~/.ssh found so just created" } || { echo "~/.ssh already exists"; false } } ; chmod 700 ~/.ssh }
Once done, please check if you have the folder with the right access permission.
package cc.kevinlee.examples; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.List; | |
import java.util.Optional; | |
import static cc.kevinlee.examples.KeyValPair.*; | |
/** |
/** | |
* @author Kevin Lee | |
* @since 2016-01-15 | |
*/ | |
object WordCount extends App { | |
def wordCount(lines: String): Map[String, Array[Int]] = | |
lines.split('\n') | |
.map(_.trim) | |
.map(_.split("[\\s]+")) | |
.zipWithIndex |
let primes :: [Integer] | |
primes = sieve [2..] | |
where sieve :: [Integer] -> [Integer] | |
sieve (x : xs) = x : sieve [n | n <- xs, n `mod` x /= 0] | |
-- It works even without parameter types specified yet it is always good to have the type information | |
-- as it tells the users of the function how to use it. | |
-- It can also help you implement the function. | |
-- primes without parameter types (Uncomment it if you want to try). |