diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 35f59cf..fabe1b5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -525,23 +525,23 @@ packages:
cpu: [x64]
os: [win32]
- '@shikijs/core@3.4.2':
- resolution: {integrity: sha512-AG8vnSi1W2pbgR2B911EfGqtLE9c4hQBYkv/x7Z+Kt0VxhgQKcW7UNDVYsu9YxwV6u+OJrvdJrMq6DNWoBjihQ==}
+ '@shikijs/core@3.13.0':
+ resolution: {integrity: sha512-3P8rGsg2Eh2qIHekwuQjzWhKI4jV97PhvYjYUzGqjvJfqdQPz+nMlfWahU24GZAyW1FxFI1sYjyhfh5CoLmIUA==}
- '@shikijs/engine-javascript@3.4.2':
- resolution: {integrity: sha512-1/adJbSMBOkpScCE/SB6XkjJU17ANln3Wky7lOmrnpl+zBdQ1qXUJg2GXTYVHRq+2j3hd1DesmElTXYDgtfSOQ==}
+ '@shikijs/engine-javascript@3.13.0':
+ resolution: {integrity: sha512-Ty7xv32XCp8u0eQt8rItpMs6rU9Ki6LJ1dQOW3V/56PKDcpvfHPnYFbsx5FFUP2Yim34m/UkazidamMNVR4vKg==}
- '@shikijs/engine-oniguruma@3.4.2':
- resolution: {integrity: sha512-zcZKMnNndgRa3ORja6Iemsr3DrLtkX3cAF7lTJkdMB6v9alhlBsX9uNiCpqofNrXOvpA3h6lHcLJxgCIhVOU5Q==}
+ '@shikijs/engine-oniguruma@3.13.0':
+ resolution: {integrity: sha512-O42rBGr4UDSlhT2ZFMxqM7QzIU+IcpoTMzb3W7AlziI1ZF7R8eS2M0yt5Ry35nnnTX/LTLXFPUjRFCIW+Operg==}
- '@shikijs/langs@3.4.2':
- resolution: {integrity: sha512-H6azIAM+OXD98yztIfs/KH5H4PU39t+SREhmM8LaNXyUrqj2mx+zVkr8MWYqjceSjDw9I1jawm1WdFqU806rMA==}
+ '@shikijs/langs@3.13.0':
+ resolution: {integrity: sha512-672c3WAETDYHwrRP0yLy3W1QYB89Hbpj+pO4KhxK6FzIrDI2FoEXNiNCut6BQmEApYLfuYfpgOZaqbY+E9b8wQ==}
- '@shikijs/themes@3.4.2':
- resolution: {integrity: sha512-qAEuAQh+brd8Jyej2UDDf+b4V2g1Rm8aBIdvt32XhDPrHvDkEnpb7Kzc9hSuHUxz0Iuflmq7elaDuQAP9bHIhg==}
+ '@shikijs/themes@3.13.0':
+ resolution: {integrity: sha512-Vxw1Nm1/Od8jyA7QuAenaV78BG2nSr3/gCGdBkLpfLscddCkzkL36Q5b67SrLLfvAJTOUzW39x4FHVCFriPVgg==}
- '@shikijs/types@3.4.2':
- resolution: {integrity: sha512-zHC1l7L+eQlDXLnxvM9R91Efh2V4+rN3oMVS2swCBssbj2U/FBwybD1eeLaq8yl/iwT+zih8iUbTBCgGZOYlVg==}
+ '@shikijs/types@3.13.0':
+ resolution: {integrity: sha512-oM9P+NCFri/mmQ8LoFGVfVyemm5Hi27330zuOBp0annwJdKH1kOLndw3zCtAVDehPLg9fKqoEx3Ht/wNZxolfw==}
'@shikijs/vscode-textmate@10.0.2':
resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==}
@@ -1695,8 +1695,8 @@ packages:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
- shiki@3.4.2:
- resolution: {integrity: sha512-wuxzZzQG8kvZndD7nustrNFIKYJ1jJoWIPaBpVe2+KHSvtzMi4SBjOxrigs8qeqce/l3U0cwiC+VAkLKSunHQQ==}
+ shiki@3.13.0:
+ resolution: {integrity: sha512-aZW4l8Og16CokuCLf8CF8kq+KK2yOygapU5m3+hoGw0Mdosc6fPitjM+ujYarppj5ZIKGyPDPP1vqmQhr+5/0g==}
simple-swizzle@0.2.2:
resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==}
@@ -2075,7 +2075,7 @@ snapshots:
remark-parse: 11.0.0
remark-rehype: 11.1.2
remark-smartypants: 3.0.2
- shiki: 3.4.2
+ shiki: 3.13.0
smol-toml: 1.3.4
unified: 11.0.5
unist-util-remove-position: 5.0.0
@@ -2467,33 +2467,33 @@ snapshots:
'@rollup/rollup-win32-x64-msvc@4.41.0':
optional: true
- '@shikijs/core@3.4.2':
+ '@shikijs/core@3.13.0':
dependencies:
- '@shikijs/types': 3.4.2
+ '@shikijs/types': 3.13.0
'@shikijs/vscode-textmate': 10.0.2
'@types/hast': 3.0.4
hast-util-to-html: 9.0.5
- '@shikijs/engine-javascript@3.4.2':
+ '@shikijs/engine-javascript@3.13.0':
dependencies:
- '@shikijs/types': 3.4.2
+ '@shikijs/types': 3.13.0
'@shikijs/vscode-textmate': 10.0.2
oniguruma-to-es: 4.3.3
- '@shikijs/engine-oniguruma@3.4.2':
+ '@shikijs/engine-oniguruma@3.13.0':
dependencies:
- '@shikijs/types': 3.4.2
+ '@shikijs/types': 3.13.0
'@shikijs/vscode-textmate': 10.0.2
- '@shikijs/langs@3.4.2':
+ '@shikijs/langs@3.13.0':
dependencies:
- '@shikijs/types': 3.4.2
+ '@shikijs/types': 3.13.0
- '@shikijs/themes@3.4.2':
+ '@shikijs/themes@3.13.0':
dependencies:
- '@shikijs/types': 3.4.2
+ '@shikijs/types': 3.13.0
- '@shikijs/types@3.4.2':
+ '@shikijs/types@3.13.0':
dependencies:
'@shikijs/vscode-textmate': 10.0.2
'@types/hast': 3.0.4
@@ -2672,7 +2672,7 @@ snapshots:
prompts: 2.4.2
rehype: 13.0.2
semver: 7.7.2
- shiki: 3.4.2
+ shiki: 3.13.0
tinyexec: 0.3.2
tinyglobby: 0.2.13
tsconfck: 3.1.6(typescript@5.8.3)
@@ -4252,14 +4252,14 @@ snapshots:
shebang-regex@3.0.0: {}
- shiki@3.4.2:
+ shiki@3.13.0:
dependencies:
- '@shikijs/core': 3.4.2
- '@shikijs/engine-javascript': 3.4.2
- '@shikijs/engine-oniguruma': 3.4.2
- '@shikijs/langs': 3.4.2
- '@shikijs/themes': 3.4.2
- '@shikijs/types': 3.4.2
+ '@shikijs/core': 3.13.0
+ '@shikijs/engine-javascript': 3.13.0
+ '@shikijs/engine-oniguruma': 3.13.0
+ '@shikijs/langs': 3.13.0
+ '@shikijs/themes': 3.13.0
+ '@shikijs/types': 3.13.0
'@shikijs/vscode-textmate': 10.0.2
'@types/hast': 3.0.4
diff --git a/src/components/Header.astro b/src/components/Header.astro
index 161dec0..34cf25e 100644
--- a/src/components/Header.astro
+++ b/src/components/Header.astro
@@ -1,18 +1,15 @@
---
const path = Astro.url.pathname;
const isHome = path === "/" || path === "/index.html";
+const is404 = path === "/404.html" || path === "/404";
function getTopic() {
-if (path.startsWith("/about")) {
- return "/about";
- }
-
- const pathname = path.split("/");
-
- if (pathname.length === 2 && pathname[1].endsWith(".html")) {
- return "/" + pathname[1].replace(".html", "");
- } else if (pathname.length >= 3) {
- return "/" + pathname.slice(2, -1).join("/").replace(".html", "");
+ if (is404) return "/not-found";
+ if (path.startsWith("/about")) return "/about";
+ if (path === "/git" || path.startsWith("/git/")) return "/git";
+ if (path.startsWith("/posts/")) {
+ const parts = path.replace(/\/+$/, "").split("/");
+ if (parts.length >= 3) return "/" + parts[2];
}
return "";
}
@@ -110,7 +107,8 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
topic.classList.remove("active");
topic.style.color = "";
});
- document.getElementById("posts").innerHTML = "";
+ const posts = document.getElementById("posts");
+ if (posts) posts.innerHTML = "";
clearPrompt(500);
});
} else {
@@ -155,3 +153,4 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
}
}
+
diff --git a/src/content/config.ts b/src/content/config.ts
index fcf7fe7..81d9bdb 100644
--- a/src/content/config.ts
+++ b/src/content/config.ts
@@ -12,6 +12,17 @@ const postsCollection = defineCollection({
}),
});
+const gistsCollection = defineCollection({
+ type: "content",
+ schema: z.object({
+ title: z.string(),
+ description: z.string().optional(),
+ date: z.string().optional(),
+ }),
+});
+
export const collections = {
posts: postsCollection,
+ gists: gistsCollection,
};
+
diff --git a/src/content/gists/countGoodNumbers.mdx b/src/content/gists/countGoodNumbers.mdx
new file mode 100644
index 0000000..131c9b3
--- /dev/null
+++ b/src/content/gists/countGoodNumbers.mdx
@@ -0,0 +1,24 @@
+---
+title: "countGoodNumbers.cpp"
+date: "07/10/2025"
+---
+
+```cpp
+class Solution {
+public:
+ static constexpr long long MOD = 1e9 + 7;
+ long long mpow(long long a, long long b, long long mod=MOD) {
+ long long ans = 1;
+ while (b > 0) {
+ if (b & 1) ans = (ans * a) % MOD;
+ a = (a * a) % MOD;
+ b >>= 1;
+ }
+ return ans;
+ }
+ int countGoodNumbers(long long n) {
+ long long even = (n + 1) / 2, odd = n / 2;
+ return (mpow(5, even) * mpow(4, odd)) % MOD;
+ }
+};
+```
diff --git a/src/pages/404.astro b/src/pages/404.astro
index 87c2b46..a2bd0d9 100644
--- a/src/pages/404.astro
+++ b/src/pages/404.astro
@@ -9,24 +9,29 @@ import BaseLayout from "../layouts/BaseLayout.astro";
+
diff --git a/src/pages/[category].astro b/src/pages/[category].astro
deleted file mode 100644
index 1eefc11..0000000
--- a/src/pages/[category].astro
+++ /dev/null
@@ -1,99 +0,0 @@
----
-import { getCollection } from "astro:content";
-import BaseLayout from "../layouts/BaseLayout.astro";
-
-export async function getStaticPaths() {
- const categories = ["algorithms", "software", "meditations"];
-
- return categories.map((category) => {
- return {
- params: { category },
- props: { category },
- };
- });
-}
-
-const { category } = Astro.props;
-const posts = await getCollection(
- "posts",
- (post) => post.data.category === category,
-);
-
-posts.sort((a, b) => {
- const dateA = a.data.date ? new Date(a.data.date) : new Date(0);
- const dateB = b.data.date ? new Date(b.data.date) : new Date(0);
- return dateB.getTime() - dateA.getTime();
-});
-
-const capitalizedCategory =
- category.charAt(0).toUpperCase() + category.slice(1);
----
-
-{capitalizedCategory}
-
+
+
+
+