Skip to content

Instantly share code, notes, and snippets.

View ticofab's full-sized avatar

Fabio Tiriticco ticofab

View GitHub Profile

Reactive Amsterdam Meetup Code of Conduct

The Reactive Amsterdam Meetup is dedicated to providing a harassment-free community for everyone, regardless of sex, gender identity or expression, sexual orientation, disability, physical appearance, age, body size, race, nationality, or religious beliefs. We do not tolerate harassment of community members in any form. Participants violating these rules may be sanctioned or expelled from the community at the discretion of the Reactive Amsterdam organizers.

Harassment includes offensive verbal or written comments related to sex, gender identity or expression, sexual orientation, disability, physical appearance, age, body size, race, nationality, or religious beliefs, deliberate intimidation, threats, stalking, following, harassing photography or recording, sustained disruption of talks or other events, inappropriate physical contact, and unwelcome sexual attention. Sexual language and imagery is not appropriate for any Reactive Amsterdam event or communication ch

val eventRequestFlow = Flow.fromGraph(GraphDSL.create() { implicit b =>
// flow to prepare the request from a token
val prepareRequest = Flow[Token].map(token => eventRequest(token))
// the filter for http responses
val requestFilter = b.add(GraphDSL.create() { implicit b =>
b.add(Partition[FlowHttpResponse](3, {
case (resp, _) =>
resp.status match {
Source
// emits a GiveToken object once a day
.tick(0.seconds, 1.day, GiveToken)
// asks the Token Actor the auth token, is received as a string
.mapAsync(1)(msg => (tokenActor ? msg) (3.seconds).mapTo[String])
// passes it to the event request flow, implmented separately
.via(eventRequestFlow)
val bcMappingFlow = Flow.fromGraph(GraphDSL.create() { implicit b =>
import GraphDSL.Implicits._
val bc = b.add(Broadcast[Int](2))
val printSink = Sink.foreach(println)
bc.out(1).map(i => i * 2) ~> printSink
FlowShape(bc.in, bc.out(0))
})
Source(1 to 10)
.via(bcMappingFlow)
Phase Attribute Answer(s)
Design Availability Sources are the webservices mentioned above. I need to build services to fetch data from both.
Successfulness Final outcome should be a reliable prediction issued when a new event comes up.
Management Availability Data will be stored in a cloud persistence layer.
Recoverability This is delegated to the cloud service provider.
Portability Not immediate like copying a file. If this need arises I will need to create a parser to extract data.
Security This is delegated to the cloud service provider.
Well-documented A requirement will be to create proper documentation. These posts move in that direction!
Collection Availability In this I am entirely dependent on the sources. If something breaks I will know because sources can only be polled.
Completeness Of all the available data I don't need all. Requirements will specify what is needed from either source.
Phase Attribute Question(s)
Design Availability Who is the provider of this data? Who consumes it?
Successfulness What do stakeholders want to get out of this project?
Management Availability Can someone (myself) get the data?
Recoverability How to recover data in case of loss?
Portability How easy is it to move data to another infrastructure?
Security Is the data adequately protected?
Well-documented Is the data structure properly documented?
Collection Availability How can I monitor the availability of data from the provider?
Completeness Am I able to collect ALL the data? Do I need it?
04b6ca907869cdf0536eaa7a72dddcbe78cab519b6a8c8d6c78754bb2ec5f9093ded3dc787bfaa8de3e62b46be62abdacf1ddb69a4611713154c24034bfc37aff9;zioproto
### Keybase proof
I hereby claim:
* I am ticofab on github.
* I am ticofab (https://keybase.io/ticofab) on keybase.
* I have a public key whose fingerprint is E13C 8DCA 877A E569 D43E EAB1 5F7F 7698 2058 DD4C
To claim this, I am signing this object:
@ticofab
ticofab / gist:7667151
Last active December 29, 2015 11:59
Amsterdam.Scala - Scala Hackaton 26 Nov 2013 - Tiles Challenge
This is the little challenge I proposed and worked on with Giorgio, Joost and two other people (names? :) )
You need to create a solver for the following problem.
Say you have squared Tiles. Each tile can be traversed with a Movement. If you come in from Left, you can go to the Top, Right, Bottom, or stay in the middle (Inner). Same if you come from the Top: possible directions are Left, Right, Bottom and Inner.
One Movement can also start from the middle, and go Left, Right, Top or Bottom.
Movements are here defined as Strings for simplicity.