This file contains 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
case class MyPreciousModel( | |
id: Id, | |
name: Option[String] = None, | |
description: Option[String] = None, | |
meta: Option[MyPreciousMeta] = None | |
) { | |
def setName(value: String) = this.copy(name = Some(value)) | |
def setDescription(value: String) = this.copy(description = Some(value)) | |
def setMeta(value: MyPreciousMeta) = this.copy(meta = Some(value)) | |
} |
This file contains 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 com.kinja.common.model.Id | |
import com.kinja.mantle.model.DetectedFeature | |
import com.kinja.mantle.overlord.model.template.sections.SidebarData | |
import com.kinja.mantle.overlord.model.KinjaRequest | |
import com.kinja.mantle.overlord.model.KinjaResponse | |
import com.kinja.mantle.overlord.model.NewRelicConfig | |
import com.kinja.mantle.overlord.assembly._ | |
import com.kinja.mantle.overlord.assembly.sections._ | |
import com.kinja.mantle.overlord.assembly.layout.Master |
This file contains 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 com.kinja.mantle.overlord.model.template.sections.SidebarData | |
import com.kinja.mantle.overlord.assembly._ | |
import com.kinja.mantle.overlord.controller.TemplateRendering | |
import com.kinja.mantle.overlord.model.{ KinjaRequest, KinjaResponse } | |
import com.kinja.mantle.overlord.model.NewRelicConfig | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import com.kinja.mantle.model.DetectedFeature | |
import com.kinja.mantle.apiclient.PostApiClient | |
import play.modules.statsd.api.Statsd | |
import com.kinja.common.model.Id |
This file contains 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
list.map { | |
element => | |
something() | |
f(element) | |
somethingElse() | |
} | |
future.map { case Data(d) => | |
f(d) | |
} |
This file contains 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
list.map(f) | |
list.map { element => | |
something() | |
f(element) | |
somethingElse() | |
} | |
list.map { | |
case Data(d) => f(d) |
This file contains 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
case class BlogMeta( | |
description: Option[String] = None, | |
descriptionHtml: Option[String] = None, | |
timezone: String = "America/New_York", | |
properties: Option[String] = None, | |
adminProperties: Option[String] = None, | |
showLikesInLatest: Option[Boolean] = None, | |
showRepliesInLatest: Option[Boolean] = None, | |
features: List[String] = List(), | |
groupBlog: Option[Boolean] = None) |
This file contains 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
if (flag) f() else g() |
This file contains 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
flag match { | |
case true => f() | |
case false => g() | |
} |
This file contains 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
def speed(distance: Distance, time: Time) = | |
Speed(distance.value / time.value) |
This file contains 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
def getSpeedByDistanceAndTime(x: Int, y: Int) = x / y |