Skip to content

Instantly share code, notes, and snippets.

TRUE = λx. λy. x
FALSE = λx. λy. y
NOT = λb. b FALSE TRUE
AND = λb1. λb2. b1 b2 FALSE
OR = λb1. λb2. b1 TRUE b2
XOR = λb1. λb2. b1 (b2 FALSE TRUE) b2

Concurrent calculation of Fibonacci in Elixir up to the 1200th position (faster than you can see)

It uses a known formla to evaluate a position instead of calculating it in a sequencial and/or recursive approach.
Formula

It's amazing how fast it is:
Demonstration

@fschuindt
fschuindt / collatz.ex
Created July 21, 2018 03:20
The Collatz conjecture.
defmodule Collatz do
def of(1), do: 1
def of(n) do
IO.puts n
do_of(n, rem(n, 2))
end
defp do_of(n, 0) do
FROM ubuntu:20.10
ARG NGINX_GIT=https://github.com/nginx/nginx.git
ARG NGINX_RTMP_GIT=https://github.com/arut/nginx-rtmp-module.git
ARG NGINX_RELEASE=release-1.19.6
ARG DEBIAN_FRONTEND=noninteractive
RUN apt -y update && \
apt install -y apt-utils && \
apt install -y --no-install-recommends build-essential make \
load_module /usr/lib/nginx/modules/ngx_stream_module.so;
worker_processes auto;
error_log /home/broadcaster/log/error.log warn;
pid /home/broadcaster/run/nginx.pid;
events {
worker_connections 768;
}

Remove Apple MDM

Note: Apple will store Wifi passwords on the T2 chip. SSD cleaning won't make it forget the password. You have to turn the network off, or change the password on the router.

Different Paths

Start from Path 1. If you get any messages about the MDM on the first usage, start all over from the Path 2.

Path 1

  • Get into recovery mode (Cmd + r) during start up.