Skip to content

Instantly share code, notes, and snippets.

case class SearchCategory(
id: Option[Long],
created: DateTime,
modified: DateTime,
name: Option[String] = None
) {
@jakob85
jakob85 / gist:15d02170878b8d190bda
Created May 22, 2014 14:52
Major Collecting stuff
AccountRepository.find().map { accounts =>
accounts.map { account =>
val eligable = reviewService.receivedReviewedInDays(account.recoInfo.recoId, millis).map {
b => {
account.recoInfo.recoId -> b
}
}.collect {
case (r, false) => r
}.map { r =>
taskService.isRecoIdEligibleForTask(r).map {
package plugins
import play.api.{Logger, Plugin, Application}
import scala.concurrent.Future
import models.{Lead, DataResponse}
import exceptions.ServiceException
/**
* User: jakobdobrzynski
* Date: 11/4/13
@jakob85
jakob85 / Scala stuff!
Last active December 28, 2015 21:39
Scala stuff!
/** list to commaseparated string */
val test = firstRow match {
case xs if xs.size == 0 || xs.size == 1 => xs.mkString
case xs if xs.size > 1 => xs.mkString(", ")
}
/** commaseparated string to distinct array */
.split(",").flatMap(maybeInt =>
#! /bin/sh
#decription: Starts play app using daemon
# 1. Go to $APPLICATION_PATH and prepare for dev by doing: play clean compile stage
# This will create a start script at target/start
# 2. Start the application by running this script
# created by: Jakob Dobrzynski
# some corrections by mdk
PLAY_HOME=/usr/share/play
PLAY=$PLAY_HOME/play
@jakob85
jakob85 / EC2 Play2
Last active December 26, 2015 21:19
1. Key
Download key.
Move to ./ssh
Make visible for ssh sudo chmod 400 ../.ssh/reco-keypair.pem
2. Connect to instance
ssh -i ../.ssh/reco-keypair.pem [email protected]
3. Download java 1.7 and install
@jakob85
jakob85 / gist:6340324
Created August 26, 2013 11:02
To handle dates in correct format.
package utils
import org.joda.time._
import org.joda.time.format._
import anorm._
object AnormExtension {
val dateFormatGeneration: DateTimeFormatter = DateTimeFormat.forPattern("yyyyMMddHHmmssSS");