Parts:
- SparkFun Humidity Sensor Breakout - SHTC3 (Qwiic)
- SparkFun Qwiic pHAT v2.0 for Raspberry Pi
- Raspberry Pi 3 B+
Reference Material:
- SHTC3_Datasheet
- smbus2 Python library
#!/bin/sh | |
# Seems to only support RSA keys... | |
ykman piv export-certificate 9a public-cert.pem | |
openssl x509 -in public-cert.pem -noout -pubkey > public-key.pem | |
ssh-keygen -i -m pkcs8 -f ./public-key.pem > id_yubi_9a.pub |
Parts:
Reference Material:
'use strict' | |
/* | |
* Adapted from: https://github.com/rpsirois/icosindexer | |
* Who aadapted it from: Lee, Michael and Samet, Hanan. (April 2000). | |
* Navigating through Triangle Meshes Implemented as Linear Quadtrees. | |
* ACM Transactions on Graphics, Vol. 19, No. 2. | |
* Retrieved from https://pdfs.semanticscholar.org/a5c8/8b53174405e5ff512ff5ffa8a56df3c8e2df.pdf | |
* | |
* Authors: | |
* - [Robert Sirois](https://github.com/rpsirois) |
// See https://web.dev/text-fragments/ | |
// location.hash = searchFragment('text to find in page') | |
export const searchFragment = txt => `#:~:text=${encodeURI(txt)}` |
## docker stack deploy -c docker-stackfile.yml gist_demo | |
version: "3.8" | |
services: | |
playground: | |
image: node:alpine | |
hostname: '{{.Task.Name}}' | |
environment: | |
SWARM_TASK: '{{.Task.Name}}' | |
SWARM_PEERS: "tasks.{{.Service.Name}}" |
/* from Kevin Powell's [3 useful CSS tricks](https://www.youtube.com/watch?v=HOM47v73yG8) | |
* for <div class=box></div> | |
* useful for iframes, videos, pictures, etc. | |
*/ | |
.box { | |
width: 25rem; | |
aspect-ratio: 1 / 1; | |
position: fixed; | |
inset: 0rem; /* sets top/bottom/left/right to same value */ |
import {networkInterfaces} from 'os' | |
import {isIP, BlockList} from 'net' | |
export function * iter_subnet_matches(ip_query) { | |
let family = isIP(ip_query) | |
let ipv = 'ipv'+family | |
for (let [if_name, if_addrs] of Object.entries(networkInterfaces())) { | |
for (let each of if_addrs) { | |
if (family != each.family) |
async function blobAsDataURL(blob) { | |
let rdr = new FileReader() | |
await new Promise((onload, onerror) => { | |
rdr.onload = onload | |
rdr.onerror = onerror | |
rdr.readAsDataURL(blob) }) | |
return rdr.result | |
} |
export function parse_html(raw_html_string) { | |
return new DOMParser() | |
.parseFromString(raw_html_string, 'text/html') } | |
export function dom_to_html_blob(dom) { | |
let html_doc = new XMLSerializer() | |
.serializeToString(dom) | |
return new Blob([html_doc], {type: 'text/html'}) } | |
export function dom_to_html_blob_url(dom) { |
class CBORDecoderBase { | |
// Possible monkeypatch apis responsibilities: | |
// decode() :: | |
// *iter_decode() :: | |
// async decode_stream() :: | |
// async * aiter_decode_stream() :: | |
static options(options) { | |
return (class extends this {}) | |
.compile(options)} |