Skip to content

Instantly share code, notes, and snippets.

@weird-ego
weird-ego / fn-match.lisp
Created August 24, 2020 14:14
CL implementation of fn with dispatch against arguments definition pattern. Inspired by @andreyorst.
(defun any-of (l)
(and (not (null l))
(or (car l)
(any-of (cdr l)))))
(defun init (l)
(if (or (= (length l) 1) (null l))
nil
(cons (car l) (init (cdr l)))))
@weird-ego
weird-ego / Dockerfile
Created August 16, 2020 16:06
QMAAS (quick math as a service) strikes again
FROM snakepacker/python:all as builder
RUN python3.8 -m venv /usr/share/python3/app
RUN /usr/share/python3/app/bin/pip install -U pip redis falcon gunicorn requests
RUN find-libdeps /usr/share/python3/app > /usr/share/python3/app/pkgdeps.txt
FROM snakepacker/python:3.8
COPY --from=builder /usr/share/python3/app /usr/share/python3/app
RUN cat /usr/share/python3/app/pkgdeps.txt | xargs apt-install
RUN ln -snf /usr/share/python3/app/bin/gunicorn /usr/bin/
RUN mkdir /app && echo 'import redis; import falcon; import requests as rq \n\
@weird-ego
weird-ego / Dockerfile
Last active July 30, 2020 14:13
behold GLORIOUS emergence of QMAAS (quick math as a service)
FROM ubuntu:bionic
RUN apt-get -y update \
&& apt-get install -y curl \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash \
&& apt-get install -y nodejs
RUN npm install -g express-generator \
&& express isoddeven \
&& cd isoddeven/ \