Skip to content

Instantly share code, notes, and snippets.

View blogscot's full-sized avatar

Iain Diamond blogscot

View GitHub Profile
@aidanhs
aidanhs / gist:5ac9088ca0f6bdd4a370
Last active March 19, 2024 16:01
Rust binary tree worked example

PLEASE DON'T USE THIS GUIDE

It's over 9 years old (as of 2024-02-18), there are many better guides! You might like https://rust-unofficial.github.io/too-many-lists/

% Let's build a binary tree!

Let's build a binary tree of strings in Rust. To recap, each node in a binary tree:

  1. must have a value
@nguyendangminh
nguyendangminh / favicon.ico.go
Last active August 21, 2023 16:05
Serve favicon.ico in Golang
...
func faviconHandler(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "relative/path/to/favicon.ico")
}
...
func main() {
http.HandleFunc("/favicon.ico", faviconHandler)
}