Skip to content

Instantly share code, notes, and snippets.

View nwf's full-sized avatar

Nathaniel Wesley Filardo nwf

View GitHub Profile
@nwf
nwf / DKCC.hs
Created September 20, 2012 17:46
Haskell closed classes using DataKinds
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
-- Needed only for example below
-- {-# LANGUAGE UndecidableInstances #-}
data T1 = T1A | T1B
/*
* Bring up enough of ZFS to write an integer into a ZAP object on a
* synthetic pool, or read said integer back. That has to be really simple,
* right?
*
* Based on ZFS cmd/ztest/ztest.c; this file is redistributable as per CDDL.
*
* (C) 2016 Nathaniel Wesley Filardo.
*/
@nwf
nwf / build.sh
Last active May 22, 2020 14:39
CheriOS build goo
#!/usr/bin/zsh
set -e -u -x
export CCACHE_DIR=/cheri/cache/ccache
C=/cheri
S=${C}/source/cherios
B=${C}/build/cherios
O=${C}/out/cherios
@nwf
nwf / sphinx_toctreeish.py
Created July 15, 2020 23:04
Sphinx Toctree workaround
import re
from typing import List
from docutils import nodes
from docutils.nodes import Node
from docutils.statemachine import StringList, ViewList
import sphinx
from sphinx import addnodes
from sphinx.directives.other import TocTree
###############################
Exceptional-Sequence Text Pages
###############################
Introduction
============
Occasionally, software wants to impose interesting out-of-band
constraints on small, "exceptional" sequences of instructions. Examples
of such constraints include needing to run...