Skip to content

Instantly share code, notes, and snippets.

@mmn80
mmn80 / CPP.idr
Created April 22, 2017 15:17
Export control
module CPP
import System
%language ElabReflection
%language TypeProviders
export
testFn : Int -> String
testFn x = "testFn: " ++ show x
@mmn80
mmn80 / Record.idr
Last active October 26, 2017 22:06
Extensible record syntax
module Record
%default total
%language ElabReflection
Name : Type
Name = String
data Field : Name -> Type where
Fld : (n : Name) -> Field n

Keybase proof

I hereby claim:

  • I am mmn80 on github.
  • I am mmn80 (https://keybase.io/mmn80) on keybase.
  • I have a public key ASC5tlFZ4oByh769CNr1zkeE5zsqtPNBAv9Pow4V2s-ykAo

To claim this, I am signing this object:

@mmn80
mmn80 / detect_kbd_devices.c
Created December 19, 2012 14:43 — forked from anonymous/detect_kbd_devices.c
Uses libudev to detect all keyboard input event devices (/dev/input/eventX). Based on the /usr/lib/udev/findkeyboards script.
#include <libudev.h>
#define MAX_KBD_DEVICES 10
const char** detect_kbd_devices()
{
const char **devnodes = calloc(MAX_KBD_DEVICES, sizeof(char*));
struct udev *udev;
struct udev_enumerate *enumerate;
struct udev_list_entry *devices, *dev_list_entry;
struct udev_device *dev;