On the following Raspbian OS (/etc/os-release
):
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
FROM debian | |
RUN apt-get update && apt-get install -y git xz-utils python3 curl && rm -rf /var/lib/apt/lists/* | |
RUN git clone https://github.com/emscripten-core/emsdk.git && cd /emsdk && ./emsdk install latest-arm64-linux && ./emsdk activate latest-arm64-linux | |
ENTRYPOINT ["/emsdk/docker/entrypoint.sh"] |
[package] | |
name = "nomtest" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
nom = "7.1.3" | |
tempfile = "3.5.0" |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta | |
name="viewport" | |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" | |
/> | |
<title>reveal.js</title> |
; run `sandbox-exec -f limit.sb $program` | |
(version 1) | |
(debug deny) | |
(deny default) | |
(import "/System/Library/Sandbox/Profiles/bsd.sb") | |
(allow network-outbound) | |
(deny network-outbound (remote tcp "localhost:*")) | |
(allow process-fork) | |
(allow process-exec* | |
(subpath "/opt/homebrew/") |
TEMPDIR="$(mktemp -d)" | |
NR_WORDS=${1:-3} | |
cd "$TEMPDIR" | |
curl 'https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english.txt' | grep -E "^.{4,8}$" | sort | uniq > wordlist.txt | |
NR_LINES="$(wc -l wordlist.txt | grep -oe '\d\+')" | |
POSS="$(echo "$NR_LINES^$NR_WORDS" | bc)" | |
BITS="$(echo "l($POSS)/l(2)" | bc -l)" | |
CHARS="$(echo "l($POSS)/l(72)" | bc -l)" | |
printf 'We have %d lines; we willl take %d words; there are %.3e possibilities (%.1f bits of entropy, comparable to %.1f completely random chars (lower/upper/number/special))\n' "$NR_LINES" "$NR_WORDS" "$POSS" "$BITS" "$CHARS" | |
if [[ $NR_LINES -lt "4000" ]]; then |
// typescript versions of https://stackoverflow.com/a/56592365/1207489 | |
const pick = <T extends {}, K extends keyof T>(obj: T, ...keys: K[]) => ( | |
Object.fromEntries( | |
keys | |
.filter(key => key in obj) | |
.map(key => [key, obj[key]]) | |
) as Pick<T, K> | |
); | |
const inclusivePick = <T extends {}, K extends (string | number | symbol)>( |
import numpy as np | |
def rgb_to_hls(rgb_array: np.ndarray) -> np.ndarray: | |
""" | |
Expects an array of shape (X, 3), each row being RGB colours. | |
Returns an array of same size, each row being HLS colours. | |
Like `colorsys` python module, all values are between 0 and 1. | |
NOTE: like `colorsys`, this uses HLS rather than the more usual HSL | |
""" |
" This function will first check if no changes are staged in git. | |
" If so, it will save the current file, and then commit and push it. | |
" The whole function is mapped to <leader>sacp | |
" the function (when called manually) allows an argument that is the commit | |
" message | |
" Only use this for things where it makes sense to commit one file at a time | |
" (like a dev log). Else make proper commits. | |
function SaveAddCommitPushInfo(msg) abort |
scale([4, 4, 1]) { | |
translate([20, 20, 0]) {linear_extrude (height=1) {circle(26);}}; | |
color([0, 0, 0]) { | |
translate([0, 26, 0]) { linear_extrude (height=3){import("wifi.svg"); }; } | |
translate([2, 15, 1]) { linear_extrude (height=1){rotate(90){text("wifi", size=5); }}; } | |
translate([43, 12, 1]) { linear_extrude (height=1){rotate(90){text("hs3.pl", size=5); }}; } | |
translate([16, -2, 1]) { linear_extrude (height=1){text("QR", size=5); }; } | |
translate([28, 43, 1]) { linear_extrude (height=1){rotate(180)text("NFC", size=5);}; } | |
} | |
} |