Skip to content

Instantly share code, notes, and snippets.

View AravindaM's full-sized avatar
🏠
Working from home

Aravinda Liyanage AravindaM

🏠
Working from home
View GitHub Profile
@AravindaM
AravindaM / ParallelIterator.java
Last active December 8, 2017 08:08
Iterator to Prallel Stream
public static <T> Stream<T> stream(Iterable<T> in) {
return StreamSupport.stream(in.spliterator(), false);
}
public static <T> Stream<T> parallelStream(Iterable<T> in) {
return StreamSupport.stream(in.spliterator(), true);
}
@AravindaM
AravindaM / Extract unmatched Route
Created December 7, 2017 09:20
Akka http - Extract Route
return this.pathPrefix("", () ->
this.extractUnmatchedPath(remaining ->
this.complete("Unmatched: '" + remaining + "'")
)
);
@AravindaM
AravindaM / jmx-client.java
Created November 9, 2017 10:55
Sample JMX Client
import javax.management.*;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import java.io.IOException;
import java.util.List;
public class JmxClient {
public static final String HOST = "127.0.0.1";
@AravindaM
AravindaM / akka-http-server.java
Last active November 8, 2017 16:37
akka-http-server
import akka.NotUsed;
import akka.actor.ActorSystem;
import akka.http.javadsl.ConnectHttp;
import akka.http.javadsl.Http;
import akka.http.javadsl.ServerBinding;
import akka.http.javadsl.model.HttpRequest;
import akka.http.javadsl.model.HttpResponse;
import akka.stream.ActorMaterializer;
import akka.stream.javadsl.Flow;
# Inspired from http://blog.akquinet.de/2010/05/26/mastering-the-maven-command-line-%E2%80%93-reactor-options/
# Build only specific modules:
mvn clean install -pl sub-module-name2
mvn clean install -pl sub-module-name2,sub-module-name3
# Build only starting from specific sub-module (resume from)
mvn clean install -rf sub-module-name2
# Build dependencies (also make)
@AravindaM
AravindaM / akka-application.conf
Created October 5, 2017 05:07
Akka default application configuration.
####################################
# Akka Actor Reference Config File #
####################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.
# Akka version, checked against the runtime version of Akka. Loaded from generated conf file.
include "version"
@AravindaM
AravindaM / s3_ploicy_multipart.json
Created August 13, 2017 16:06
Multipart upload S3 Policy..
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt12345",
"Action": [
"s3:AbortMultipartUpload",
"s3:GetObject",
"s3:ListBucketMultipartUploads",
"s3:ListMultipartUploadParts",
layout title
page
Reactive Cheat Sheet

This cheat sheet originated from the forums. There are certainly a lot of things that can be improved! If you would like to contribute, you have two options:

Click the "Edit" button on this file on GitHub: https://github.com/sjuvekar/reactive-programming-scala/blob/master/ReactiveCheatSheet.md You can submit a pull request directly from there without checking out the git repository to your local machine.

layout title
page
Cheat Sheet

This cheat sheet originated from the forum, credits to Laurent Poulain. We copied it and changed or added a few things. There are certainly a lot of things that can be improved! If you would like to contribute, you have two options:

  • Click the "Edit" button on this file on GitHub:
@AravindaM
AravindaM / PrefixToPostFix.java
Last active September 23, 2018 03:41
Prefix to Postfix Conversion java version.
package hackrankCodalityTests;
import org.junit.Assert;
import org.junit.Test;
import java.util.Stack;
/**
* Created by Aravinda on 6/24/2017.
*/