Skip to content

Instantly share code, notes, and snippets.

View notriddle's full-sized avatar

Michael Howell notriddle

View GitHub Profile
@notriddle
notriddle / rustdoc-html-user-roles.md
Last active March 22, 2024 17:06
Rustdoc (HTML) roles and priority of constituents

Introduction

Note: this is not a policy doc. At least, not yet.

This is a pile of notes that should probably be integrated into the rustc-dev-guide at some point. These roles, at least for me, inform where and how I've designed features and pages in rustdoc.

With these roles written down, I'm going to try to avoid referring to a "rustdoc user" most of the time, because that's not usually specific enough. Rustdoc has three interfaces, with three different audiences, who, sometimes, overlap.

My [cmark-gfm][^c].

My [cmark-gfm][cmark-gfm][^c].

My [cmark-gfm][][^c].

My [cmark-gfm] [^c].

My [cmark-gfm[^c]].

@notriddle
notriddle / README.md
Created June 1, 2023 20:32
test case for GFM footnotes

Footnotes 1 [^many].

Footnotes

  1. first paragraph inside footnote

@notriddle
notriddle / README.md
Last active May 6, 2023 08:24
The hub workflow

How to use hub's PAT for user accounts

$ git config --global hub.protocol https
$ cat ~/.config/hub
github.com:
- user: notriddle
  oauth_token: [CENSORED]
  protocol: https
$ cat > ~/.netrc
@notriddle
notriddle / mix_vs_cargo.md
Last active June 28, 2022 06:45
Language package managers: Elixir's mix and Rust's cargo
Action Mix Cargo
Create a project mix new [--app APP] PATH cargo new [--bin] PATH
Run your project iex -S mix / mix run --no-halt / mix phoenix.server cargo run
Get help mix help cmd cargo [cmd] --help
Build configuration mix.exs Cargo.toml
Project commands mix COMMAND N/A
Global add-on commands mix archive.install PACKAGE cargo install PACKAGE
Integrating with other languag
@notriddle
notriddle / diffpkg.bash
Last active February 15, 2022 21:34
A basic script I wrote for myself to compare package versions
#!/bin/bash
print-usage-and-die() {
echo "Usage: diffpkg.bash [cargo|npm] [pkg1] [pkg2]"
echo " pkg1 and pkg2 can have formats NAME-VERS, NAME@VERS, NAME:VERS, or NAME=VERS"
exit 1
}
extract-name() {
case "$1" in
@notriddle
notriddle / index.md
Last active March 12, 2021 19:57
How to speed up rustdoc in 2021

By "rustdoc", I mean the API documentation webapp used by Rust. The Book is rendered using a different application, called mdBook, and only some of this advice is really applicable to it.

I hope you take my copycat txties as the compliment that I intend, by the way.

Step 1: get the rust toolchain

The first step is to get the Rust code. To help compare the old version with the new one, I set up a separate worktree for the new version, and keep the old version around. It's a lot like cloning the repository twice, but it doesn't require two downloads.

user=notriddle

cd ~/Development

@notriddle
notriddle / filter-well-behaved-robots.sh
Last active March 5, 2020 20:57
Sorts out the unique non-robot IP addresses that requested style.css
#!/bin/sh
# The first step is to get a list of robot IP addresses
# We stash it in a file for later
awk -F' ' '/robots.txt/ {print $1}' /var/log/nginx/access.log.1 | sort | uniq > robots-ips.txt
# Also add a few known bots that don't necessarily get robots.txt from the same IP
grep -iE '(bingbot|BingPreview|msnbot|adbeat|ArchiveBot|YandexBot|Googlebot|Pinterestbot|Spider)' /var/log/nginx/access.log.1 | awk -F' ' '{print $1}' | sort | uniq > robots-ips.txt # The second step is to get a list of non-robot IP addresses
# This one is comparatively complicated, so let's dissect my awk syntax
# NR==FNR -- FNR is the line number ("record number") in the current file, while NR is the line number processed in total. If these are equal, then we're on the current file. # {a[$1]=1;next} -- we want to load the robots-ips.txt file into an array, a
@notriddle
notriddle / notriddle-rust-2020.md
Last active October 31, 2019 20:13
@notriddle's Rust 2020 wishlist, or, Rust 2021: Integration

@notriddle's Rust 2020 wishlist

or, Rust 2021: Integration

This is just a brain dump. Doing all of this is not going to happen, but all of it is stuff I know of that impacts Rust's integration with the rest of the world and eventually becoming Too Big To Fail like C++ is.

Better resources outside the Rust core team's reach

  1. Improved support for vendored, external, and non-crates.io crates. Some of it is just a matter of documenting the workarounds to allow cargo to use local git repositories in place of networked ones. Some of it is providing official, documented registry software.
  2. Improved support for third-party discussion and documentation platforms. I love Users and Internals, and I can deal with Discord, but these are platforms specifically for discussing Rust. What we need is greater presence on platforms that are dedicated to problem domains: database courses