Skip to content

Instantly share code, notes, and snippets.

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

Gabriel Ciuloaica devsprint

🏠
Working from home
View GitHub Profile

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
@cb372
cb372 / jargon.md
Last active May 14, 2024 03:45
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@gsilvestrin
gsilvestrin / maven + scala + cassandra
Created October 3, 2013 18:28
Example of pom.xml that compiles scala / cassandra projects
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>cassandra</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
@ashrithr
ashrithr / kafka.md
Last active March 14, 2024 21:16
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@piscis
piscis / Find all versions of a formula
Last active December 15, 2015 12:49
Find all available versions of a homebrew formula and resove "fatal: '/usr/local/Library/Formula/XXX.rb' is outside repository" error
# Allways a good idea to sync with the formular repository first
alex$ brew update
# List available version
alex$ brew versions zmq
3.2.2 git checkout ab8de4b /usr/local/Library/Formula/zeromq.rb
2.2.0 git checkout 6a2e6ef /usr/local/Library/Formula/zeromq.rb
2.1.11 git checkout 497b13a /usr/local/Library/Formula/zeromq.rb
2.1.10 git checkout 4c8ed3a /usr/local/Library/Formula/zeromq.rb
2.1.9 git checkout 381c97f /usr/local/Library/Formula/zeromq.rb
@obscurerichard
obscurerichard / README.md
Created September 17, 2012 22:35
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.

@groundwater
groundwater / Application.scala
Created August 24, 2012 20:46
Action that parses protocol buffers
object Put extends Controller {
def index = DecodeProtobuf(classOf[MyProtobuf]) { stack :MyProtobuf =>
Action {
// do something with stack
}
}
}
@tomkersten
tomkersten / somehost.conf
Created October 28, 2011 20:36
Nginx config with CORS headers added globally (for application w/ Basic Auth)
upstream your-app {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
server unix:/tmp/your_app.socket fail_timeout=0;
}
server {
listen 80;