Skip to content

Instantly share code, notes, and snippets.

View rucek's full-sized avatar

Jacek Kunicki rucek

View GitHub Profile
@rucek
rucek / explanation.md
Last active December 12, 2017 13:25
play-scala-websocket-example

Here's a simple diagram to start with.

There's indeed a single WS flow created and materialized for every WS connection, i.e. for every browser window/tab. This happens when the UserActor receives WatchStocks - the created flow is then passed back to the HomeController.

Now, a WS flow consists of two endpoints: a sink which accepts the data that comes from the browser and a source which emits the data that is sent to the browser. So, to create a WS flow you need to have those two and combine them with Flow.fromSinkAndSourceCoupled.

In this example, those endpoints are:

  • the sink is the jsonSink, which accepts a stock name and, in turn, creates and runs a source with some random values for this stock (the purple ones in the diagram); the source is then attached to the hubSink (the yellow part in the diagram)
  • the source is the hubSource (the green part in the diagram), which emits all values o
@Unroll
def "OVF download should end with status code #expectedStatusCode when #condition"() {
given:
"$condition"()
when:
importOVFTemplate()
then:
checkTaskStatus(taskId, expectedStatusCode)
@rucek
rucek / remove_old_directories.sh
Created July 13, 2011 10:17
Removing directories from last month
#!/bin/sh
ls /the/directory | grep .*-`date -d"1 month ago" +%Y%m`.* | xargs rm -rf
1. scp jar
smlRzondzi
sudo cp vote-reporter-assembly-1.5.jar /opt/voter/ && sudo vim /opt/voter/application.conf
1,$s/voteserver\.local/54.76.120.25/g
1,$s/123/UUID/g
sudo /etc/init.d/voter restart && tail -f /opt/voter/voter.log