Skip to content

Instantly share code, notes, and snippets.

View PiDelport's full-sized avatar
💜
𝝺 🦀️ 🐍️ ☕️ 🏳️‍🌈️ 🏳️‍⚧️

Pi Delport PiDelport

💜
𝝺 🦀️ 🐍️ ☕️ 🏳️‍🌈️ 🏳️‍⚧️
View GitHub Profile
@PiDelport
PiDelport / Chain.hs
Last active August 29, 2015 14:05 — forked from mrb/Chain.hs
Variation and feedback on Michael Bernstein's Markov chain implementation
module Chain where
import Control.Applicative
import Data.List (tails, unfoldr)
import System.Random (RandomGen, newStdGen, randomR)
import qualified Data.Map.Strict as M
import Data.Sequence as S (Seq, (><), (|>))
import qualified Data.Sequence as S
@PiDelport
PiDelport / templatelexer.py
Created August 8, 2012 20:29 — forked from eliben/templatelexer.py
Some takes on Eli Bendersky's implementation of Rob Pike's template lexer in Go.
from collections import namedtuple
TOK_TEXT = 'TOK_TEXT'
TOK_LEFT_META = 'TOK_LEFT_META'
TOK_RIGHT_META = 'TOK_RIGHT_META'
TOK_DUMMY = 'TOK_DUMMY'
# A token has