Skip to content

Instantly share code, notes, and snippets.

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
@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)
# -*- 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 / 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
@ajrouvoet
ajrouvoet / insults.txt
Created July 7, 2015 10:18
FP insults
1. If you were typed, you'd fail statically.
@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.
_∉_ : ∀ {n m} {A : Set n} → A → Vec A m → Set n
a ∉ v = ¬ (a ∈ v)
postulate take' : ∀ {n m} {A : Set n} → (i : Fin m) → Vec A m → Vec A (toℕ i)
-- take' i v = ?
postulate indexof : ∀ {n m a} {A : Set n}
→ (v : Vec A m) → (p : A → Set)
→ Dec (∃ λ i → p (lookup i v) × a ∉ (take' i v))
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.autohint: true
Xft.hintstyle: hintfull
src/kernel.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <kernel_main>:
0: e3a0083f mov r0, #4128768 ; 0x3f0000
4: e59f2040 ldr r2, [pc, #64] ; 4c <__delay_22+0xc>
8: e592c000 ldr ip, [r2]
@ajrouvoet
ajrouvoet / gist:55e1750a01e991443cb6
Created February 10, 2015 15:51
Should be simple
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#define GPIO_BASE 0x20200000
extern void halt();
volatile unsigned int* gpio_fs4 = (unsigned int*)(GPIO_BASE+0x10);
volatile unsigned int* gpio_set_1 = (unsigned int*)(GPIO_BASE+0x20);