Skip to content

Instantly share code, notes, and snippets.

View toderesa97's full-sized avatar
☺️
Open

Tomás Denis Reyes Sánchez toderesa97

☺️
Open
View GitHub Profile
@toderesa97
toderesa97 / add-topic.sh
Last active September 28, 2020 20:11
Apache Kafka pub/sub basic example in MSK
#!/bin/bash
./kafka_2.12-2.3.1/bin/kafka-topics.sh --create --topic foobar --bootstrap-server b-1.demo-cluster-1.8hn95l.c3.kafka.eu-west-1.amazonaws.com:9092 --partitions 4 --replication-factor 2
@toderesa97
toderesa97 / Problem.java
Created June 8, 2020 22:30
Coding Problem 4: Facebook problem
import java.util.Comparator;
import java.util.List;
public class Problem {
public static int productOfNumbers(List<Integer> numbers) {
Number result = numbers.stream()
.map(n -> new Number(Math.abs(n), n < 0))
.sorted(Comparator.reverseOrder())
.limit(3)