From 0cebee344a2ccf5559cbc60ae9a5300c054ca523 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 7 Nov 2024 08:55:51 -0800 Subject: [PATCH 001/147] photos: Devil's Slide posts --- .../devils-slide-coast2.jpg | 3 +++ .../photos/2024/devils-slide-north/index.md | 19 +++++++++++++++++++ .../2024/devils-slide/devils-slide-coast.jpg | 3 +++ content/photos/2024/devils-slide/index.md | 19 +++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 content/photos/2024/devils-slide-north/devils-slide-coast2.jpg create mode 100644 content/photos/2024/devils-slide-north/index.md create mode 100644 content/photos/2024/devils-slide/devils-slide-coast.jpg create mode 100644 content/photos/2024/devils-slide/index.md diff --git a/content/photos/2024/devils-slide-north/devils-slide-coast2.jpg b/content/photos/2024/devils-slide-north/devils-slide-coast2.jpg new file mode 100644 index 0000000..a82052f --- /dev/null +++ b/content/photos/2024/devils-slide-north/devils-slide-coast2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7634feb337dc6bd86c836fa5ef83bf7f11c37c9bbf026851d8c5619f58fc0a6c +size 8615065 diff --git a/content/photos/2024/devils-slide-north/index.md b/content/photos/2024/devils-slide-north/index.md new file mode 100644 index 0000000..09ca90d --- /dev/null +++ b/content/photos/2024/devils-slide-north/index.md @@ -0,0 +1,19 @@ +--- +title: Devil's Slide (North) +linkTitle: Devil's Slide +date: 2024-11-07T08:49:16-08:00 +categories: Me +tags: + - Outdoors + - Landscapes + - Ocean + - California + - California Coast +--- + +Earlier this year, {{< tess >}} and I went on a short hike in the [Devil's +Slide][dwp] area, along Highway 1. This photo is looking to the north along the +coast. I took [another photo][other] facing south. + +[dwp]: https://en.wikipedia.org/wiki/Devil%27s_Slide_(California) +[other]: {{< ref "photos/2024/devils-slide" >}} diff --git a/content/photos/2024/devils-slide/devils-slide-coast.jpg b/content/photos/2024/devils-slide/devils-slide-coast.jpg new file mode 100644 index 0000000..fec883f --- /dev/null +++ b/content/photos/2024/devils-slide/devils-slide-coast.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b5863a9d92d34714e661ee2f03c1c70467c1792d1dc0c5cadc31f64e8ac6956 +size 7547107 diff --git a/content/photos/2024/devils-slide/index.md b/content/photos/2024/devils-slide/index.md new file mode 100644 index 0000000..1456cc8 --- /dev/null +++ b/content/photos/2024/devils-slide/index.md @@ -0,0 +1,19 @@ +--- +title: Devil's Slide (South) +linkTitle: Devil's Slide +date: 2024-11-07T08:33:37-08:00 +categories: Me +tags: + - Outdoors + - Landscapes + - Ocean + - California + - California Coast +--- + +Earlier this year, {{< tess >}} and I went on a short hike in the [Devil's +Slide][dwp] area, along Highway 1. This photo is looking south along the coast. +I love the fog tucked into the coves. I took [another photo][other] facing north too. + +[dwp]: https://en.wikipedia.org/wiki/Devil%27s_Slide_(California) +[other]: {{< ref "photos/2024/devils-slide-north" >}} From f47c41a80dcf2d7c4d3670042947a0336d50ea6f Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 7 Nov 2024 08:57:57 -0800 Subject: [PATCH 002/147] photostream: Update submodule commit --- themes/photostream | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/photostream b/themes/photostream index 63eb00b..ff3b345 160000 --- a/themes/photostream +++ b/themes/photostream @@ -1 +1 @@ -Subproject commit 63eb00bf4a8007a0a2e6c877988874d28fa34f49 +Subproject commit ff3b345cb7c788c985b10657adf029e4227034ef From d87438bf6a9a9ab423e03ca170c049ac3f55c3f2 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 7 Nov 2024 08:58:21 -0800 Subject: [PATCH 003/147] Add a few characters to the list of ones to strip out of strings when slugifying a title --- scripts/new-photo-post | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/new-photo-post b/scripts/new-photo-post index 858565e..bc44567 100755 --- a/scripts/new-photo-post +++ b/scripts/new-photo-post @@ -19,7 +19,10 @@ from typing import Optional PHOTOS_CONTENT_DIR = 'content/photos' def slugify(s): - return re.sub(r'[‘’“”]', '', re.sub(r'\s+', '-', s.strip().lower())) + s = s.strip().lower() + s = re.sub(r'\s+', '-', s) + s = re.sub(r'[‘’“”"\'()]', '', s) + return s def parse_args(argv, *a, **kw): parser = argparse.ArgumentParser(*a, **kw) From 1f53428932dcd8809ffbb703681c03f5651fedb4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 7 Nov 2024 09:11:32 -0800 Subject: [PATCH 004/147] termlite: Update submodule commit --- themes/termlite | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/termlite b/themes/termlite index e04e7da..ac168d7 160000 --- a/themes/termlite +++ b/themes/termlite @@ -1 +1 @@ -Subproject commit e04e7dafa32a5d88c3144311dd66dbb9d8a308dd +Subproject commit ac168d7143d0437a837549a6cf96902e30409dac From 11d4dcd59030775fc760302af9984532e592ed21 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 9 Nov 2024 12:57:45 -0800 Subject: [PATCH 005/147] photos: Niagara Falls posts --- content/photos/2024/maid-of-the-mist/index.md | 20 +++++++++++++++++++ .../2024/maid-of-the-mist/niagara-falls-2.jpg | 3 +++ .../2024/niagara-falls-rainbow/index.md | 17 ++++++++++++++++ .../niagara-falls-rainbow/niagara-falls-1.jpg | 3 +++ .../photos/2024/niagaras-two-falls/index.md | 17 ++++++++++++++++ .../niagaras-two-falls/niagara-falls-3.jpg | 3 +++ 6 files changed, 63 insertions(+) create mode 100644 content/photos/2024/maid-of-the-mist/index.md create mode 100644 content/photos/2024/maid-of-the-mist/niagara-falls-2.jpg create mode 100644 content/photos/2024/niagara-falls-rainbow/index.md create mode 100644 content/photos/2024/niagara-falls-rainbow/niagara-falls-1.jpg create mode 100644 content/photos/2024/niagaras-two-falls/index.md create mode 100644 content/photos/2024/niagaras-two-falls/niagara-falls-3.jpg diff --git a/content/photos/2024/maid-of-the-mist/index.md b/content/photos/2024/maid-of-the-mist/index.md new file mode 100644 index 0000000..14e73f6 --- /dev/null +++ b/content/photos/2024/maid-of-the-mist/index.md @@ -0,0 +1,20 @@ +--- +title: "Maid of the Mist in the Mist" +linkTitle: Maid of the Mist +slug: niagara-maid-of-the-mist +date: 2024-11-08T08:13:53-08:00 +draft: true +categories: Travel +tags: + - New York + - Buffalo + - Landscapes + - Waterfalls +--- + +Maid of the Mist is a tour company that runs a few boats to the base of both +falls at Niagara. They launch from the Canadian and American sides, and use the +colors of the lifejackets and trimmings of the boats to indicate where people +should be returned to should it come to that. You can see one of the Canadian +boats just moving into the misty base of the horseshoe falls. We didn't get to +go out there on this visit, but I've heard you get quite wet on that boat ride. diff --git a/content/photos/2024/maid-of-the-mist/niagara-falls-2.jpg b/content/photos/2024/maid-of-the-mist/niagara-falls-2.jpg new file mode 100644 index 0000000..c2e442d --- /dev/null +++ b/content/photos/2024/maid-of-the-mist/niagara-falls-2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70990495d3e8f412f8c8ce374c959fe5692c97569e13d218afa130c58882c7ac +size 3122248 diff --git a/content/photos/2024/niagara-falls-rainbow/index.md b/content/photos/2024/niagara-falls-rainbow/index.md new file mode 100644 index 0000000..551a2af --- /dev/null +++ b/content/photos/2024/niagara-falls-rainbow/index.md @@ -0,0 +1,17 @@ +--- +title: Niagara Falls Rainbow +linkTitle: Rainbow +date: 2024-11-08T08:13:53-08:00 +draft: true +categories: Travel +tags: + - New York + - Buffalo + - Landscapes + - Waterfalls + - Rainbows +--- + +One of the wonderful things about these falls is they stir up a lot of fine +water droplets that produce rainbows when you and the sun are in just the right +places. diff --git a/content/photos/2024/niagara-falls-rainbow/niagara-falls-1.jpg b/content/photos/2024/niagara-falls-rainbow/niagara-falls-1.jpg new file mode 100644 index 0000000..c7eda85 --- /dev/null +++ b/content/photos/2024/niagara-falls-rainbow/niagara-falls-1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b29a6c876f9004a932350d0687bdd50826ae2001f2c94255fa7e5b013fe7cdae +size 6266918 diff --git a/content/photos/2024/niagaras-two-falls/index.md b/content/photos/2024/niagaras-two-falls/index.md new file mode 100644 index 0000000..5e30646 --- /dev/null +++ b/content/photos/2024/niagaras-two-falls/index.md @@ -0,0 +1,17 @@ +--- +title: "Niagara's Two Falls" +linkTitle: Two Falls +date: 2024-11-08T08:13:54-08:00 +draft: true +categories: Travel +tags: + - New York + - Buffalo + - Landscapes + - Waterfalls +--- + +Niagara Falls is actually two waterfalls. The larger and more famous horseshoe +falls on the Canadian side, and the smaller but no less impressive American +falls. This photo was taken overlooking the American side (on the left side of +the photo) looking toward the Canadian falls. diff --git a/content/photos/2024/niagaras-two-falls/niagara-falls-3.jpg b/content/photos/2024/niagaras-two-falls/niagara-falls-3.jpg new file mode 100644 index 0000000..868f4a5 --- /dev/null +++ b/content/photos/2024/niagaras-two-falls/niagara-falls-3.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0648c55e9c1dca35fd65e1ba216c0cd9e23fb53220bb8615320bd6d1b5e90442 +size 6540231 From cb16a35020046bfe73d6e7693f84e3be603c557c Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 11 Nov 2024 08:33:27 -0800 Subject: [PATCH 006/147] photos: Publish the Niagara posts (remove draft flag) --- content/photos/2024/maid-of-the-mist/index.md | 1 - content/photos/2024/niagara-falls-rainbow/index.md | 1 - content/photos/2024/niagaras-two-falls/index.md | 1 - 3 files changed, 3 deletions(-) diff --git a/content/photos/2024/maid-of-the-mist/index.md b/content/photos/2024/maid-of-the-mist/index.md index 14e73f6..e177ca5 100644 --- a/content/photos/2024/maid-of-the-mist/index.md +++ b/content/photos/2024/maid-of-the-mist/index.md @@ -3,7 +3,6 @@ title: "Maid of the Mist in the Mist" linkTitle: Maid of the Mist slug: niagara-maid-of-the-mist date: 2024-11-08T08:13:53-08:00 -draft: true categories: Travel tags: - New York diff --git a/content/photos/2024/niagara-falls-rainbow/index.md b/content/photos/2024/niagara-falls-rainbow/index.md index 551a2af..aadf318 100644 --- a/content/photos/2024/niagara-falls-rainbow/index.md +++ b/content/photos/2024/niagara-falls-rainbow/index.md @@ -2,7 +2,6 @@ title: Niagara Falls Rainbow linkTitle: Rainbow date: 2024-11-08T08:13:53-08:00 -draft: true categories: Travel tags: - New York diff --git a/content/photos/2024/niagaras-two-falls/index.md b/content/photos/2024/niagaras-two-falls/index.md index 5e30646..65eac61 100644 --- a/content/photos/2024/niagaras-two-falls/index.md +++ b/content/photos/2024/niagaras-two-falls/index.md @@ -2,7 +2,6 @@ title: "Niagara's Two Falls" linkTitle: Two Falls date: 2024-11-08T08:13:54-08:00 -draft: true categories: Travel tags: - New York From 122e55b1fa7201752080de44e4e6ecc647641ce1 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 13 Nov 2024 17:06:01 -0800 Subject: [PATCH 007/147] blog: Rubiks' Cube Scrambler post Implement the rubiks-cube-scrambler custom element, including JS and template files. Put these things in the body-extras.html partial that the termlite theme added. resource-builders: Update submodule commit termlite: Update submodule commit --- assets/scripts/rubiks/scrambler.js | 123 ++++++++++++++++++ content/blog/2024/rubiks-scrambler.md | 30 +++++ layouts/partials/base/body-extras.html | 4 + .../partials/rubiks/scrambler-template.html | 61 +++++++++ layouts/shortcodes/rubiks/scrambler.html | 1 + themes/resource-builders | 2 +- themes/termlite | 2 +- 7 files changed, 221 insertions(+), 2 deletions(-) create mode 100644 assets/scripts/rubiks/scrambler.js create mode 100644 content/blog/2024/rubiks-scrambler.md create mode 100644 layouts/partials/base/body-extras.html create mode 100644 layouts/partials/rubiks/scrambler-template.html create mode 100644 layouts/shortcodes/rubiks/scrambler.html diff --git a/assets/scripts/rubiks/scrambler.js b/assets/scripts/rubiks/scrambler.js new file mode 100644 index 0000000..10a03c3 --- /dev/null +++ b/assets/scripts/rubiks/scrambler.js @@ -0,0 +1,123 @@ +class RubiksCubeScrambler extends HTMLElement { + static #RandomMoveHysteresisMaxLength = 2; + + #shadowRoot; + #movesListElement; + + #numberOfMovesToGenerate = 25; + + constructor() { + super(); + this.#shadowRoot = this.attachShadow({ mode: "open" }); + } + + scramble() { + console.log("Randomizing Rubik's cube..."); + + const movesList = this.#movesListElement; + + while (movesList.childElementCount > this.#numberOfMovesToGenerate) { + movesList.removeChild(movesList.lastChild); + } + + let randomMoveHysteresis = []; + + for (let i = 0; i < this.#numberOfMovesToGenerate; i++) { + const randomMove = this.#randomMove(randomMoveHysteresis); + + let moveItem; + if (i < movesList.childElementCount) { + moveItem = movesList.children[i]; + } else { + moveItem = document.createElement("li"); + movesList.appendChild(moveItem); + } + + moveItem.classList.add("scrambler__move"); + moveItem.classList.remove("scrambler__move--start", "scrambler__move--end"); + + if (randomMove.includes("2")) { + moveItem.classList.add("scrambler__move--start"); + } else if (randomMove.includes("'")) { + moveItem.classList.add("scrambler__move--end"); + } + + moveItem.innerText = randomMove; + } + } + + #randomMove(hysteresis) { + const faces = "FBLRUD"; + + let move; + do { + move = faces.charAt(Math.floor(Math.random() * faces.length)); + } while (hysteresis && hysteresis.includes(move)); + + if (hysteresis) { + hysteresis.unshift(move); + while (hysteresis.length > RubiksCubeScrambler.#RandomMoveHysteresisMaxLength) { + hysteresis.pop(); + } + } + + const modifierFactor = Math.random(); + if (modifierFactor < 0.33333) { + move = "2" + move; + } else if (modifierFactor < 0.666666) { + move = move + "'"; + } + + return move; + } + + #removeAllMoves() { + const element = this.#movesListElement; + while (element.hasChildNodes()) { + element.removeChild(element.lastChild); + } + } + + // MARK: Custom Element + + connectedCallback() { + let template = document.getElementById("rubiks-cube-scrambler-template"); + console.assert(template, "Couldn't find RubiksCubeScrambler component template in the document"); + + const shadowRoot = this.#shadowRoot; + shadowRoot.appendChild(template.content.cloneNode(true)); + + this.#movesListElement = shadowRoot.querySelector(".scrambler__move-list"); + + shadowRoot + .querySelector("button[name='scramble']") + .addEventListener("click", () => this.scramble()); + + const patternLengthInputElement = shadowRoot.querySelector(".scrambler__pattern-length > input"); + patternLengthInputElement.value = this.#numberOfMovesToGenerate; + patternLengthInputElement.addEventListener("input", event => { + try { + const integerValue = parseInt(event.target.value); + this.#numberOfMovesToGenerate = integerValue; + } catch (e) { + console.error("Non-integer value of pattern length field", e); + } + }); + + this.scramble(); + } + + attributeChangedCallback(name, oldValue, newValue) { + console.debug("RubiksCubeScrambler attribute changed", name, oldValue, newValue); + if (name === "count") { + try { + let newIntValue = parseInt(newValue); + this.#numberOfMovesToGenerate = newIntValue; + } catch (e) { + console.error("`count` attribute should have an integer value.", e); + } + } + } +} + +window.customElements.define("rubiks-cube-scrambler", RubiksCubeScrambler); diff --git a/content/blog/2024/rubiks-scrambler.md b/content/blog/2024/rubiks-scrambler.md new file mode 100644 index 0000000..a0ac788 --- /dev/null +++ b/content/blog/2024/rubiks-scrambler.md @@ -0,0 +1,30 @@ +--- +title: Rubik's Cube Scrambler +date: 2024-11-13T15:34:22-08:00 +tags: + - Tech + - Puzzles + - Rubik's Cube + - HTML + - JavaScript + - CSS + - Web Components +--- + +Here's a silly thing I made while I was home sick today. It's a widget that +produces a randomized pattern of [moves][rmoves] to scramble a 3×3 [Rubik's +Cube][rcube]. + +
+ {{< rubiks/scrambler >}} +
+ +This thing is a [Web Component][wc]. The interactive logic lives inside a custom +[HTMLElement][htmlelement], and the content and styling are specified inside a +[`