From b6f7b9dda8cd2e4b1c5b006ad5866d3ef7e62310 Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Sat, 19 Sep 2026 21:13:32 -0500 Subject: inserting link:css via javascript was a bad idea --- .gitmodules | 3 - README.md | 2 - _template.html | 20 ----- article.css | 6 +- article.js | 93 -------------------- devshell.html | 98 +++++++++++++-------- fib.html | 21 ++++- forgejno.html | 24 +++-- index.html | 10 ++- net.html | 42 ++++++--- no_ai.html | 9 +- reversible.html | 269 +++++++++++++++++++++++++++++++------------------------- reversible.rs | 158 --------------------------------- soplt.html | 214 ++++++++++++++++++++++++-------------------- static | 2 +- writing.html | 14 +-- 16 files changed, 417 insertions(+), 568 deletions(-) delete mode 100644 .gitmodules delete mode 100644 README.md delete mode 100644 _template.html delete mode 100644 article.js delete mode 100644 reversible.rs diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 22c81ad..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "static"] - path = static - url = https://git.collin.williamsfam.us.com/shared-assets diff --git a/README.md b/README.md deleted file mode 100644 index 3b95297..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# This is the code for my website -2 diff --git a/_template.html b/_template.html deleted file mode 100644 index 65cedc6..0000000 --- a/_template.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Title - - - - - -
-
- -

- lorem ipsum -

-
- - \ No newline at end of file diff --git a/article.css b/article.css index f3fc047..7df5836 100644 --- a/article.css +++ b/article.css @@ -39,12 +39,12 @@ article { header { display: flex; flex-direction: column; - gap: var(--sx); + gap: 1rem; .header-top { display: flex; align-items: flex-start; - gap: var(--sx); + gap: 1rem; } .header-logo-link { @@ -72,7 +72,7 @@ header { } time { - line-height: var(--lh); + line-height: 1.5; margin: 0; } diff --git a/article.js b/article.js deleted file mode 100644 index ecf2d40..0000000 --- a/article.js +++ /dev/null @@ -1,93 +0,0 @@ -function addMetadata() { - // Favicon - const favicon = document.createElement("link"); - favicon.rel = "icon"; - favicon.href = "static/Logo.svg"; - favicon.type = "image/svg+xml"; - document.head.appendChild(favicon); - - // UTF-8 (for special characters) - const charset = document.createElement("meta"); - charset.setAttribute("charset", "UTF-8"); - document.head.appendChild(charset); - - // viewport (for mobile) - const viewport = document.createElement("meta"); - viewport.setAttribute("name", "viewport"); - viewport.setAttribute("content", "width=device-width, initial-scale=1.0"); - document.head.appendChild(viewport); - - // css - const proseCss = document.createElement("link"); - proseCss.rel = "stylesheet"; - proseCss.href = "article.css"; - document.head.appendChild(proseCss); -} - -function addHeader() { - const header = document.querySelector("header"); - - const headerTop = document.createElement("div"); - headerTop.classList.add("header-top"); - - const logoLink = document.createElement("a"); - logoLink.href = "writing"; - logoLink.classList.add("header-logo-link"); - headerTop.appendChild(logoLink); - - const info = document.createElement("div"); - info.classList.add("header-info"); - const h1 = document.createElement("h1"); - h1.textContent = document.title; - info.appendChild(h1); - const time = document.createElement("time"); - const metaDate = document.querySelector('meta[property="article:published_time"]'); - const dateString = metaDate.getAttribute("content"); - const displayDate = (new Date(dateString)).toLocaleDateString("en-US", { - month: "short", - day: "numeric", - year: "numeric", - timeZone: "UTC" - }); - time.setAttribute("datetime", dateString); - time.textContent = `Published ${displayDate}`; - info.appendChild(time); - headerTop.appendChild(info); - header.appendChild(headerTop); - - const hr = document.createElement("hr"); - header.appendChild(hr); -} - -function addTOC() { - const tocDiv = document.getElementById("toc"); - if (!tocDiv) return; - - const tocHeading = document.createElement("h2"); - tocHeading.textContent = "Table of Contents"; - tocDiv.appendChild(tocHeading); - - const toc = document.createElement("ul"); - - document.querySelectorAll('article :is(h1, h2, h3, h4, h5, h6):not(header *, #toc *)').forEach(heading => { - const link = document.createElement("a"); - link.href = "#" + heading.id.toLowerCase(); - link.textContent = heading.textContent; - - const li = document.createElement("li"); - li.appendChild(link); - - toc.appendChild(li); - }); - - tocDiv.appendChild(toc); -} - -document.addEventListener("DOMContentLoaded", () => { - addMetadata(); - addHeader(); - addTOC(); - - const article = document.querySelector('article'); - article.classList.add('markdown-body'); -}) diff --git a/devshell.html b/devshell.html index 59b36af..899e862 100644 --- a/devshell.html +++ b/devshell.html @@ -1,32 +1,51 @@ + + + + + A solution to slow nix-shells - - -
-
+
+
+
+ +
+

A solution to slow nix-shells

+ +
+
+
+

- Tired of waiting for nix-shell to re-download github:NixOS/nixpkgs after you nix-collect-garbage (or just randomly sometimes)? + Tired of waiting for nix-shell to re-download github:NixOS/nixpkgs after you nix-collect-garbage (or just randomly sometimes)? Me too! That's why I went down this rabit hole of making an instant nix shell.

-
+

Table of Contents

+ +

What's wrong with nix-shell?

First, let's clarify what I mean by a nix shell. I'm simply referring to the idea of hiding the packages that you use for development behind a command, and managing those packages using nix. - Most people are familiar with this through the nix-shell or nix shell commands. + Most people are familiar with this through the nix-shell or nix shell commands. (For non-nix people, yes those are in fact two very different things)

- My issue with how nix shell is that it has to redownload your packages if they're not in the nix store (one cause of this would be if you recently ran nix-collect-garbage), and it has to re-evaluate the correct environment variables and packages every time you launch the shell. - These two things together mean that every time you run nix shell, you'll be waiting before you can access those packages. + My issue with how nix shell is that it has to redownload your packages if they're not in the nix store (one cause of this would be if you recently ran nix-collect-garbage), and it has to re-evaluate the correct environment variables and packages every time you launch the shell. + These two things together mean that every time you run nix shell, you'll be waiting before you can access those packages. And, personally, I'd rather spend my time waiting for my code to compile, not waiting to have access to my compiler.

@@ -35,21 +54,21 @@ There's a lot of existing solutions to this problem, but none of them do exactly what I want.

- I used to be a big fan of cached-nix-shell. + I used to be a big fan of cached-nix-shell. It's cool because it (as the name suggests) caches your nix shell, so the next time you start it up, the launch time is instant (it removes the second factor of waiting mentioned in the previous section). But for some reason it breaks for certain packages that rely on paths that might not exist anymore. - For example, I had issues with rustc not working when launched through cached-nix-shell if it was using a cached version. + For example, I had issues with rustc not working when launched through cached-nix-shell if it was using a cached version.

- Another solution that I think too many people fall for is to just install the packages into your system $PATH with environment.systemPackages. + Another solution that I think too many people fall for is to just install the packages into your system $PATH with environment.systemPackages. One of the great things about NixOS is that you don't have to resort to this! - On Arch, if you install a package with pacman, it has to go into your system $PATH. + On Arch, if you install a package with pacman, it has to go into your system $PATH. But on NixOS, we don't have to bloat the system path with our developer dependencies. - This is exactly why nix-shell exists in the first place! + This is exactly why nix-shell exists in the first place!

- The most hardcore-nix-nerd option here is to manually mark your nix-shell as a GC root. - This tells nix-collect-garbage to not remove the path or anything that it depends on, preserving your nix-shells through garbage collection. + The most hardcore-nix-nerd option here is to manually mark your devshell as a GC root. + This tells nix-collect-garbage to not remove the path or anything that it depends on, preserving your devshells through garbage collection. Maybe some day I'll write my own tool that wraps this functionality to provide GC-protected nix shells, but honestly that just sounds like too much work. (for more information about how Garbage Collection works on Nix, check out the Nix Pill about the Garbage Collector)

@@ -64,34 +83,34 @@ In your NixOS config, using home-manager or hjem or whatever, just build a package that launches your shell but with some extra programs.

-
{pkgs, ...}: let
-  rust-shell = let
-    rustProfile = pkgs.buildEnv {
-      name = "rust-profile";
-      paths = with pkgs; [rustc cargo rust-analyzer];
+			
{pkgs, ...}: let
+  rust-shell = let
+    rustProfile = pkgs.buildEnv {
+      name = "rust-profile";
+      paths = with pkgs; [rustc cargo rust-analyzer gcc];
     };
-  in
-    pkgs.writeShellScriptBin "rust-shell" ''
-      export PATH="${rustProfile}/bin:$PATH"
+  in
+    pkgs.writeShellScriptBin "rust-shell" ''
+      export PATH="${rustProfile}/bin:$PATH"
       exec $SHELL
-    '';
+    '';
 
-  py-shell = let
-    pythonProfile = pkgs.python314.withPackages (ps:
-      with ps; [
-        numpy
-        matplotlib
-        pandas
-        jupyter
-        ipython
+  py-shell = let
+    pythonProfile = pkgs.python314.withPackages (ps:
+      with ps; [
+        numpy
+        matplotlib
+        pandas
+        jupyter
+        ipython
       ]);
-  in
-    pkgs.writeShellScriptBin "py-shell" ''
-      export PATH="${pythonProfile}/bin:$PATH"
+  in
+    pkgs.writeShellScriptBin "py-shell" ''
+      export PATH="${pythonProfile}/bin:$PATH"
       exec $SHELL
-    '';
-in {
-  packages = [rust-shell py-shell];
+    '';
+in {
+  packages = [rust-shell py-shell];
 }

Thoughts

@@ -121,6 +140,7 @@ in { In my examples, the Rust one isn't that bad, but the Python one pulls in hundreds of python dependencies into the system closure. This can make rebuilds longer (when the packages need to update) and take up more space on your computer.

+

Even with these trade-offs, I'm willing to pay the price to have instantaneous access to my developer dependencies!

diff --git a/fib.html b/fib.html index a5121d7..e9d93c9 100644 --- a/fib.html +++ b/fib.html @@ -1,13 +1,25 @@ + + + + + I accidentally derived a formula for the Fibonacci Sequence - - -
-
+
+
+
+ +
+

I accidentally derived a formula for the Fibonacci Sequence

+ +
+
+
+

Last night my brother pitched me this math problem over dinner (which he later revealed came from this video). It goes something like this:

@@ -322,3 +334,4 @@
+ diff --git a/forgejno.html b/forgejno.html index 100c606..97ec15d 100644 --- a/forgejno.html +++ b/forgejno.html @@ -1,20 +1,30 @@ + + + + + You don't need Forgejo -
-
+
+
+
+ +
+

You don't need Forgejo

+ +
+
+
+

- People - ditching - GitHub after - recent issues - are looking to self-hosting Forgejo as an alternative. + People ditching GitHub after recent issues are looking to self-hosting Forgejo as an alternative.

Despite some (poorly disclosed) security issues, I think there's a more fundemental reason why you shouldn't use Forgejo.

If you're just a single person trying to publish your independent coding projects, why do you need: CI, Issue Tracking, Pull Requests, Multi-user account management, etc?

diff --git a/index.html b/index.html index 3a6b2e8..ffbafd0 100644 --- a/index.html +++ b/index.html @@ -3,12 +3,13 @@ + + Collin Williams + - +