Skip to content

Instantly share code, notes, and snippets.

View olbpetersson's full-sized avatar
🥞
I eat pancakes.

Ola Petersson olbpetersson

🥞
I eat pancakes.
  • Meltwater
  • Gothenburg
View GitHub Profile
<execution>
<phase>pre-integration-test</phase>
<id>start</id>
<goals>
<goal>start-containers</goal>
</goals>
<configuration>
<!-- You can set forceCleanup to true to stop and remove started containers
at the end of the build even if the stop-containers goal is not executed
(useful for preventing Ctrl+C causing dangling containers) -->
package se.olapetersson.automagic;
import javax.ejb.Stateless;
import javax.enterprise.event.Event;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@Stateless
var express = require('express');
var app = express();
app.get('/', function (req, res) {
console.log("Security got a request!")
var data = require('./workspace/data.json')
res.send(data.data);
});
app.listen(3000, function () {
vars.yml
---
env:
ANSIBLE_LIBRARY: "~/modules"
####
test.yml
- hosts: all
vars_files:
- vars.yml
environment: "{{env}}"
---
- hosts: controller
tasks:
- name: find files in folder
find: paths={{ playbook_dir}}/files/
register: find_result
- hosts: a_node
tasks:
@olbpetersson
olbpetersson / AkkaStream.java
Last active November 21, 2016 22:11
Trying out Streams in lagom
@Override
public ServiceCall<Source<String, ?>, Source<String, NotUsed>> test() {
Logger.info("Got something streamed");
return inputStream -> {
inputStream.runForeach(input -> {
Logger.info("Got {} streamed", input);
ref.ask(new MyCommand());
}, materializer);
return CompletableFuture.completedFuture(pubSubRef.subscriber());
};
################### playbook #####################
---
- hosts: a_node
become: true
become_user: example_user
tasks:
- command: touch /tmp/removeMe.file
################### output #######################
PLAY [a_node] ***********F**************************************************
#
# Copyright (C) 2016 Lightbend Inc. <http://www.lightbend.com>
#
play.modules.enabled += se.olapetersson.voting.impl.VotingModule
lagom.services {
voting = "http://localhost:8080"
cas_native = "http://localhost:9042"
}
/* Synchronously prints
main
Current thread: main
hello, world!
Current thread: main
hello
Current thread: main
world
In about 15 seconds */
mono.subscribe(new BaseSubscriber<String>() {
@Override
protected void hookOnNext(String value) {
...
}
});