Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ashabhasa on github.
  • I am ashabhasa (https://keybase.io/ashabhasa) on keybase.
  • I have a public key whose fingerprint is CBE9 AE23 8A50 C16F 51F3 CA5E 4634 DC07 5883 B280

To claim this, I am signing this object:

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@ashabhasa
ashabhasa / fpmax.scala
Created July 15, 2018 08:58 — forked from jdegoes/fpmax.scala
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
@ashabhasa
ashabhasa / init.sh
Last active December 17, 2021 15:02
Script creates rabbitmq users/vhosts.
#!/bin/sh
# The script was first published here http://mpas.github.io/blog/2015/06/11/setting-up-docker-rabbitmq-with-predefined-users/vhosts/
# Create Default RabbitMQ setup
( sleep 10 ; \
# Create users
# rabbitmqctl add_user <username> <password>
rabbitmqctl add_user test_user test_user ; \
rabbitmqctl add_user guest guest ; \
@ashabhasa
ashabhasa / Dockerfile
Last active June 4, 2018 14:26
Create rabbitmq image that also creates users and vhosts
FROM rabbitmq:3-management
# The script was first published here http://mpas.github.io/blog/2015/06/11/setting-up-docker-rabbitmq-with-predefined-users/vhosts/
# Add script to create default users / vhosts
ADD init.sh /init.sh
# Set correct executable permissions
RUN chmod +x /init.sh
# Define default command
CMD ["/init.sh"]
@ashabhasa
ashabhasa / Vagrant
Created July 19, 2016 07:27
Vagrant file for rabbitmq and mongo
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.box_check_update = false
config.vm.hostname = "mobydick"
config.vm.network "forwarded_port", guest: 15672, host: 15672
config.vm.network :forwarded_port, guest: 4369, host: 4369
config.vm.network :forwarded_port, guest: 5672, host: 5672
@ashabhasa
ashabhasa / introrx.md
Created March 22, 2016 11:01 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing