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 DeserializeEnumExpression[T](child: Expression)(implicit clsTag: ClassTag[T]) extends UnaryExpression with NonSQLExpression { | |
override def nullable: Boolean = true | |
override protected def doGenCode(ctx: CodegenContext, | |
ev: ExprCode): ExprCode = { | |
val inputObject = child.genCode(ctx) | |
val javaType = ctx.javaType(dataType) | |
val code = | |
s""" |
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
syntax = "proto3"; | |
package scalapb; | |
option java_package = "com.trueaccord.scalapb"; | |
import "google/protobuf/descriptor.proto"; | |
message ScalaPbOptions { | |
// If set then it overrides the java_package and package. |
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
package protoser | |
import java.util.concurrent.atomic.AtomicReference | |
import akka.actor.ExtendedActorSystem | |
import akka.serialization.BaseSerializer | |
import com.trueaccord.scalapb.GeneratedMessageCompanion | |
class ScalaPbSerializer(val system: ExtendedActorSystem) extends BaseSerializer { | |
private val classToCompanionMapRef = new AtomicReference[Map[Class[_], GeneratedMessageCompanion[_]]](Map.empty) |
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
--- | |
# Create a RAID0 LVM through all ephemeral devices and mounts it. | |
- hosts: all | |
gather_facts: false | |
become: true | |
tasks: | |
- apt: name=lvm2 state=present | |
# On ubuntu, sometimes first ephemeral is already mounted in /mnt. | |
- mount: name=/mnt src=/dev/xvdb fstype=ext4 state=absent |
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
Companies hiring Scala developers in the Bay Area. | |
Created in response to a thread on scala-base. | |
My favorites: | |
- CloudPhysics | |
- Wordnik | |
Unbiased list: | |
- 10Gen | |
- Audax Health |
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 reverseProxy = Action.async(parse.raw) { | |
request: Request[RawBuffer] => | |
// Create the request to the upstream server: | |
val proxyRequest = | |
WS.url("http://localhost:8887" + request.path) | |
.withFollowRedirects(false) | |
.withMethod(request.method) | |
.withVirtualHost("localhost:9000") | |
.withHeaders(flattenMultiMap(request.headers.toMap): _*) | |
.withQueryString(request.queryString.mapValues(_.head).toSeq: _*) |
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
// Calls a function when a change in an element size is detected. | |
// Uses polling, since there is currently no way to detect resize | |
// events with CSS flow (without resorting to JQuery UI Resize) | |
.directive('taOnResize', function($interval) { | |
return { | |
restrict: 'A', | |
link: function(scope, element, attrs) { | |
var oldWidth = undefined; | |
var oldHeight = undefined; | |
var stop = $interval(function() { |
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
package controllers | |
import play.api.libs.json.Json | |
class Test { | |
case class Filter(id: Int, table: String, name: String, Type: String, structure: String) | |
implicit val filterWrites = Json.writes[Filter] |