Skip to content

Instantly share code, notes, and snippets.

View seppeljordan's full-sized avatar

Sebastian Jordan seppeljordan

View GitHub Profile
data RegEx a = Star (RegEx a)
| Conc (RegEx a) (RegEx a)
| Lit a
| WildCard
match :: (Eq a,Show a) => [a] -> RegEx a -> Bool
match [x] (Lit y) = x == y -- 'a' >>> 'a'
match _ (Lit _) = False -- 'aaa' >>> 'a'
match [x] WildCard = True -- 'a' >>> '.'
match _ WildCard = False -- 'aaaa' >>> '.'
@seppeljordan
seppeljordan / nixcon
Created July 5, 2017 18:03 — forked from garbas/nixcon
nixcon
- agenda/ideas for the nixcon talk
- brief introduction
- what is pypi
- how "awesome" python packaging is
- what problems we have when packing with nix
- how it works (differently then other 2nix tools)
- 3 stages
- stage1: using nix-shell
#!/usr/bin/env sh
UPGRADE=0
while getopts "uh" arg; do
case $arg in
u)
UPGRADE=1
;;
h)
#!/usr/bin/env sh
# goes into .git/hooks/pre-commit
# do not forget 'chmod +x .git/hooks/pre-commit'
set -e
. ./format_code.sh
if ! git diff --exit-code > /dev/null 2>&1; then
from abc import ABCMeta, abstractmethod
from typing import Set
class Observer(metaclass=ABCMeta):
@abstractmethod
def notify(self, volume: int) -> None:
pass
from __future__ import annotations
from abc import ABC, abstractmethod
from functools import lru_cache
from typing import List
cache = lru_cache()
class WorkDoer: