Skip to content

Commit 2eeb2ef

Browse files
committed
feat: dump
1 parent 147fbfc commit 2eeb2ef

File tree

12 files changed

+81
-15
lines changed

12 files changed

+81
-15
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ lib-package = "site-frontend"
4949
site-root = "target/site"
5050
site-pkg-dir = "pkg"
5151

52-
style-file = "crates/site-app/style/main.scss"
52+
style-file = "crates/site-app/style/main.css"
5353
assets-dir = "crates/site-app/public"
5454

5555
site-addr = "127.0.0.1:3000"
5656
reload-port = 3001
5757

5858
browserquery = "defaults"
5959

60-
tailwind-input-file = "crates/site-app/style/main.scss"
60+
tailwind-input-file = "crates/site-app/style/main.css"
6161
tailwind-config-file = "crates/site-app/style/tailwind/tailwind.config.js"
6262

6363
# set by cargo-leptos

content/posts/a-new-rust-job-runner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "A New Rust Job Runner"
3-
written_on: "09/07/24"
3+
written_on: "2024.09.07"
44
public: false
55
---
66

content/posts/building-this-blog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Building this blog: A Space Odyssey"
3-
written_on: "28/01/24"
3+
written_on: "2024.01.28"
44
public: true
55
---
66

content/posts/fully-procedural-interactions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Fully Procedural Interactions in Games"
3-
written_on: "08/08/24"
3+
written_on: "2024.08.08"
44
public: true
55
---
66

content/posts/jsonp-who-asked.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: "jsonp - Who Asked?"
3+
written_on: "2024.11.23"
4+
public: true
5+
---
6+
7+
Often I need to prettify JSON.
8+
I probably don't need to justify that need to you.
9+
For many years I have used the site [jsonprettify.com](https://jsonprettify.com), which does the job well.
10+
It doesn't look quite how I would have it look, but it's fit for purpose and allows formatting at different levels of expansion.
11+
12+
Recently, I (mistakenly) thought it had gone down.
13+
This was most likely due to me misremembering the URL on a new machine that didn't remember it for me, but I'm in too deep now to back out anyways.
14+
15+
Finding my favorite tool missing, there's only one real solution.
16+
Build it myself.
17+
18+
## Down the hole
19+
20+
The construction started off pretty simple.
21+
I have been using Rust for the web for the last couple years, and though it changes frequently, I have found that temporarily forsaking JS has made it impossible to pick up again, so here we are.
22+
Leptos has been my tool of choice, and since I'm a Nix stan, I package it with Nix.
23+
All this I have been able to borrow from previous projects of mine.
24+
25+
The main functionality wasn't so difficult either.
26+
The only hurdle is trying not to perform too many copies and not to skip frames when dealing with large payloads.
27+
I found that the HTML `<textarea>` tag produces far more latency than my code when receiving a large payload anyways (about 12 frames at 60fps compared to my 3-4 frames), so I'm not too concerned about it.
28+
29+
`v0.1` was all well and good until I decided to deploy it.
30+
My tradition has been to build it into an OCI image using Nix and then ship it off to [Fly.io](https://fly.io) in a GitHub action, but this time I hesitated.
31+
I have been wanting to move to [CloudFlare Workers](https://workers.cloudflare.com/) as my primary Leptos deployment strategy, since it's free until 100,000 requests per month, and it fits most of my apps.
32+
33+
## Wrangling `wrangler`
34+
`wrangler` is a pain in my ass.
35+
It's the CF workers et al. deployment tool, and it's a JS app.
36+
It doesn't seem like there's a community effort to circumvent it at all.
37+
It itself is fine, but it's packaged poorly within Nix.
38+
On `aarch64-linux` (hello to my Asahi brothers), it doesn't build, complaining something about MUSL `libc.so.1` being missing.
39+
40+
After 15 wasted hours, I dropped it for a week.
41+
After a week, 10 minutes and 2 line additions fixed the problem.
42+
43+
I need to do more research on the `wrangler` build process so that I can squish it down into the Nix ecosystem and forget about it, but I'm satisfied for now.
44+
I need to let my executive energy regenerate before I return to this problem again.
45+
46+
## It works!
47+
This project -- dubbed `jsonp` but unrelated to the weird pre-CORS JS technique [JSONP](https://en.wikipedia.org/wiki/JSONP) -- is now live at [`https://jsonp.org/`](https://jsonp.org/).
48+
Feel free to use it, and direct your feedback to the [GitHub issues page](https://github.com/johnbchron/jsonp/issues).
49+
You can see the planned features there.
50+
51+
Thanks for reading!

content/posts/strongly-typed-ids-in-surrealdb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Strongly-typed IDs in SurrealDB"
3-
written_on: "18/03/24"
3+
written_on: "2024.03.18"
44
public: true
55
---
66

-1.68 MB
Binary file not shown.

crates/site-app/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ pub fn App() -> impl IntoView {
2929
rel="preload" href="/fonts/IosevkaCustom-Regular.ttf"
3030
as_="font" type_="font/ttf" crossorigin="anonymous"
3131
/>
32-
<leptos_meta::Link
33-
rel="preload" href="/fonts/IosevkaCustom-Bold.ttf"
34-
as_="font" type_="font/ttf" crossorigin="anonymous"
35-
/>
32+
// <leptos_meta::Link
33+
// rel="preload" href="/fonts/IosevkaCustom-Bold.ttf"
34+
// as_="font" type_="font/ttf" crossorigin="anonymous"
35+
// />
3636
<leptos_meta::Link
3737
rel="preload" href="/fonts/IosevkaCustom-Italic.ttf"
3838
as_="font" type_="font/ttf" crossorigin="anonymous"

crates/site-app/src/posts.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ pub async fn get_all_posts() -> Result<Vec<Post>, ServerFnError> {
8888
.collect::<String>();
8989
a.cmp(&b)
9090
});
91-
posts.reverse();
9291

9392
Ok(posts)
9493
}

crates/site-app/style/fonts.css

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
@font-face {
22
font-family: 'Iosevka Custom';
33
font-display: swap;
4-
font-weight: 100 900;
4+
font-weight: 400;
55
font-style: normal;
66
src:
7-
url('/fonts/IosevkaCustom-Regular.ttf') format('truetype')
8-
url('/fonts/IosevkaCustom-Bold.ttf') format('truetype')
7+
url('/fonts/IosevkaCustom-Regular.ttf') format('truetype');
8+
}
9+
10+
@font-face {
11+
font-family: 'Iosevka Custom';
12+
font-display: swap;
13+
font-weight: 400;
14+
font-style: italic;
15+
src:
916
url('/fonts/IosevkaCustom-Italic.ttf') format('truetype');
1017
}
1118

19+
@font-face {
20+
font-family: 'Iosevka Custom';
21+
font-display: swap;
22+
font-weight: 600;
23+
font-style: normal;
24+
src:
25+
url('/fonts/IosevkaCustom-Bold.ttf') format('truetype');
26+
}
27+
1228
@font-face {
1329
font-family: 'FiraSans';
1430
font-display: swap;

0 commit comments

Comments
 (0)