Skip to content

Instantly share code, notes, and snippets.

Avatar

Jacek Kunicki rucek

View GitHub Profile
@rucek
rucek / explanation.md
Last active Dec 12, 2017
play-scala-websocket-example
View explanation.md

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
View gist:a2507bfda03163257c04
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
View TemplateControllerTest.groovy
@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 Jul 13, 2011
Removing directories from last month
View remove_old_directories.sh
#!/bin/sh
ls /the/directory | grep .*-`date -d"1 month ago" +%Y%m`.* | xargs rm -rf
You can’t perform that action at this time.