Skip to content

Instantly share code, notes, and snippets.


Michel Bøje Randahl Nielsen michelrandahl

  • Denmark
View GitHub Profile
martijnvermaat /
Last active Sep 10, 2022
Installation of NixOS with encrypted root
View monoid.cpp
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
// In Haskell, the Monoid typeclass is parameterised by only a type. Such a
// definition requires “newtype hacks” to produce different monoids on the same
// type. This definition is parameterised by both the type and the function, and
// as such can be used to define different monoids on the same type without any
// interference.
# Author: Todd Larason <>
# $XFree86: xc/programs/xterm/vttests/,v 1.2 2002/03/26 01:46:43 dickey Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {