Skip to content

Commit 4bdf535

Browse files
committed
build: new gh-pages build process
1 parent 643f050 commit 4bdf535

File tree

9 files changed

+720
-25
lines changed

9 files changed

+720
-25
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,13 @@ Stories are managed via git subtrees:
8383
- **Logic**: Use Context for global settings like Visual Effects and Achievements.
8484

8585
---
86+
87+
## Github Pages Configuration
88+
89+
1. Deploy from a branch.
90+
2. Select the `gh-pages` branch
91+
3. Add `fezcode.com` as the custom domain.
92+
93+
--
94+
8695
Created by [Ahmed Samil Bulbul](https://fezcode.com).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fezcodex",
3-
"version": "0.9.2",
3+
"version": "0.9.4",
44
"private": true,
55
"homepage": "https://fezcode.com",
66
"dependencies": {
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Can you solve the pirate riddle? - Alex Gendler
2+
3+
- **Category:** Video
4+
- **Date:** 2026-01-08
5+
- **Rating:** 5/5
6+
- **Link:** [YouTube - Can you solve the pirate riddle?](https://www.youtube.com/watch?v=Mc6VA7Q1vXQ)
7+
8+
## The Video
9+
10+
<iframe width="560" height="315" src="https://www.youtube.com/embed/Mc6VA7Q1vXQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
11+
12+
## About
13+
14+
It’s a resting day on the pirate ship. The five pirates: Amaro, Bart, Charlotte, Daniel, and Elizabeth have found a treasure chest with 100 gold coins. They must decide how to partition them.
15+
16+
Pirates are ranked by seniority: Amaro is #1, Bart is #2, Charlotte is #3, Daniel is #4, and Elizabeth is the most junior, #5.
17+
18+
The rules of pirate democracy are as follows: the most senior pirate proposes a distribution. Then, everyone, including the proposer, votes. If at least 50% of the pirates agree, the gold is distributed as proposed. If not, the proposer is thrown overboard, and the process starts again with the next most senior pirate.
19+
20+
Pirates are perfectly rational, but they also have a hierarchy of goals:
21+
1. Stay alive.
22+
2. Maximize their own gold.
23+
3. If all else is equal, they prefer to see others thrown overboard.
24+
25+
Can you figure out what Amaro should propose?
26+
27+
## The Solution
28+
29+
To solve this, we work backward from the most junior pirates:
30+
31+
1. **Two Pirates (Daniel, Elizabeth):** Daniel needs only 50% of the vote. He votes for himself and wins. He takes all 100 coins, and Elizabeth gets 0.
32+
2. **Three Pirates (Charlotte, Daniel, Elizabeth):** Charlotte needs one other vote. She knows Elizabeth will get 0 if it goes to Daniel's turn, so she offers Elizabeth 1 coin. Elizabeth accepts. Distribution: **99, 0, 1**.
33+
3. **Four Pirates (Bart, Charlotte, Daniel, Elizabeth):** Bart needs one other vote. He knows Daniel gets 0 in Charlotte's plan, so he offers Daniel 1 coin. Daniel accepts. Distribution: **99, 0, 1, 0**.
34+
4. **Five Pirates (Amaro, Bart, Charlotte, Daniel, Elizabeth):** Amaro needs two other votes besides his own. He knows Charlotte and Elizabeth both get 0 in Bart's plan. By offering them each 1 coin, they are better off and will vote with him.
35+
36+
**Final Proposal:**
37+
- **Amaro:** 98 coins
38+
- **Bart:** 0 coins
39+
- **Charlotte:** 1 coin
40+
- **Daniel:** 0 coins
41+
- **Elizabeth:** 1 coin
42+

public/logs/video/video.piml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
(logs)
2+
> (item)
3+
(category) Video
4+
(date) 2026-01-08
5+
(link) https://www.youtube.com/watch?v=Mc6VA7Q1vXQ
6+
(rating) 5
7+
(slug) can-you-solve-the-pirate-riddle
8+
(title) Can you solve the pirate riddle? - Alex Gendler
9+
(description) A classic logic riddle from TED-Ed about pirate democracy and rational self-interest.
10+
211
> (item)
312
(category) Video
413
(date) 2026-01-07
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Resolving `spawn ENAMETOOLONG` in `gh-pages` Deployment
2+
3+
If you've been using the `gh-pages` package for a while, especially in projects with large build folders or complex structures, you might have encountered the dreaded `spawn ENAMETOOLONG` error when running your deploy script.
4+
5+
## The Problem
6+
When executing the standard deployment command:
7+
```bash
8+
gh-pages -d build -b gh-pages
9+
```
10+
The process fails with a system error indicating that the argument list or the command path itself has exceeded the operating system's limits. This is often related to how the underlying `globby` or `async` dependencies handle file lists in older versions of the package (like `6.3.0`).
11+
12+
The issue is documented and discussed in detail here: [gh-pages Issue #585](https://github.com/tschaub/gh-pages/issues/585).
13+
14+
## The Fix
15+
The specific fix for this issue was highlighted in [this GitHub comment](https://github.com/tschaub/gh-pages/issues/585#issuecomment-2585457896), which explains that the `ENAMETOOLONG` error occurs on Windows when the `rm` command receives an excessively long list of files as arguments.
16+
17+
``` git
18+
diff --git a/lib/git.js b/lib/git.js
19+
index d4c5724272d00bd1f0d76c47dab47d21ccd094d9..d86ac2b0bd7cbc02f34a50dac6980965102ee964 100644
20+
--- a/lib/git.js
21+
+++ b/lib/git.js
22+
@@ -143,7 +143,7 @@ Git.prototype.rm = function (files) {
23+
if (!Array.isArray(files)) {
24+
files = [files];
25+
}
26+
- return this.exec('rm', '--ignore-unmatch', '-r', '-f', '--', ...files);
27+
+ return this.exec('rm', '--ignore-unmatch', '-r', '-f', '--', '.');
28+
};
29+
30+
/**
31+
```
32+
33+
The suggested workarounds included batching the file deletions or simplifying the command to target the current directory (`.`) instead of individual files. Fortunately, these improvements (including a more robust batching logic and a migration to `tinyglobby`) have already been merged into the main branch of the repository via PR #607.
34+
35+
While we wait for a stable release on NPM that fully addresses this in all environments, the most effective way to resolve it is to use the latest development version directly from the source.
36+
37+
By updating your `package.json` to point to the GitHub repository's main branch, you get the latest fixes (including the migration to `tinyglobby` and updated `commander` logic) that bypass these system limits.
38+
39+
### Implementation
40+
Update your `package.json` dependencies:
41+
42+
```json
43+
"devDependencies": {
44+
"gh-pages": "github:tschaub/gh-pages"
45+
}
46+
```
47+
48+
Then, refresh your installations:
49+
```bash
50+
npm install
51+
```
52+
53+
This simple change allowed us to resume our production deployments without hitches, ensuring that our "Brutalist" digital garden stays fresh and accessible.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Git Cheatsheet: From Basics to Time Travel
2+
3+
A collection of essential Git commands, from daily workflows to digging through the depths of your repository's history.
4+
5+
## 🔍 Searching History
6+
7+
### Find when a file existed (even if deleted)
8+
```bash
9+
git log --all -- [path]
10+
```
11+
12+
### Search for content changes (Pickaxe)
13+
Find commits where a specific string was added or removed:
14+
```bash
15+
git log -S "your_search_string"
16+
```
17+
18+
### Search content with Regex
19+
```bash
20+
git log -G "your_regex"
21+
```
22+
23+
### Find a file in any commit/branch
24+
```bash
25+
git rev-list --all | xargs git grep -l "filename"
26+
```
27+
28+
### See the history of a specific function/method
29+
```bash
30+
git log -L :function_name:file_path
31+
```
32+
33+
---
34+
35+
## 🚀 Daily Workflow
36+
37+
### Stage and Commit
38+
```bash
39+
git add .
40+
git commit -m "feat: descriptive message"
41+
```
42+
43+
### Undo last commit (keep changes)
44+
```bash
45+
git reset --soft HEAD~1
46+
```
47+
48+
### Fix the last commit message
49+
```bash
50+
git commit --amend -m "new message"
51+
```
52+
53+
---
54+
55+
## 🌿 Branching & Merging
56+
57+
### Switch to a new branch
58+
```bash
59+
git checkout -b feature/cool-stuff
60+
# or the newer way:
61+
git switch -c feature/cool-stuff
62+
```
63+
64+
### List all branches (including remote)
65+
```bash
66+
git branch -a
67+
```
68+
69+
### Safely delete a branch
70+
```bash
71+
git branch -d branch_name
72+
```
73+
74+
---
75+
76+
## 🛠️ Cleanup & Maintenance
77+
78+
### Discard all local changes
79+
```bash
80+
git reset --hard HEAD
81+
```
82+
83+
### Clean untracked files
84+
```bash
85+
git clean -fd
86+
```
87+
88+
### Stash changes for later
89+
```bash
90+
git stash save "Work in progress"
91+
git stash list
92+
git stash pop
93+
```
94+
95+
---
96+
97+
## 📤 Remote Operations
98+
99+
### Update local with remote and rebase
100+
```bash
101+
git pull --rebase origin main
102+
```
103+
104+
### Prune old remote tracking branches
105+
```bash
106+
git fetch -p
107+
```

public/posts/posts.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
[
2+
{
3+
"slug": "gh-pages-enametoolong-fix",
4+
"title": "Fixing gh-pages: Resolving spawn ENAMETOOLONG",
5+
"date": "2026-01-08",
6+
"updated": "2026-01-08",
7+
"description": "A quick guide on how to fix the spawn ENAMETOOLONG error in gh-pages by switching to the latest GitHub version.",
8+
"tags": ["gh-pages", "bug", "deployment", "npm", "fix"],
9+
"category": "dev",
10+
"filename": "gh-pages-enametoolong-fix.txt",
11+
"authors": ["fezcode"],
12+
"image": "/images/defaults/sina-salehian-HqmTUJD73mM-unsplash.jpg"
13+
},
14+
{
15+
"slug": "git-cheatsheet-gist",
16+
"title": "Git Cheatsheet: From Basics to Time Travel",
17+
"date": "2026-01-08",
18+
"updated": "2026-01-08",
19+
"description": "A comprehensive Git cheatsheet covering daily workflows, advanced history searching, and repository maintenance.",
20+
"tags": ["git", "gist", "tutorial", "cheatsheet", "dev"],
21+
"category": "gist",
22+
"filename": "git-cheatsheet-gist.txt",
23+
"authors": ["fezcode"],
24+
"image": "/images/defaults/sina-salehian-HqmTUJD73mM-unsplash.jpg"
25+
},
226
{
327
"slug": "aether-music-player",
428
"title": "Aether: Cyberpunk Audio Interface",

0 commit comments

Comments
 (0)