Skip to content

Instantly share code, notes, and snippets.

View pheymann's full-sized avatar

Paul Heymann pheymann

View GitHub Profile
// based on https://github.com/pheymann/investment-library
// to execute follow: https://github.com/pheymann/investment-library#how-to-install-and-use-it-with-a-docker-based-setup
/* Result: 50,000 EUR capital and 40 years runtime (ignoring dividends for now)
* - lump sum investment at the beginning leads to: 274383.125EUR
* - continues investment over 40 years leads to: 130788.584EUR
* - spread investment over the first 5 years leads to: 250692.769EUR
*
* Assumption: flat 25% capital gains tax.
*/
import scala.io.Source
import scala.concurrent.{Await, ExecutionContext, Future}
import scala.concurrent.duration._
import scala.collection.immutable.BitSet
import scala.util.Random
object Main {
sealed trait Ingredient
case object Mushroom extends Ingredient
@pheymann
pheymann / init.el
Last active July 10, 2019 07:58
emacs settings
(require 'package)
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade.ferrier.me.uk/packages/"))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
@pheymann
pheymann / GenericCaseClassDiff.scala
Last active June 12, 2020 22:21
Generic `case class` instance diff's (aka. comparing instance fields and output differences)
import shapeless._
import shapeless.labelled.FieldType
import shapeless.record._
trait GenericDiff[H <: HList] {
// syntactic sugar
type HI = H
// compares field values and returns the field name with values if they differ
@pheymann
pheymann / .travis.yml
Created July 8, 2017 18:48
Run Idris tests in Travis
language: generic
os: linux
sudo: required
services:
- docker
script: