Skip to content

Instantly share code, notes, and snippets.

@sol
sol / gist:6790274
Created October 2, 2013 07:42
Disable `shift-mask-q` for XMonad.
removeQuitShortcut :: XConfig a -> XConfig a
removeQuitShortcut c = c {keys = Map.delete (modMask c .|. shiftMask, xK_q) . keys c}
@sol
sol / gist:1807031
Created February 12, 2012 07:17 — forked from mklinik/gist:1803869
{-# LANGUAGE ScopedTypeVariables #-}
import qualified Random
randomEnum :: forall a. (Enum a, Bounded a) => IO a
randomEnum = do
let minBoundInt = fromEnum (minBound :: a)
let maxBoundInt = fromEnum (maxBound :: a)
randomInt <- Random.randomRIO (minBoundInt, maxBoundInt)
return $ toEnum randomInt