Skip to content

Instantly share code, notes, and snippets.

View manuelbernhardt's full-sized avatar

Manuel Bernhardt manuelbernhardt

View GitHub Profile
@manuelbernhardt
manuelbernhardt / results-latency.json
Last active April 28, 2021 18:27
temporal-throughput-quick-bench
[
{
"jmhVersion" : "1.28",
"benchmark" : "io.bernhardt.workflow.payment.PaymentHandlingWorkflowBenchmark.oneWorkerTwoWorkflows",
"mode" : "sample",
"threads" : 16,
"forks" : 1,
"jvm" : "/home/manu/.sdkman/candidates/java/14.0.2-open/bin/java",
"jvmArgs" : [
"-Dfile.encoding=UTF-8",
[
{
"jmhVersion" : "1.28",
"benchmark" : "io.bernhardt.workflow.payment.PaymentHandlingWorkflowBenchmark.oneWorkerTwoWorkflowsCassandra",
"mode" : "sample",
"threads" : 16,
"forks" : 1,
"jvm" : "/home/manu/.sdkman/candidates/java/14.0.2-open/bin/java",
"jvmArgs" : [
"-Dfile.encoding=UTF-8",
@manuelbernhardt
manuelbernhardt / automations.yaml
Created June 25, 2020 11:22
Home assistant configuration for Tradfri
- id: '1'
alias: Restore Light at day entrance
trigger:
- entity_id: light.entrance_spot_1,light.entrance_spot_2,light.entrance_spot_3,light.entrance_spot_4
from: 'off'
platform: state
to: 'on'
- entity_id: light.entrance_spot_1,light.entrance_spot_2,light.entrance_spot_3,light.entrance_spot_4
from: unavailable
platform: state

Keybase proof

I hereby claim:

  • I am manuelbernhardt on github.
  • I am manuelbernhardt (https://keybase.io/manuelbernhardt) on keybase.
  • I have a public key whose fingerprint is 55EF 42DE 0756 39CD 912D 9BEF BBF8 0641 C9A1 4ACC

To claim this, I am signing this object:

@manuelbernhardt
manuelbernhardt / Busy.java
Created July 20, 2016 07:02
Calculates PI to keep CPU busy
package com.typesafe.training.coffeehouse;
import scala.concurrent.duration.Duration;
import java.math.BigDecimal;
public class Busy {
public static BigDecimal busy(Duration duration) {
return pi(System.nanoTime() + duration.toNanos());
<div class="row">
<h3>Wines</h3>
<div>
<div control-group label="Language">
<select id="languageCode" name="languageCode" ng-model="$parent.currentLang" ng-options="l.value as l.label for l in languages"></select>
</div>
<div control-group label="Title">
<input type="text" id="title" name="title" ng-model="wine.translations[$parent.currentLang].title" required>
<span validation-error-for="required">Required</span>
+------------------------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------+
| org.mongodb:casbah_2.10:2.6.1 | com.novus:salat-core_2.10:1.9.2-SNAPSHOT | As casbah_2.10-2.6.1.pom |
+------------------------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------+
| org.mongodb:casbah-gridfs_2.10:2.6.1 | org.mongodb:casbah_2.10:2.6.1 | As casbah-gridfs_2.10-2.6.1.jar |
+------------------------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------+
| org.mongodb:casbah-core_2.10:2.6.1 | org.mongodb:casbah-gridfs_2.10:2.6.1
diff --git a/framework/src/play/src/main/scala/play/api/controllers/Assets.scala b/framework/src/play/src/main/scala/play/api/controllers/Assets.scala
index 18ef4cb..9649c5a 100644
--- a/framework/src/play/src/main/scala/play/api/controllers/Assets.scala
+++ b/framework/src/play/src/main/scala/play/api/controllers/Assets.scala
@@ -64,6 +64,7 @@ class AssetsBuilder extends Controller {
* @param file the file part extracted from the URL
*/
def at(path: String, file: String): Action[AnyContent] = Action { request =>
+ val now = System.currentTimeMillis()
// -- LastModified handling
@manuelbernhardt
manuelbernhardt / gist:3673622
Created September 8, 2012 11:15
WS UTF-8 bug workaround
def fetchList(): String = WS.url(SCHEMA_REPO + "/schema-repository.xml").get().await(5, TimeUnit.SECONDS).fold(
{ t: Throwable => log.error("Could not retrieve schema list", t); "" },
{ r: Response => r.getAHCResponse.getResponseBody("UTF-8") }
)