Git Product home page Git Product logo

noboilerplate's Introduction

Code for my talks on the No Boilerplate channel is in scripts/

I build these using obsidian.md and the advanced-slides plugin: I take each slide, printscreen it, and splice it with my audio using reaper.fm.


Screenshot from 2022-07-13 17-49-52

Recommended Rust Reading

Here are some great resources that I used to teach myself:

Have fun, and good luck!

noboilerplate's People

Contributors

0atman avatar jlucktay avatar laundmo avatar nerdknight66 avatar quentinn42 avatar theendsofinvention avatar timothymalahy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

noboilerplate's Issues

Create LICENSE.md

https://github.com/0atman/noboilerplate/blob/main/scripts/36-Linux-Workstations.md#public-domain-videos

All of your videos have this section near the beginning of them. Despite this, there isn't actually a LICENSE file in this GitHub repo. The Creative Commons logo doesn't explicitly refer to any specific license. Based on the phrase 'public domain license' I could make the assumption that you mean CC0 but that likely wouldn't hold up in court. Please add an explicit license file, thank you.

typo in CODE_OF_CONDUCT.md

Thank you for the YouTube content! I was browsing here and found there are 3 occurrences of "No Noilerplate" in the CODE_OF_CONDUCT.md file.

Poem API demo doesn't work

Description of the problem

I tried to get something going using The Stack, and tried using https://github.com/0atman/noboilerplate/blob/main/scripts/30-poem.md as a base. When running cargo run the programme won't even compile.

Steps to reproduce

  1. Create a new cargo project.
  2. Set up the sqlite3 database.
  3. Paste the dependencies into Cargo.toml.
  4. Paste the imports and code into main.rs.
  5. Run cargo run on the terminal

Expected behaviour

The programme runs and an API is served on 127.0.0.1:3000.

Actual behaviour

Rustc fails to compile the programme, returning the following errors:

error[E0308]: mismatched types
  --> src/main.rs:45:25
   |
45 |               let todos = sqlx::query_as!(
   |  _________________________^
46 | |             Todo,
47 | |             "SELECT * FROM todos"
48 | |         )
   | |_________^ expected `i64`, found `Option<i64>`
   |
   = note: expected type `i64`
              found enum `std::option::Option<i64>`
   = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_as` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
  --> src/main.rs:45:25
   |
45 |               let todos = sqlx::query_as!(
   |  _________________________^
46 | |             Todo,
47 | |             "SELECT * FROM todos"
48 | |         )
   | |_________^ expected `String`, found `Option<String>`
   |
   = note: expected struct `std::string::String`
                found enum `std::option::Option<std::string::String>`
   = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_as` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
  --> src/main.rs:45:25
   |
45 |               let todos = sqlx::query_as!(
   |  _________________________^
46 | |             Todo,
47 | |             "SELECT * FROM todos"
48 | |         )
   | |_________^ expected `bool`, found `Option<bool>`
   |
   = note: expected type `bool`
              found enum `std::option::Option<bool>`
   = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_as` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `Option::is_some` to test if the `Option` has a value
  --> /home/nico/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-0.6.3/src/macros/mod.rs:558:82
   |
558|         $crate::sqlx_macros::expand_query!(record = $out_struct, source = $query).is_some()
   |                                                                                  ++++++++++

error: future cannot be sent between threads safely
   --> src/main.rs:22:1
    |
22  | #[OpenApi]
    | ^^^^^^^^^^ future created by async block is not `Send`
    |
note: opaque type is declared here
   --> src/main.rs:44:10
    |
44  |     ) -> TodoResponse {
    |          ^^^^^^^^^^^^
note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
   --> src/main.rs:22:1
    |
22  | #[OpenApi]
    | ^^^^^^^^^^
note: future is not `Send` as it awaits another future which is not `Send`
   --> src/main.rs:22:1
    |
22  | #[OpenApi]
    | ^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<poem_openapi::payload::Json<Vec<Todo>>, poem::Error>>`, which is not `Send`
note: required by a bound in `poem::endpoint::make`
   --> /home/nico/.cargo/registry/src/index.crates.io-6f17d22bba15001f/poem-1.3.58/src/endpoint/endpoint.rs:168:31
    |
165 | pub fn make<F, Fut, T, R>(f: F) -> impl Endpoint<Output = T>
    |        ---- required by a bound in this function
...
168 |     Fut: Future<Output = R> + Send,
    |                               ^^^^ required by this bound in `make`
    = note: this error originates in the attribute macro `OpenApi` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0308`.
error: could not compile `todo-api` (bin "todo-api") due to 4 previous errors

Link to the video from each script?

When I link someone to a script, I also have to separately link them to the corresponding video. Would it make sense to include a video link at the top of each script file, for discoverability while browsing?

Subtitles for videos based on scripts

I've been working on rust project to convert the markdown scripts and convert it to a text file which can be added to the youtube video with the auto-sync feature. Should I create a pull request with the project and where should I put it (in the scripts folder)?

Thread panic on station breakdown

Issue:

thread 'main' panicked at 'called Result::unwrap() on an Err value: InvalidConfiguration("Available options can not be empty")

Steps to reproduce:

Continually select "SCIENCE" on each day without repairing. About 50% of the time the thread panics. The other half, the game ends normally.

Possible explanation:

When the number of active sections is down to 1 and "NEW DAY" is selected there is a chance the final section breaks. If this occurs the user still has the opportunity to select "SCIENCE" but there are no active sections to enumerate in the menu.

Issues I had with literate while trying to build your slides

Hey there. First time doing anything at all with Rust, your videos came up in the ol recommended feed and they're very friendly and affirming, it's a great presentation style.
Did everything in your Rust lightsaber video, love neovide, thanks for the tip there. Tried to build your slides here, ran into issues with literate that could benefit from some notes in scripts/readme.md. The main ones being:

  • literate doesn't have docs on how to build the cli binary
  • cargo install wouldn't install literate without a Cargo.toml file which literate was meant to generate
  • after cloning the literate-rs repo and running cargo build and cargo install, it still didn't create the binary
  • eventually i ran cargo run and it said i needed to build it again with --features=cli, this wasn't documented anywhere upstream that i could find, maybe it's common knowledge among rust developers
  • once i ran cargo install --release --features=cli in the literate-rs directory, it was finally installed

i'm assuming the one command needed to get this to work in the first place was cargo install literate --features=cli. After this and installing cargo-script, which went smoothly, the rust lightsaber markdown document is now compiling via make build.

Obsidian Wiki Style Links don't render correctly on GitHub, Gitlab, Pandoc

Heyo!

I've been a fan of both your channel and obsidian for a while now and I have noticed the following issue.

When storing Obsidian's markdown in places like GitHub and co, which all provide a markdown viewer they unfortunately cannot render the "wikilink" style notation of obsidian flavoured markdown

These just render as regular text:

[[www.google.com]] or [[www.google.com |link to google]]

![[https://github.com/0atman/noboilerplate/assets/16562333/c5d35f9e-f257-4a32-ae29-b05fdca507a0]]

[[www.google.com]] or [[www.google.com |link to google]]

![[https://github.com/0atman/noboilerplate/assets/16562333/c5d35f9e-f257-4a32-ae29-b05fdca507a0]]

But the standard markdown syntax shows up just fine:

<https://google.com>

[link to google[(https://peertube.be/w/v8w9Px3AvSMp7gF827JuPg?autoplay=1)

![image](https://github.com/0atman/noboilerplate/assets/16562333/c5d35f9e-f257-4a32-ae29-b05fdca507a0)

https://google.com

link to google

image

more examples:

especially the width assignment with the [[...|500]] you can forget...

image

image

The same issue has been occuring to me when trying to generate nice PDFs with a latex pandoc template, since pandoc also doesn't like those links.

the options to mee seem to be:

  • Write a browser extension to patch the GitHub UI rendering until official channels fix it (probably never)
  • write a lua or json filter for pandoc that converts the wiki style links to markdown links but that seems like a bunch of work ๐Ÿ˜…
    • but honestly getting some tree traversal practice couldnt hurt :P
  • The obsidian output to pdf function obviously works like a charm, but doesn't allow me to use filters and latex templates to create indexes, toc, title pages and so on.
    • For a start it would be nice to change the default template for pdf export.

Do you have any Ideas on this?

Cheers,
K1ngjulien

CSS for Advanced Slides

Hey @0atman,

I've been having a look over at Advanced Slides for Obsidian and I'm loving it! You seem to be using the black theme for it, but I can't quite work out what your highlight theme. Is it something custom? I'm just asking because the default themes don't appear to cut the mustard for code highlighting.

If you don't want to share, then no worries!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.