This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rules": { | |
"indent": [2, 2], | |
"quotes": [2, "double"], | |
"linebreak-style": [2, "unix"], | |
"semi": [2, "always"], | |
"no-console": [0], | |
"react/prop-types": [0] | |
}, | |
"env": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SBT_OPTS="-Xms2048m -Xmx3072m -Xss2M" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logger.scala.slick.jdbc.JdbcBackend.statement=DEBUG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM table OFFSET random() * (SELECT COUNT(*) FROM table) LIMIT 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api.data.format.Formatter | |
import play.api.data.FormError | |
import play.api.data.Forms | |
object FormFormatters { | |
implicit val optionalTextFormatter = new Formatter[Option[String]] { | |
def bind(key: String, data: Map[String, String]): Either[Seq[FormError], Option[String]] = { | |
data.get(key) match { | |
case None => Right(None) | |
case text => Right(text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Try(number.toInt).toOption |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.URLDecoder | |
object PathConversionImplicits { | |
class StringWraperPathWithSpace(str: String) { | |
def pathWithSpaces = URLDecoder.decode(str.trim, "UTF-8").replace(" ", "\\ ") | |
} | |
implicit def stringToPathWithSpace(str:String) = { | |
new StringWraperPathWithSpace(str) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" VIM Configuration Egor Berezovskiy | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" let Vundle manage Vundle, required |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object LearnOptions { | |
def foption(i: Int): Option[Int] = { | |
if (i >= 5) Some(i) else None | |
} | |
val res = foption(6) | |
if (res.isDefined) { | |
println(res.get) |
NewerOlder