Skip to content

Instantly share code, notes, and snippets.

@maurer
maurer / gist:1225517
Created September 18, 2011 20:35
Proper contents of directory before being eaten
maurer@caladbolg ~/CMU/411/lab1/haskell/bin $ ls -gh
total 0
lrwxrwxrwx 1 maurer 21 Aug 12 15:44 c0c -> ../dist/build/c0c/c0c
lrwxrwxrwx 1 maurer 3 Aug 12 15:45 l1c -> c0c
lrwxrwxrwx 1 maurer 3 Aug 12 15:45 l2c -> c0c
lrwxrwxrwx 1 maurer 3 Aug 12 15:45 l3c -> c0c
lrwxrwxrwx 1 maurer 3 Aug 12 15:45 l4c -> c0c
lrwxrwxrwx 1 maurer 3 Aug 12 15:45 l5c -> c0c
@maurer
maurer / simics_crash.log
Created October 15, 2011 00:57
Simics Goes Boom!
running> *** ASSERTION ERROR:
in /disk2/mp-local/simics-4.0/src/cpu/x86/p2_processor_class.c:2352
Simics core: 2590 Tue Dec 22 18:05:09 2009
Module: 2589 Wed Dec 16 18:05:13 2009
Please report this.
Simics will now self-signal an abort.
Abort (SIGABRT) in main thread
#0 0x00007f3d55e04a45 in gsignal + 0x35 (/lib64/libc.so.6 + 0x32a45)
#1 0x00007f3d55e4e6a0 in __default_morecore + 0x0 (/lib64/libc.so.6 + 0x7c6a0)
#2 0x00007f3d5615d8e3 in _IO_2_1_stderr_ + 0x83 (/lib64/libc.so.6 + 0x38b8e3)
@maurer
maurer / isr.bash
Created October 26, 2011 15:41
isr.bash excerpt
echo isrs: # Handle to table
for n in `seq 0 255` # For each possible IRQ
do
echo .long isr_$n # emit a function pointer
done
@maurer
maurer / Modules.lhs
Created April 5, 2012 18:03
Embedding first class modules in Haskell
>{-# LANGUAGE TypeFamilies, ScopedTypeVariables #-}
>module Modules where
Since all modules under this translation must ascribe to some signature,
we by providing a signature for a module which provides equality over
some type.
>class EQ mod where
> type EQV mod :: *
> eq :: mod -> EQV mod -> EQV mod -> Bool
@maurer
maurer / test.olf
Created April 10, 2012 18:50
Example of problematic parse in ollibot
{-
This works.
-}
{-
This doesn't: let x = y in z
-}
@maurer
maurer / test.olf
Created April 10, 2012 18:50
Example of problematic parse in ollibot
{-
This works.
-}
{-
This doesn't: let x = y in z
-}

Keybase proof

I hereby claim:

  • I am maurer on github.
  • I am maurer (https://keybase.io/maurer) on keybase.
  • I have a public key whose fingerprint is 4FC8 8C78 6C61 B05B EEE8 3E32 AF15 E48C B1E3 A490

To claim this, I am signing this object:

@maurer
maurer / cfg.mli
Created October 16, 2014 18:23
Sample MLI
open Core_kernel.Std
open Bap_types.Std
module type S = sig
type t
type node
val pred : t -> node -> node list
val succ : t -> node -> node list
val code : t -> node -> Bil.stmt list
val asm : t -> node -> string list
@maurer
maurer / gist:023dcbd47b1c0fa7f81f
Created October 24, 2014 01:22
distill.hamlet
<div id="jotSelector" class="col-xs-2">
<div id="jotButtons" class="btn-group-vertical center-block">
$forall (jotId, desc) <- jotButtons
<button type="button" class="btn btn-default" onclick=displayJot(#{show jotId})>
#{desc}
<div id="jotViewer" class="col-xs-5">
<div id="jotAction" class="col-xs-5">
@maurer
maurer / ocamlgraph_bug.ml
Last active August 29, 2015 14:17
OCamlGraph Inconsistency
open Core_kernel.Std
(* Make a persistent graph where:
A -> B
B -> C
C -> B *)
module G = Graph.Persistent.Digraph.ConcreteBidirectional(String)
let g = List.fold [("A", "B"); ("B", "C"); ("C", "B")] ~f:(fun g (x, y) ->
G.add_edge g x y) ~init:G.empty;;