hjr3
Repos
77
Followers
167
Following
15

Parse the `/proc/net/softnet_stat` file into something more readable.

23
5

A timeout connector for the hyper client

21
5

Events

Move sdkman into narvar zsh setup

Include narvar specific configuration

Created at 4 days ago

Rust analyzer uses clippy instead of check

Share command history between sessions

Sync Brewfile with actual installed casks/formulae/images/taps

Prune Brewfile

Fix sdkman slowness

Created at 4 days ago

Enable auto-formatting

JavaScript autoformatting works via null-ls. Everything else would use this.

Format init.lua

Stop using jenv

Created at 6 days ago

Switch to kickstart.nvim

Add null-ls support for prettier, eslint, shellcheck

Created at 2 weeks ago
pull request opened
Fix build errors in Server Side Components docs

We add some cargo commands to fix dependency issues when building.

Created at 2 weeks ago
create branch
hjr3 create branch fix-build-errors
Created at 2 weeks ago
Change "actix-server" to "axum-server" in docs

Thinking about this more, Cargo.toml should look like:

[workspace]
members = [
    "crates/*",
]

so maybe this whole section can be removed?

Created at 2 weeks ago
pull request opened
Change "actix-server" to "axum-server" in docs

This is how https://rust-on-nails.com/docs/full-stack-web/server-side-components/ currently looks:

Screen Shot 2023-03-11 at 1 24 04 PM

Created at 2 weeks ago
create branch
hjr3 create branch axum-server-typo
Created at 2 weeks ago
Support published ports

First, thank you for start this project.

I think most VSCode users are using https://code.visualstudio.com/docs/devcontainers/containers#_temporarily-forwarding-a-port to forward port 3000 to their host machine. I am not using VSCode for my dev container setup though.

To get my setup working, I have to make the following changes:

Publish container port 3000 to host IP 127.0.0.1, port 3000.

--- a/.devcontainer/docker-compose.yml
+++ b/.devcontainer/docker-compose.yml
@@ -13,10 +13,12 @@ services:
       retries: 5

   development:
-    build:
+    build:
       context: .
       dockerfile: Dockerfile
-
+    ports:
+      - "127.0.0.1:3000:3000"
+
     volumes:
       - ..:/workspace:cached
       # Give access to ssh keys on the host (Is there a better way to do this?)

Make the server inside the container accept connections on all (virtual) interfaces rather than just the container's localhost (127.0.0.1).

--- a/crates/axum-server/src/main.rs
+++ b/crates/axum-server/src/main.rs
@@ -19,7 +19,7 @@ async fn main() {
         .layer(Extension(pool.clone()));

     // run it
-    let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
+    let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
     println!("listening on {}", addr);
     axum::Server::bind(&addr)
         .serve(app.into_make_service())

From a Microsoft/GitHub developer:

Our examples show using 0.0.0.0 instead of localhost ...

source

This was in 2019 though and I know they have since separated the notion of always forward a port and publish a port.

I absolutely understand if you want to leave things as is. If so, this can serve as guidance for anyone else who runs into this issue.

Created at 2 weeks ago
pull request opened
fix: Remove extra markdown code fence in docs
Created at 2 weeks ago
create branch
hjr3 create branch fix-db-access-syntax-error
Created at 2 weeks ago

Prevent .git directory in crates/axum-server

Running the command "cargo new crates/axum-server" will create crates/axum-server/.git as a side-effect. When we later run "git add ." we will see this message:

error: 'crates/axum-server/' does not have a commit checked out

Using the --vsc=none flag will omit the .git directory.

Created at 2 weeks ago
Prevent .git directory crates/axum-server

Log of how I got the error:

/workspace
$ git init
Initialized empty Git repository in /workspace/.git/
/workspace
$ cargo new crates/axum-server
     Created binary (application) `crates/axum-server` package
/workspace
$ git add .
error: 'crates/axum-server/' does not have a commit checked out
fatal: adding files failed

With the updated docs:

/workspace
$ git init
Initialized empty Git repository in /workspace/.git/
/workspace
$ cargo new --vcs=none crates/axum-server
     Created binary (application) `crates/axum-server` package
/workspace
$ git add .
$ git status
On branch main

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
	new file:   .devcontainer/.bash_aliases
	new file:   .devcontainer/Dockerfile
	new file:   .devcontainer/devcontainer.json
	new file:   .devcontainer/docker-compose.yml
	new file:   .devcontainer/ps1.bash
	new file:   .gitignore
	new file:   Cargo.lock
	new file:   Cargo.toml
	new file:   README.md
	new file:   crates/axum-server/Cargo.toml
	new file:   crates/axum-server/src/main.rs
Created at 2 weeks ago
pull request opened
Prevent .git directory crates/axum-server

Running the command "cargo new crates/axum-server" will create crates/axum-server/.git as a side-effect. When we later run "git add ." we will see this message:

error: 'crates/axum-server/' does not have a commit checked out

Using the --vsc=none flag will omit the .git directory.

Created at 2 weeks ago
create branch
hjr3 create branch fix-cargo-new
Created at 2 weeks ago
Created at 2 weeks ago
Created at 2 weeks ago

prefer fnm instead of nvm

support sdkman

Fix issue with lack of history in zsh

Created at 2 weeks ago
ARM64 Devcontainer

We should be able to do this using docker buildx for multi-platform builds.

Example:

$ cd /path/to/rust-on-nails
$ docker buildx build --platform linux/arm64 nails-devcontainer
 ...
 => => writing image sha256:5c9c95cb837f7e6d2c447dbe5a614e8726ba6ee336f49416f840c3431bba27b9
$ docker image inspect --format "{{.Architecture}}" 5c9c95cb837f7e6d2c447dbe5a614e8726ba6ee336f49416f840c3431bba27b9
arm64

See https://docs.docker.com/build/building/multi-platform/ for more information.

I also opened https://github.com/purton-tech/rust-on-nails/pull/27 to resolve one issue I ran into when building an arm64 target.

Created at 2 weeks ago
pull request opened
Use cargo sparse registry in dev container

For arm64 builds, cargo uses all available memory and often gets killed by the OS. Rust v1.68 has stable support for the sparse registry protocol, which uses much less memory.

Relates to https://github.com/purton-tech/rust-on-nails/issues/14

Created at 2 weeks ago
create branch
hjr3 create branch support-cargo-sparse-registry
Created at 2 weeks ago
Created at 2 weeks ago
issue comment
Can no longer use lerna publish, fails with error

I ran into this error due to an empty string at the end of the publish command:

lerna publish --yes --npm-tag latest --repo-version 1.0.0 '' - notice the '' at the end.

The above publish command was generated inside a bash function that sometimes took a parameter:

lerna_publish_to () {
  lerna publish --yes --npm-tag latest --repo-version 1.0.0 "$1"
}

When the parameter was not included in the function call, we get the above command and lerna throws the error.

lerna_publish_to --skip-git # works
lerna_publish_to # fails

The fix is some arcane bash:

lerna_publish_to () {
  lerna publish --yes --npm-tag latest --repo-version 1.0.0 ${1:+"$1"}
}
Created at 1 month ago
pull request opened
fix(website): update link to defer and stream RFC
Created at 1 month ago

fix(website): update link to defer and stream RFC

Created at 1 month ago
Created at 1 month ago

Deploy hjr3/hjr3.github.io to hjr3/hjr3.github.io:gh-pages

Created at 2 months ago

Add desk to Uses section

Created at 2 months ago
Cannot install Apollo on Node 18

But I know they're looking at only providing minimal support for this package because they plan to deprecate it.

How do we know they are planning to deprecate it?

Created at 2 months ago