Cowboy, the popular Erlang web server, has deprecated middleware and replaced the concept with stream handlers, a more flexible, but more complicated API. This page contains a documented reference implementation of a stream handler, to help others when developing their stream handlers in the future.
#!/usr/bin/env -S rust-script -t nightly | |
#![feature(unix_sigpipe)] | |
use std::cmp::max; | |
const BASIC_COLORS: &[&str] = &[ | |
"black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", | |
]; | |
fn title(t: &str) { |
- Building OTP 24.0 requires autoconf 2.69, and a tweak to disable kerl
_flags()
- Homebrew stock wxmac does not support macOS Dark Mode
f(). | |
Str = fun(X) -> io_lib:format("~p", [X]) end. | |
Percent = fun | |
(A, 0) -> "100%"; | |
(A, B) -> [Str(round(100*A/B)), "%"] | |
end. | |
Get = fun |
(NB: adapted from this Ask Ubuntu thread -- tested to work on Ubuntu 16.04 LTS through Ubuntu 22.04 LTS (Jammy).
Unlike using VMWare Tools to enable Linux guest capabilities, the open-vm-tools
package doesn't auto-mount shared VMWare folders. This can be frustrating in various ways, but there's an easy fix.
Install open-vm-tools
and run:
sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x
The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/