Skip to content

Instantly share code, notes, and snippets.

@juan-medina
juan-medina / ContactsAgendaTests.kt
Created December 1, 2019 11:52
kotlin-contacts-agenda
import com.natpryce.hamkrest.assertion.assertThat
import com.natpryce.hamkrest.equalTo
import org.junit.jupiter.api.Test
import java.io.File
// Implement a Phone Directory
//
// Given a list of contacts which exist in a phone directory. The task is to implement search query for the phone directory.
// The search query on a string ‘str’ displays all the contacts which prefix as ‘str’.
<Bindings>
<Binding name="NAMECOPY" header="NAMECOPY" category="ADDONS">
NAME_COPY_ITEM()
</Binding>
</Bindings>
package org.jab.microservices.wintergames1;
import lombok.extern.slf4j.Slf4j;
import org.jab.microservices.wintergames1.model.InfoResponse;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.ClientResponse;
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.server.ServerRequest;
{
type : "batch",
data : [
{
url : "/customer/1",
method : "patch",
customer : {
name : "pepe",
},
},
## Interface: 80000
## Title: SukariIslandsExpeditions
code.lua
package org.learning.by.example.reactive.kotlin.microservices.KotlinReactiveMS
import org.junit.jupiter.api.Test
import reactor.core.publisher.Mono
import reactor.core.publisher.toMono
class MonoErrorTest {
companion object{
const val foo = "foo"
@juan-medina
juan-medina / GeoLocationServiceImpl.java
Last active May 27, 2017 07:40
GeoLocationServiceImpl Kotlin Vs Java
package org.learning.by.example.reactive.microservices.services;
import org.learning.by.example.reactive.microservices.exceptions.GetGeoLocationException;
import org.learning.by.example.reactive.microservices.exceptions.GeoLocationNotFoundException;
import org.learning.by.example.reactive.microservices.exceptions.InvalidParametersException;
import org.learning.by.example.reactive.microservices.model.GeographicCoordinates;
import org.learning.by.example.reactive.microservices.model.GeoLocationResponse;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
@juan-medina
juan-medina / WhyFunctionalTest.java
Last active June 12, 2017 09:32
WhyFunctional Kotlin VS Java
package org.learning.by.example;
import org.junit.Test;
import java.util.Random;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import static org.learning.by.example.TestSuite5.Wrapper.From;
@juan-medina
juan-medina / PipesTest.java
Last active May 11, 2017 14:27
Piping all the things
package org.learning.by.example;
import org.junit.Test;
import java.util.Random;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import static org.learning.by.example.PipesTest.Wrapper.ToPipe;
$ python
>>> import multiprocessing
>>> multiprocessing.cpu_count()
12