Skip to content

Instantly share code, notes, and snippets.

View avyfain's full-sized avatar

Avy Faingezicht avyfain

View GitHub Profile
#!/usr/bin/env python3
"""Generate 1-dimensional automata based on various rules"""
def ngrams(iterable, n=1):
"""Generate ngrams from an iterable"""
return zip(*(iterable[i:] for i in range(n)))
def states(state, rule, left_pad='0', right_pad='0'):
"""Generate a stream of states from an initial state and a rule"""
next_state = ''.join(rule[''.join(window)] for window in ngrams(state, 3))
@coolaj86
coolaj86 / github-pages-https-lets-encrypt.md
Last active November 16, 2021 22:36
Github Pages: Let's Encrypt!