This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' >>> '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
UPGRADE=0 | |
while getopts "uh" arg; do | |
case $arg in | |
u) | |
UPGRADE=1 | |
;; | |
h) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABCMeta, abstractmethod | |
from typing import Set | |
class Observer(metaclass=ABCMeta): | |
@abstractmethod | |
def notify(self, volume: int) -> None: | |
pass | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from abc import ABC, abstractmethod | |
from functools import lru_cache | |
from typing import List | |
cache = lru_cache() | |
class WorkDoer: |