Skip to content

Instantly share code, notes, and snippets.

View m1dnight's full-sized avatar

Christophe De Troyer m1dnight

View GitHub Profile
@m1dnight
m1dnight / gen_server_tpl.ex
Last active March 2, 2018 09:53 — forked from ntrepid8/gen_server_tpl.ex
Elixir GenServer Template
defmodule Server do
@moduledoc """
A GenServer template for a "singleton" process.
"""
use GenServer
require Logger
def start_link(opts \\ []) do
Logger.debug "Started with opts: #{inspect opts}"
GenServer.start_link(__MODULE__, opts, [name: __MODULE__])
@m1dnight
m1dnight / anf.ex
Last active March 14, 2021 20:57
defmodule Anf do
@moduledoc
"""
Author: Christophe De Troyer
"""
require Logger
##############################################################################
# API #
##############################################################################

Keybase proof

I hereby claim:

  • I am m1dnight on github.
  • I am cdetroye (https://keybase.io/cdetroye) on keybase.
  • I have a public key ASA2VLzwVFkzPDY15qXgiytbsSqs3Xfa989HNwMePbOsuwo

To claim this, I am signing this object:

@m1dnight
m1dnight / Lexer.x
Created June 30, 2016 02:32
Monadic Parser and Lexer using Alex and Happy
{
module Lexer where
}
%wrapper "monadUserState"
$digit = 0-9 -- digits
$alpha = [a-zA-Z] -- alphabetic characters
-- Each token has a function on the RHS that is a function (String ->
@m1dnight
m1dnight / elixir.tex
Last active January 2, 2024 02:53
Elixir Listings Latex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{listings,xcolor}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage[scaled=0.9]{DejaVuSansMono}
\definecolor{commentgreen}{RGB}{2,112,10}
\definecolor{eminence}{RGB}{108,48,130}
\definecolor{weborange}{RGB}{255,165,0}
\definecolor{frenchplum}{RGB}{129,20,83}