Skip to content

Instantly share code, notes, and snippets.

@ajrouvoet
ajrouvoet / fp-elitism.txt
Last active August 29, 2015 14:24
How to become an elite functional programmer.
level 1. Join #scala and explain you want to accomplish X, let #scala remind you that everything you
have done in life is wrong and you should feel bad
level 2. Retreat, read some FP resources and repeat from 1 until you feel you "get monads"
level 3. Join #scala, try to help someone else; get reminded that monads are not just container things.
Repeat from 2 until you see the error of your ways.
level 4. Join #scala, tell people who are trying to help others that they are wrong;
then while trying to make things right,
get reminded that everything you say can and will be disputed by level 5 people and up.
level 5. Dispute anything anyone says about monads, even if it takes bending the intended meaning of their words a little
level 6. Dispute anything anyone says. REMEMBER: nothing you say needs to be constructive: you are now on the top of the chain.
@ajrouvoet
ajrouvoet / insults.txt
Created July 7, 2015 10:18
FP insults
1. If you were typed, you'd fail statically.
@ajrouvoet
ajrouvoet / gist:49d5a00c9f34b82ded6e
Last active September 23, 2015 11:10
Million dollar ideas
1. Explosions-in-the-background-as-a-services (EIBAAS)
2. Describe windows semantics in the partiality and failure monad
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
def create_lichtingen(apps, schema_editor):
Profiel = apps.get_model("base", "Profiel")
Lichting = apps.get_model("base", "Lichting")
migration_user = Profiel.objects.get(uid="9999")
@ajrouvoet
ajrouvoet / q1.hs
Created September 3, 2015 10:34
Q1 Devv Challenge
import Data.Char
main :: IO ()
main = do
putStrLn $ show . length $ filter reversible [0..100000000]
where
reversible n = (srn !! 0 /= '0') && all (\x -> (digitToInt x) `mod` 2 == 1 ) (show (n + read srn))
where
srn = reverse (show n)
import XMonad
import XMonad.Util.EZConfig
import XMonad.Hooks.EwmhDesktops hiding (fullscreenEventHook)
import XMonad.Layout.NoBorders
import XMonad.Layout.MultiToggle
import XMonad.Layout.MultiToggle.Instances
import XMonad.Layout.Spacing
import XMonad.Layout.Fullscreen
import XMonad.Layout.Grid