Skip to content

Commit

Permalink
Merge pull request #44 from reednel/develop
Browse files Browse the repository at this point in the history
use node 20
  • Loading branch information
Reed Nelson committed Oct 18, 2023
2 parents 3aeada2 + 15728ca commit aa4cef7
Show file tree
Hide file tree
Showing 132 changed files with 99 additions and 106 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: Build and Deploy to GitHub Pages

on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
Expand All @@ -22,9 +19,9 @@ jobs:
- name: Install, build, and upload your site
uses: withastro/action@v0
with:
path: . # The root location of your Astro project inside the repository. (optional)
node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 16. (optional)
package-manager: npm # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
path: .
node-version: 20
package-manager: npm

deploy:
needs: build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
uses: withastro/action@v0
with:
path: .
node-version: 18
node-version: 20
package-manager: npm
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ publish = "dist"
command = "yarn build"

[build.environment]
NODE_VERSION = "18"
NODE_VERSION = "20"
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Clone: `git clone https://github.com/reednel/pages.git`

Checkout template: `git checkout template`

Use Node 18: `nvm install --lts`
Use Node 20: `nvm install 20`

Install Node Modules: `npm install`

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions src/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"puzzle_pagination": 6,
"summary_length": 200,
"blog_folder": "blog",
"puzzle_folder": "puzzle",
"drink_folder": "drink"
"puzzle_folder": "puzzles",
"drink_folder": "drinks"
},

"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions src/config/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
},
{
"name": "Puzzles",
"url": "/puzzle"
"url": "/puzzles"
},
{
"name": "Drinks",
"url": "/drink"
"url": "/drinks"
}
]
}
1 change: 0 additions & 1 deletion src/content/about/-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: About
meta_title: About
description: About Reed Nelson.
image: /assets/about/reed.jpg
draft: false
---

Expand Down
8 changes: 4 additions & 4 deletions src/content/blog/debruijn.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Let $A$ be an alphabet of $k$ distinct characters[^2]. A **de Bruijn sequence**

Each $B(k, n)$ has a corresponding de Bruijn graph. The example in the figure below shows the graph for $B(2, 3)$.

![B(2, 3) Graph](/assets/blog/debruijn/b23_graph.png)
![B(2, 3) Graph](@assets/blog/debruijn/b23_graph.png)

**De Bruijn graphs** are directed Eulerian graphs, which is to say that there exists a circuit (connected loop) within the graph which visits each *edge* exactly once. These graphs have a number of interrelated properties.

Expand All @@ -40,7 +40,7 @@ Each $B(k, n)$ has a corresponding de Bruijn graph. The example in the figure be

**Property 6:** Because each vertex has exactly $k$ incoming and outgoing edges, the number of edges of $B(k, n)$ are $k\cdot k^{n-1}$, or $k^n$. Notice that $B(k, n+1)$ has a number of vertices equal to the number of edges of $B(k, n)$. We can draw the graph for $B(k, n+1)$ in the following way: put a vertex where each edge of $B(k, n)$ would be, whose label is the character on that edge, concatenated to the source vertex. In this way, each vertex remains unique with respect to all other vertices in the $B(k, n+1)$ graph. Applying this method to the $B(2, 3)$ graph pictured above yields the $B(2, 4)$ graph pictured in the figure below. This tracks with Property 4.

![B(2, 4) Graph](/assets/blog/debruijn/b24_graph.png)
![B(2, 4) Graph](@assets/blog/debruijn/b24_graph.png)

**Property 7:** By following an Eulerian circuit through a $B(k, n-1)$ graph, and recording the label of each edge as it is visited, one gets a $B(k, n)$ sequence. Furthermore, the set of sequences constructed by taking all Eulerian circuits in the $B(k,n-1)$ graph is identical to the set of $B(k, n)$ sequences. This fact is key in creating a generating algorithm.

Expand All @@ -58,7 +58,7 @@ The $B(k, n)$ graph will be represented by an adjacency matrix[^4]. The data str

Each vertex (a value in base-$k$) corresponds to the index of that value in decimal. Then whether one vertex points to another (or the same) depends on if the rightmost $n-1$ characters of the row index are the same as the leftmost $n-1$ characters of the column index (in the spirit of the example described in Property 5). The adjacency matrix corresponding to the $B(2, 3)$ graph is pictured in the figure below, and can be verified by examining the first figure.

![B(2, 3) Adjacency Matrix](/assets/blog/debruijn/b23_adjmatrix.png)
![B(2, 3) Adjacency Matrix](@assets/blog/debruijn/b23_adjmatrix.png)

### Traversing the Graph

Expand Down Expand Up @@ -103,7 +103,7 @@ $\underline{01234}56789 \to \underline{0}5\underline{1}6\underline{2}7\underline

Below are some results from a function which checks each rotation of each sequence provided by the generator, and returns those which out-shuffle.

![Sample out-shuffling de Bruijn sequences](/assets/blog/debruijn/b_outshuffles.png)
![Sample out-shuffling de Bruijn sequences](@assets/blog/debruijn/b_outshuffles.png)

There would be a number of interesting directions to take this shuffling idea. The naive method for checking if a sequence can shuffle to itself would be $O(n^2)$ with respect to the length of the sequence: for each of $n$ rotations, you compare the character at each index of the original sequence to the character at each index of the transformed sequence. I wonder if it's possible to tell whether some rotation of a sequnce will shuffle, just by examining a single rotation. One might also be able to take this in an algebraic direction: perhaps the right sets of sequences shuffle to each other, forming a [group](https://en.wikipedia.org/wiki/Group_theory) under shuffling operation.

Expand Down
2 changes: 1 addition & 1 deletion src/content/blog/huffman.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ In the 50's, MIT PhD student David Huffman had to write a paper proving some cod

5. Build a binary tree for which all the leaves are the original members of $\Omega$, and two nodes share a parent if they were replaced by that parent in step (2).

![Visualization of the Huffman Coding algorithm](/assets/blog/huffman/huffman.png)
![Visualization of the Huffman Coding algorithm](@assets/blog/huffman/huffman.png)

Huffman's simple $O(n\log(n))$ algorithm finds an optimal symbol-by-symbol coding. There are alternate methods of coding which perform better under certain circumstances, but even where suboptimal, Huffman is quite good.

Expand Down
14 changes: 7 additions & 7 deletions src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const blogCollection = defineCollection({
description: z.string().optional(),
date: z.date().optional(),
author: z.string().default("Reed Nelson"),
categories: z.array(z.string()).default(["others"]),
tags: z.array(z.string()).default(["others"]),
categories: z.array(z.string()).default(["none"]),
tags: z.array(z.string()).default(["none"]),
complexity: z.number().default(1),
draft: z.boolean().optional(),
}),
Expand All @@ -27,13 +27,13 @@ const puzzleCollection = defineCollection({

// Drink collection schema
const drinkCollection = defineCollection({
schema: z.object({
schema: ({ image }) => z.object({
title: z.string(),
meta_title: z.string().optional(),
description: z.string().optional(),
date: z.date().optional(),
image: z.string().optional(),
author: z.string().default("Admin"),
cover: image().optional(),
author: z.string().default("none"),
spirits: z.array(z.string()).default(["none"]),
bottles: z.array(z.string()).default(["none"]),
tags: z.array(z.string()).default(["none"]),
Expand All @@ -49,6 +49,6 @@ const drinkCollection = defineCollection({
// Export collections
export const collections = {
blog: blogCollection,
puzzle: puzzleCollection,
drink: drinkCollection,
puzzles: puzzleCollection,
drinks: drinkCollection,
};
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Drink
author: Reed Nelson
draft: true
description: recipe.
image: /assets/drink/.jpg
cover: "@assets/drinks/.jpg"

spirits: [spirit]
bottles: [bottle]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Amaretto Sour
author: Reed Nelson
draft: false
description: Amaretto Sour recipe.
image: /assets/drink/amaretto-sour.jpg
cover: "@assets/drinks/amaretto-sour.jpg"

spirits: [whiskey]
bottles: [amaretto]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Appley Cocktail
author: Reed Nelson
draft: false
description: Appley Cocktail recipe.
image: /assets/drink/appley-cocktail.jpg
cover: "@assets/drinks/appley-cocktail.jpg"

spirits: [whiskey]
bottles: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Basilica
author: Reed Nelson
draft: false
description: Basilica recipe.
image: /assets/drink/basilica.jpg
cover: "@assets/drinks/basilica.jpg"

spirits: [gin]
bottles: [ango, st-germain]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Berlin
author: Reed Nelson
draft: false
description: Berlin recipe.
image: /assets/drink/berlin.jpg
cover: "@assets/drinks/berlin.jpg"

spirits: [whiskey]
bottles: [sweet-vermouth, benedictine]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Boulevardier
author: Reed Nelson
draft: false
description: Boulevardier recipe.
image: /assets/drink/boulevardier.jpg
cover: "@assets/drinks/boulevardier.jpg"

spirits: [whiskey]
bottles: [sweet-vermouth, campari]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Bourbon Bash
author: Reed Nelson
draft: false
description: Bourbon Bash recipe.
image: /assets/drink/bourbon-bash.jpg
cover: "@assets/drinks/bourbon-bash.jpg"

spirits: [whiskey]
bottles: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Clark Old Fashioned
author: Reed Nelson
draft: false
description: Clark Old Fashioned recipe.
image: /assets/drink/clark-old-fashioned.jpg
cover: "@assets/drinks/clark-old-fashioned.jpg"

spirits: [brandy]
bottles: [ango]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Cosmopolitan
author: Reed Nelson
draft: false
description: Cosmopolitan recipe.
image: /assets/drink/cosmopolitan.jpg
cover: "@assets/drinks/cosmopolitan.jpg"

spirits: [vodka]
bottles: [cointreau]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Cucumber Martini
author: Reed Nelson
draft: false
description: Cucumber Martini recipe.
image: /assets/drink/cucumber-martini.jpg
cover: "@assets/drinks/cucumber-martini.jpg"

spirits: [vodka]
bottles: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Elderflower Martini
author: Reed Nelson
draft: false
description: Elderflower Martini recipe.
image: /assets/drink/elderflower-martini.jpg
cover: "@assets/drinks/elderflower-martini.jpg"

spirits: [vodka]
bottles: [st-germain]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Floradora
author: Reed Nelson
draft: false
description: Floradora recipe.
image: /assets/drink/floradora.jpg
cover: "@assets/drinks/floradora.jpg"

spirits: [gin]
bottles: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Gin Buck
author: Reed Nelson
draft: false
description: Gin Buck recipe.
image: /assets/drink/gin-buck.jpg
cover: "@assets/drinks/gin-buck.jpg"

spirits: [Gin]
bottles: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Gin Gin Mule
author: Reed Nelson
draft: false
description: Gin Gin Mule recipe.
image: /assets/drink/gin-gin-mule.jpg
cover: "@assets/drinks/gin-gin-mule.jpg"

spirits: [Gin]
bottles: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Hotel Georgia
author: Reed Nelson
draft: false
description: Hotel Georgia recipe.
image: /assets/drink/hotel-georgia.jpg
cover: "@assets/drinks/hotel-georgia.jpg"

spirits: [gin]
bottles: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Improved Japanese Cocktail
author: Reed Nelson
draft: false
description: Improved Japanese Cocktail recipe.
image: /assets/drink/improved-japanese-cocktail.jpg
cover: "@assets/drinks/improved-japanese-cocktail.jpg"

spirits: [brandy]
bottles: [peychauds]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Improved Whiskey Cocktail
author: Reed Nelson
draft: false
description: Improved Whiskey Cocktail recipe.
image: /assets/drink/improved-whiskey-cocktail.jpg
cover: "@assets/drinks/improved-whiskey-cocktail.jpg"

spirits: [whiskey]
bottles: [maraschino, absinthe]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Irish Maid
author: Reed Nelson
draft: false
description: Irish Maid recipe.
image: /assets/drink/irish-maid.jpg
cover: "@assets/drinks/irish-maid.jpg"

spirits: [whiskey]
bottles: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Kentucky Maid
author: Reed Nelson
draft: false
description: Kentucky Maid recipe.
image: /assets/drink/kentucky-maid.jpg
cover: "@assets/drinks/kentucky-maid.jpg"

spirits: [whiskey]
bottles: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: La Louisiane
author: Reed Nelson
draft: false
description: La Louisiane recipe.
image: /assets/drink/la-louisiane.jpg
cover: "@assets/drinks/la-louisiane.jpg"

spirits: [whiskey]
bottles: [peychauds, sweet-vermouth, benedictine, absinthe]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Lemon Drop Martini
author: Reed Nelson
draft: false
description: Lemon Drop Martini recipe.
image: /assets/drink/lemon-drop-martini.jpg
cover: "@assets/drinks/lemon-drop-martini.jpg"

spirits: [vodka]
bottles: [cointreau]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: London Gypsy
author: Reed Nelson
draft: false
description: London Gypsy recipe.
image: /assets/drink/london-gypsy.jpg
cover: "@assets/drinks/london-gypsy.jpg"

spirits: [gin]
bottles: [ango, benedictine]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta_title: Lucien Gaudin
author: Reed Nelson
draft: false
description: Lucien Gaudin recipe.
image: /assets/drink/lucien-gaudin.jpg
cover: "@assets/drinks/lucien-gaudin.jpg"

spirits: [gin]
bottles: [dry-vermouth, campari, cointreau]
Expand Down
Loading

0 comments on commit aa4cef7

Please sign in to comment.