View Dockerfile
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
# VERSION 1.0 | |
# the base image is a trusted ubuntu build with java 7 (https://index.docker.io/u/dockerfile/java/) | |
FROM dockerfile/java | |
# that's me! | |
MAINTAINER Adam Warski, adam@warski.org | |
# we need this because the workdir is modified in dockerfile/java | |
WORKDIR / |
View build-docker-image.sh
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
#!/bin/sh | |
function copy_if_changed { | |
local path_from="$2/$1" | |
local path_to="$3/$1" | |
local md5_from=$(md5 -q $path_from) | |
if [ -e $path_to ] | |
then |
View Vagrantfile
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
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# http://www.vagrantbox.es/ | |
config.vm.box = "ubuntu-12.04-docker" | |
config.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-12.04-amd64-vbox.box" | |
# Sets the ip we'll use to access the box | |
config.vm.network :private_network, ip: "10.0.0.10" | |
config.vm.hostname = "myapp" |
View Sender.scala
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 com.softwaremill.mqperf | |
import com.softwaremill.mqperf.mq.Mq | |
import scala.util.Random | |
import com.softwaremill.mqperf.config.TestConfigOnS3 | |
object Sender extends App { | |
new TestConfigOnS3().whenChanged { testConfig => | |
println(s"Starting test (sender) with config: $testConfig") |
View Receiver.scala
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 com.softwaremill.mqperf | |
import com.softwaremill.mqperf.config.TestConfigOnS3 | |
import com.softwaremill.mqperf.mq.Mq | |
object Receiver extends App { | |
new TestConfigOnS3().whenChanged { testConfig => | |
println(s"Starting test (receiver) with config: $testConfig") | |
val mq = Mq.instantiate(testConfig) |
View SqsMq.scala
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 com.softwaremill.mqperf.mq | |
import com.amazonaws.services.sqs.buffered.AmazonSQSBufferedAsyncClient | |
import com.amazonaws.services.sqs.AmazonSQSAsyncClient | |
import scala.collection.JavaConverters._ | |
import com.amazonaws.services.sqs.model.{DeleteMessageRequest, ReceiveMessageRequest, SendMessageBatchRequestEntry} | |
import com.softwaremill.mqperf.config.AWSCredentialsFromEnv | |
import com.amazonaws.regions.{Region, Regions} | |
class SqsMq(configMap: Map[String, String]) extends Mq { |
View Sender.scala
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
val serverLocator = { | |
val nettyParams = new java.util.HashMap[String, Object]() | |
nettyParams.put(TransportConstants.HOST_PROP_NAME, "localhost") | |
nettyParams.put(TransportConstants.PORT_PROP_NAME, "5445") | |
val sl = HornetQClient.createServerLocatorWithHA( | |
new TransportConfiguration(classOf[NettyConnectorFactory].getName, nettyParams)) | |
sl.setConfirmationWindowSize(1048576) |
View gist:46c6550a6444156b434e
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
/* | |
A proposition on how classifiers can be implemented in MacWire. Based on @milessabin's https://gist.github.com/milessabin/89c9b47a91017973a35f | |
*/ | |
// Infrastructure: would come in the library | |
// note that no changes in the macro are necessary. The qualifiers are purely type-based | |
type Tag[U] = { type Tag = U } | |
type @@[T, U] = T with Tag[U] | |
type Tagged[T, U] = T with Tag[U] | |
implicit class Tagger[T](t: T) { |
View gist:5f68795f90b34abf7df1
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 carForm(removeAction: Car => ActionResult[Car]) = form[Car](f => List( | |
f.field(_.make).possibleValues(_ => carMakesAndModels.keys.toList).label("Make"), | |
// etc. | |
// trait Form[T] { def action(T => ActionResult[T]): Row[T] } | |
f.action(removeAction).label("Delete") | |
)) | |
val personForm = form[Person](f => List) | |
f.field(_.firstName).label("label_person_firstname"), | |
// etc. |
View gist:3080a568e05c4f4529e1
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
new SuplerForm(document.getElementById("container"), { | |
field_options: { | |
"age": { | |
// define render hint on frontend | |
"render_hint": "number" | |
}, | |
"dateOfBirth": { | |
"after_render": function(inputElement, containerElement) { | |
$(inputElement).datepicker(); | |
} |
OlderNewer