Skip to content

Instantly share code, notes, and snippets.

michaelt michaelt

Block or report user

Report or block michaelt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@michaelt
michaelt / minecraft.hs
Created Dec 3, 2010
cabal install she + pragma + import Control.Applicative
View minecraft.hs
{-# OPTIONS_GHC -F -pgmF she #-}
module Minecraft
( ClientToServerPacket(..)
, ServerToClientPacket(..)
, MCInventoryItem
, MCInventoryUpdate
, MCBlockChange
, MCMultiBlockChange
, MCExplosionRecords
) where
@michaelt
michaelt / amity.hs
Created Dec 3, 2010 — forked from DylanLukes/amity.hs
with idiom brackets in minecraft.hs
View amity.hs
import System.IO
import Network
import Minecraft
import Control.Monad
import Control.Monad.Fix
import Control.Monad.Trans
import Control.Monad.BinaryProtocol
import Control.Concurrent
import Control.Concurrent.STM
import Control.Concurrent.STM.TChan
@michaelt
michaelt / latex.template
Created Jun 9, 2011
Simple Pandoc default.latex with comments
View latex.template
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
@michaelt
michaelt / latex.template
Created Jun 9, 2011
Simple Pandoc latex.template with comments
View latex.template
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% This ^^^ is a standard LaTeX document class declaration
% (the previous line is a pseudo-comment, declaring that we will
% use the special XeTeX machinery for its more extensive font list
% and its use of unicode.)
% If you made this line more akin to the one in the default
% latex.template file, say:
% \documentclass$if(fontsize)$[$fontsize$]$endif${scrartcl}
View a.bib
@article{nordstrom1993,
title={A prospective study},
author={Nordstr{\"o}m, M.},
journal={Journal of internal medicine},
volume={232},
number={2},
pages={155--160},
year={1992},
publisher={Wiley Online Library}
}
@michaelt
michaelt / default.scriptogram
Created Feb 23, 2012
pandoc + mathjax + scriptogr.am
View default.scriptogram
---
$if(date)$
Date: $date$
$endif$
$if(title)$
Title: $title$
$endif$
---
<div>
@michaelt
michaelt / pipe_conduit.hs
Created Mar 26, 2012
simplified Control.Pipe.Common following Twan van Laarhoven's pipe-conduit hybrid
View pipe_conduit.hs
-- http://www.reddit.com/r/haskell/comments/rbgvz/conduits_vs_pipes_using_void_as_an_input_or
import Control.Monad
import Control.Applicative
import Data.Void
import System.IO
data Pipe m i o r =
Finished (Maybe i) r
| PipeM (m (Pipe m i o r)) (m r)
@michaelt
michaelt / Jade.hs
Created May 6, 2012 — forked from scan/Jade.hs
Jade2.hs
View Jade.hs
{-#LANGUAGE OverloadedStrings#-}
module Jade where
import Text.Parsec
import qualified Text.Parsec.Token as L
import Text.Parsec.Language (emptyDef)
import Text.Parsec.Text (Parser)
import Data.Text (Text)
import Control.Monad (mzero)
import Control.Applicative ((<$>),(*>), (<*))
View gist:2632582
(☃) :: Int -> Int -> Int
x ☃ y = x + y
main = print $ 0 ☃ 1 ☃ 2
@michaelt
michaelt / RedBlackTree.hs
Created May 11, 2012 — forked from rampion/RedBlackTree.hs
red-black trees in haskell, using GADTs and Zippers (and DataKinds)
View RedBlackTree.hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DataKinds#-}
{-# LANGUAGE KindSignatures#-}
module RedBlackTree where
data Nat = Zero | Succ Nat deriving (Eq, Ord, Show)
type One = Succ Zero
You can’t perform that action at this time.