Skip to content

Instantly share code, notes, and snippets.

View matteosb's full-sized avatar

Matteo Banerjee matteosb

View GitHub Profile
@matteosb
matteosb / church.kt
Created December 23, 2018 17:00
Church numerals Kotlin
/**
* Definition of Church numerals
*
* See: https://en.wikipedia.org/wiki/Church_encoding#Church_numerals
*/
typealias Church<T> = ((T) -> T) -> ((T) -> T)
fun <T> zero(f: (T) -> T): (T) -> T = { x -> x }
fun <T> succ(n: Church<T>): Church<T> = { f -> { x -> f(n(f)(x)) } }
fun <T> mult(n: Church<T>, m: Church<T>): Church<T> = { x -> m(n(x)) }
sudo dnf update
sudo dnf install git emacs-nox tilix chromium arc-theme gnome-tweak-tool htop zsh \
gnome-shell-extension-no-topleft-hot-corner gnome-shell-extension-drive-menu \
gnome-shell-extension-topicons-plus go java-openjdk-1.8.0 nodejs
sudo dnf copr enable numix/numix
sudo dnf install numix-icon-theme-circle
sudo lchsh matteo
# install oh-my-zsh: https://github.com/robbyrussell/oh-my-zsh
# install spotify with flatpak
flatpak install --from https://s3.amazonaws.com/alexlarsson/spotify-repo/spotify.flatpakref
import com.google.inject.AbstractModule;
import com.typesafe.config.Config;
import static com.google.inject.name.Names.named;
/**
* Abstract guice module with convenience methods for binding values to the same key that they have in typesafe config.
*/
public abstract class TypesafeConfigGuiceModule extends AbstractModule {
@matteosb
matteosb / pom.xml
Last active June 16, 2018 14:11
Maven Build for a Scala Application
<?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>replace-me</groupId>
<artifactId>sample</artifactId>
<version>1.0-SNAPSHOT</version>