(ert-deftest foo ()
(assert nil))
Now: M-x ert RET foo RET
Emacs makes discovery easier.
function cons(x, y) { | |
return function(w) { return w(x, y) }; | |
}; | |
function car(z) { | |
return z(function(x, y) { return x }); | |
}; | |
function cdr(z) { | |
return z(function(x, y) { return y }); |
function whatDoesItDo(val){ | |
return val ? 1 : 2; | |
} |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"strconv" | |
) |
#!/usr/bin/env bash | |
KUBEAPI=127.0.0.1:8001/api/v1/nodes | |
function getNodes() { | |
curl -s $KUBEAPI | jq -r '.items[].metadata.name' | |
} | |
function getPVCs() { | |
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\ |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
brew install multipass | |
multipass launch lts -c 6 -d 20G -m 8G -n docker | |
multipass set client.primary-name=docker | |
multipass mount /Volumes/path/to/repo docker | |
multipass shell | |
curl -sSL https://get.docker.com/ | sh | |
echo '{"features": {"buildkit": true}}' > /etc/docker/daemon.json | |
# or if you have a local k8s cluster (ala microk8s) |
# aproducer.py | |
# | |
# Async Producer-consumer problem. | |
# Challenge: How to implement the same functionality, but no threads. | |
import time | |
from collections import deque | |
import heapq | |
class Scheduler: |