Skip to content

Instantly share code, notes, and snippets.

View invasionofsmallcubes's full-sized avatar
👻
Fool Stack Developer

Emanuele Ianni invasionofsmallcubes

👻
Fool Stack Developer
View GitHub Profile
@invasionofsmallcubes
invasionofsmallcubes / example.java
Last active August 29, 2015 14:11
usage of abstract class instead of implementation on interfaces
// In Java 8 we have
public interface List<E> extends Collection<E> {
default void sort(Comparator<? super E> c)
{
Collections.sort(this, c);
}
}
public class ArrayList<E> extends AbstractList<E>
implements List<E>, RandomAccess, Cloneable, java.io.Serializable{}

Keybase proof

I hereby claim:

  • I am invasionofsmallcubes on github.
  • I am dierre (https://keybase.io/dierre) on keybase.
  • I have a public key whose fingerprint is 5821 5739 5707 69BC 6857 4F6B 43E5 5683 5814 5F93

To claim this, I am signing this object:

fun get(@PathVariable identifier: String): MutableList<in Quote> {
return defer { fromIterable( quoteRepository.getAll(identifier)) }
.subscribeOn(Computations.concurrent())
.stream()
.collect(
Collectors.toList());
}
@invasionofsmallcubes
invasionofsmallcubes / README.md
Last active June 16, 2016 11:32
Going reactive, one day...

Here's what's in my head: having everything reactive is actually an utopia.

Everyone of us need to talk to external providers (or just suppose we don't have a reactive driver for mysql/mongodb whatevah).

So I said: I want to achieve the minimum goal which is having the same number of request per second. I tried with just CompletableFuture because I know we have AsyncRestTemplate that we can use with DeferredResult.

Given the same number of threads for:

Hi,
I watched your presentation about CQRS and Erlang at NDC Oslo.
Before I ask you something, please now I never used Erlang so it could my
lack of knowledge on the language that led me to ask you this question.
I have a question about the demo code:
`
attempt_command({withdraw_money, Amount}, State) ->
NewBalance = State#state.balance - Amount,
Id = State#state.id,
static <T> Observable<T> just(T t) {
return Observable.create(
s -> {
s.onNext(t);
s.onCompleted();
}
);
}
static <T> Observable<T> never() {
@invasionofsmallcubes
invasionofsmallcubes / Observable.java
Created February 20, 2017 23:05
Page 102 of your book
// Question is totally stupid but...
// Example on the book:
Observable<Observable<String>> delay = just(
alice.map(w -> "MOO Alice: " + w),
paolo.map(w -> "MOO Paolo: " + w),
carmelo.map(w -> "MOO Carmelo: " + w)
)
.flatMap(Observable::just)
.delay(random.nextInt(5), SECONDS);
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import java.lang.Integer.MAX_VALUE
import java.lang.Integer.MIN_VALUE
import java.util.*
import kotlin.system.measureTimeMillis
class MinMaxTest {
fun classicMinMax(elements: IntArray): Pair<Int, Int> {
package com.time;
import org.junit.Test;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.TimeZone;
@invasionofsmallcubes
invasionofsmallcubes / coopGames.txt
Last active August 17, 2018 13:32
Set of Coop Tabletop Games
Gioco COOP BGG Link Voto BGG Dipendente dalla lingua Gameplay Link Prezzo Parere
Mysterium https://boardgamegeek.com/boardgame/181304/mysterium 7.4 No https://www.youtube.com/watch?v=vxh4oB0ATrI 41.40 Amazon, 36.00 Philibert Gioco molto carino di deduzione logica. Il contesto da seduta spiritica è molto leggero, anche perché devi passare il gioco a capire gli indizi quindi non ci fai molto caso. La cosa carina è che il fantasma non può parlare, può solo comunicare attraverso i "sogni". Potrebbe ricordare i concetti di Dixit in alcuni punti.
Legends of Andor https://boardgamegeek.com/boardgame/127398/legends-andor 7.3 Sì https://www.youtube.com/watch?v=xXm2xlsKoSc 35.90 Amazon Gioco con