Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

Welcome to my little notes page for random notes.

This is just a mdbook of random notes that I may update if needed, for now it is intentionally minimal. (Credit to mdBook folks for awesome tool!)

Thanks for visiting, and please dont forget to support your community and donate to organizations like pancan (to help those sick with pancreatic cancer).

Thanks kindly!

Misc (How to edit the mdbook!)

  • Run command: cargo install mdbook && mdbook serve to generate ./book HTMLs.
  • Edit/Add Notes into Markdown Files in ./src ONLY WHILE mdbook serve IS RUNNING!!!!!
  • Then vi the SUMMARY.md or book.toml, and it will update left menu bar in real time, and create new md files in the menu bar.
  • Now, mdbook serve, should have updated the searchindex.js based on your markdown edits etc, so ctrl+c to close mdbook, and git commit em up!

Keyboard Shortcuts ⌨️

Anyone who knows me, knows I love webapps that fully support keyboard shortcuts. This book does so! Try typing the / character for example :P

ShortcutActionNotes
← (Arrow Left)Go to previous chapter/pageFast navigation
→ (Arrow Right)Go to next chapter/pageFast navigation
S or /Open search barInstantly search chapters
?Open shortcuts/help menuShows all shortcuts
EscClose help/search/menusQuick exit from overlays
Ctrl + EnterRun code block (if focused on interactive sample)For interactive Rust playgrounds

🕸️ webdev

Here are some of my favorite go-to websites for learning, referencing, and improving at modern web development.
I've added notes so I remember what each is best for.


📚 Learning & Documentation

  • MDN Web DocsThe holy grail of web dev references!!!!!!!!!! ALWAYS USE THI, i just type mdn.io in the browser too and it works well just like docs.rs essentially as a BROWSER URL. Official specs, browser compatibility tables, and detailed documentation for HTML, CSS, JS, APIs, and more.

  • The Modern JavaScript TutorialStart from scratch and master JavaScript, from fundamentals to advanced concepts like OOP, the DOM, and events.


🎨 Design & Assets

  • Favicon.io — Generate favicons from text, images, or emojis for your projects. Fast and free.

  • CSS-Tricks — Articles, tips, and guides covering everything from layout techniques to animations.

  • Frontend Mentor — Practice front-end skills by building real projects from design files.


🛠️ Tools & Playgrounds

  • CodePen — Live HTML, CSS, JS sandbox for quick prototyping and sharing.

  • JSFiddle — Another quick JS/CSS/HTML test environment.

  • Can I use — Check browser support for web features.


💡 Tip: Bookmark these, and keep your toolbox handy — having quick access to docs and tools saves hours every week. Really helpful DEFINITELY!

Google Fonts (Regular Best Way)

To use Google Fonts is...

  • navigate to fonts.google.com
  • pick a font
  • click get code
  • copy the header code into the <head>
  • apply the class to the html attribute you want, and look at the url to match the name as a font-family.

Google Fonts Helper Webpage (Alternative, easier)

To use the non-official "Google Webfonts Helper" webpage for self-hosting Google Fonts, follow these steps:

  • Visit the unofficial helper at gwfh.mranftl.com
  • Search for the Google Font you want.
  • Choose the character sets (Latin, Cyrillic, etc.) and select the font weights/styles you need (such as regular, bold, italic).
  • After choosing your styles and browser support level, click “Download” to get a ZIP of the font files (WOFF2, WOFF, etc.).
  • Extract and upload these font files to your web host or server, just as you would with other site assets (images, CSS, etc.).
  • Copy the CSS generated by the tool (provided on the website after you select your fonts).
  • Adjust the url() paths in the @font-face statements to match your file locations.
  • Paste this code in a CSS file that is loaded by your site.
  • Use standard CSS to apply your font, e.g.:
    body {
      font-family: 'Your Font Name', sans-serif;
    }
    

I think thats about it!

🦀 rustdev 🦀

These are little cool things I found on my Rust journey. Imho these are best-in-class tutorials, frameworks, and community-curated guides. I've grouped the links by what you might want to do—whether you're learning the language, building web apps, or exploring advanced topics.


🎓 Rust Language Learning


🌐 Web Development Frameworks & Guides

  • Actix Web
    Blazing fast, production-ready web framework. High performance, async-ready, and widely used in high-load scenarios.

  • Axum
    Modern, type-safe framework from the authors of Tokio. Clean API, async/await powered, and great for scalable services.

  • Leptos
    Minimalist and intuitive – good for beginners or hobby projects wanting a quick start.

  • Loco
    New full-stack framework inspired by Rails—batteries included, great for CRUD-heavy web apps.


🧩 Practice & Projects


💡 Extra Inspiration


🔔 Tip: Try building a tiny web API in each framework to see which fits your style.
Bookmark these, stay curious, and dig into community discussions—Rust moves fast, so keeping your notes up-to-date is key!

basic_rust_notes.md

Random notes...

cargo doc --open ---- this will open only the manpages of your current git project
Ownership BTW ONLY 0 MUTABLE REF to mem is allowed.md
Ownership Transfer to Functions for Heap stuff like string, but not ints.rs
reference is like a pointer but always guaranteed to point to valid memory
SemVer means Semantic versioning like rand -1.8.5.txt
unwrap() is same as expect() but wo msg

guessing_game.rs

fn main() {
    let mut s = String::from("hello");
    let r0 = &s; // no problem
    let r1 = &s; // no problem
    println!("{r0} and {r2}");
    println!("{r0} and {r2}");
    // Variables r0 and r2 will not be used after this point.
    let r2 = &mut s; // no problem
    println!("{r2}");
    let r3 = &s; // no problem
    println!("{r3}");
    println!("{r0} and {r2}"); //CANT USE BECAUSE ONCE YOU MAKE A MUT REF, IT CLOSD THE SCOP OF ALL
    //PREVIOUS REFS SO NOW YOU NEED TO MAKE A NEW REF MOVING FORWARD
}

ownership.rs

fn main() {
    let mut s = String::from("hello");
    let r0 = &s; // no problem
    let r1 = &s; // no problem
    println!("{r0} and {r2}");
    println!("{r0} and {r2}");
    // Variables r0 and r2 will not be used after this point.
    let r2 = &mut s; // no problem
    println!("{r2}");
    let r3 = &s; // no problem
    println!("{r3}");
    println!("{r0} and {r2}"); //CANT USE BECAUSE ONCE YOU MAKE A MUT REF, IT CLOSD THE SCOP OF ALL
    //PREVIOUS REFS SO NOW YOU NEED TO MAKE A NEW REF MOVING FORWARD
}

celc_to_fahr.rs

use rand::Rng;
fn main() {
    println!("enter celcius...");
    let mut target = String::new();
    std::io::stdin().read_line(&mut target).expect("io error");
    let target: f32 = target.trim().parse().expect("cant convert to FARENHEIGHT!");
    let faren = (target * 9.0 / 5.0) + 32.0;
    println!("Ok in FARENHEIGHT it is... {faren}");
}

actix_in_a_fn.rs

// Imports
use actix_web::{App, HttpResponse, HttpServer, web};

// Main function, literally all in one func, this is pretty cool for the lazy!
// There are 2 closures here for actix_web v4 in this example!
#[actix_web::main]
async fn main() {
    println!("Hello, world!");
    HttpServer::new(|| {
        App::new()
            .route("/", web::get().to(|| async {
                HttpResponse::Ok().body("hi, from main() lol!".to_string())
            }))
    })
        .bind("0.0.0.0:80")
        .unwrap()
        .run()
        .await
        .unwrap()
}

encode_a_msg.rs

#![allow(unused)]
fn main() {
// This was a cool example from https://doc.rust-lang.org/std/iter/trait.Iterator.html
let chars = ['g', 'd', 'k', 'k', 'n'];

let hello: String = chars.into_iter()
    .map(|x| x as u8)
    .map(|x| (x + 1) as char)
    .collect();

assert_eq!("hello", hello);
}