Skip to content

Instantly share code, notes, and snippets.

@umit
umit / reduction.scala
Last active August 29, 2015 14:27 — forked from hanbzu/reduction.scala
Scala: Reduction, foldLeft, reduceLeft, foldRight, reduceRight, concatenation example
// Reduction: We can sum all the elements
// with the usual recursive schema
def sum(xs: List[Int]): Int = xs match {
case Nil => 0
case y :: ys => y + sum(ys)
}
// But this can be abstracted out using 'reduceLeft'
// That will perform these operations LINKING to the left
def sum(xs: List[Int]) = (0 :: xs) reduceLeft ((x, y) = x + y)
@umit
umit / JpaRepositoriesConfig.java
Created October 29, 2015 18:38 — forked from mismatch/JpaRepositoriesConfig.java
Spring Boot. Multiple DB repositories configuration example
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan.Filter;
@umit
umit / a:Install Kafka in CentOS
Created November 20, 2015 12:07 — forked from tmusabbir/a:Install Kafka in CentOS
Install Kafka in CentOS
Install Kafka in CentOS
@umit
umit / kafka.md
Created November 26, 2015 15:09 — forked from mathyourlife/kafka.md
kafka notes

Apache Kafka

"A high-throughput distributed messaging system." site

Notes taken from source

Overview

  • Created at LinkedIn (open sourced in 2011)
@umit
umit / 1) Install
Created January 12, 2016 08:31 — forked from nghuuphuoc/1) Install
Install Redis on Centos 6
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
@umit
umit / PageableCollection.java
Created January 19, 2016 07:56 — forked from josericardo/PageableCollection.java
Helper to iterate over pageable sources. Should reduce memory usage when querying large tables via Spring Data.
======================================
Usage:
Fetcher<Source, MyEntity> f = new Fetcher<Source, MyEntity>(source) {
@Override
public List<MyEntity> fetch(Pageable pageRequest)
{
return source.findAll(pageRequest);
}
};
@umit
umit / sam_streams.scala
Created January 7, 2017 16:12 — forked from adriaanm/sam_streams.scala
Playing with Java 8 Stream from Scala 2.11.5
// $ scala-2.11.5 -Xexperimental
// Original Java 8 version: http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples/
scala> import java.util.{Arrays, List, ArrayList}
scala> import java.util.stream.{Stream, IntStream}
// List<String> myList = Arrays.asList("a1", "a2", "b1", "c2", "c1");
scala> val myList = Arrays.asList("a1", "a2", "b1", "c2", "c1")
@umit
umit / README.md
Created January 10, 2017 17:49 — forked from serhatcan/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

@umit
umit / README.md
Created January 10, 2017 17:49 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index: