Skip to content

Instantly share code, notes, and snippets.

View higherorderfunctor's full-sized avatar

Christopher Aubut higherorderfunctor

View GitHub Profile
@higherorderfunctor
higherorderfunctor / rpi_unifi.md
Created November 13, 2021 01:52 — forked from kburdett/rpi_unifi.md
Install Ubiquiti's UniFi Controller on a Raspberry Pi

Compatibility

I currently run Ubiquiti's UniFi Controller on a Raspberry Pi 3B without issue. I have tried with a Raspberry Pi 1B, but the application crashes on startup. I assume it is due to a lack of RAM. Presumably, it would run on a Raspberry Pi 2B as well (same amount of RAM), but I have not tested it on this model. YMMV.

Instructions

  1. Install Raspbian on a SD card. I tested this with Jessie Lite (headless)

  2. Use raspi-config to expand the filesystem, rename your PI, etc

Keybase proof

I hereby claim:

  • I am higherorderfunctor on github.
  • I am chrisaubut (https://keybase.io/chrisaubut) on keybase.
  • I have a public key ASDh-nkceWVEiUEKqKV9QFBLc9cW7-7oYA02mz-p6igtAAo

To claim this, I am signing this object:

@higherorderfunctor
higherorderfunctor / parsec.py
Last active November 1, 2020 04:46
Port of Stephen Diehl's nanoparsec in Typed Python
"""
Port of nanoparsec in typed python from https://github.com/sdiehl/write-you-a-haskell/blob/master/chapter3/parsec.hs.
pip install attrs mypy
"""
from typing import Callable, Sequence, Text, Tuple, TypeVar
import attr
T = TypeVar('T') # pylint: disable=invalid-name
H = TypeVar( # pylint: disable=invalid-name
'H', bound='BaseTimestampedHistoryModel'
)
class Lift:
# pylint: disable=too-few-public-methods
"""Lifts generics to a type with __getitem__."""
def __class_getitem__(cls, item: T) -> T:
data EitherOr a b =
Hello a
| Goodbye b
instance (Eq a, Eq b) => Eq (EitherOr a b) where
(==) (Hello a) (Hello a') =
a == a'
(==) (Goodbye b) (Goodbye b') =
b == b'
(==) _ _ = False