Avatar
Mo Bitar :ferris:
979383f8767c5d795fcad86f82dc7b38b384c1a473710c433014dc2c0fb0e359
PhD student in programming language research @ KIT, Germany 💻️ #Rustlings maintainer 🦀 I post about … :ferris: #RustLang :tux: #Linux :opensource: #FOSS I only follow people with a technical feed. Don't take it personally if I unfollow 🤗

nostr:npub18wpm7rn8f5tuvuls39hlam6pepzs6qcf4g2wuvqxjvjmfw3qckxsxk8v8s I will give a Linux and a Rust course and I am writing a CLI that does automated checking of tasks that students should do. When they have done the task right, a collective score of the course is raised :D

Kind of automation and gamification of tasks :D

Replying to a5386d19...

nostr:npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg The docs in your previous link say "Conversely, the functionality in reqwest::blocking must not be executed within an async runtime, or it will panic when attempting to block. If calling directly from an async function, consider using an async reqwest::Client instead.".

nostr:npub1hjwdnmduf4w67dx22ft7kkcltymgeswz9k5qdrqsc7qch5zxkv7sxfagxz You should in general not block in an async function, but I don't know why it would panic 😅

Replying to 790a31ec...

Did you know that the great http://pola.rs #rustlang library has a #cli application that lets you run SQL queries over files (csv, json, parquet) and databases? https://github.com/pola-rs/polars/tree/main/polars-cli

Replying to Avatar Anachron :void:

nostr:npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg I hope this is only a test... I dont like a rainbow every line.

Also please respect the NOCOLOR env variable! :)

Ended up using yansi (1.0.0-rc) for colored terminal output 🎨

https://github.com/SergioBenitez/yansi

Coloring the terminal is fun! :blobcathearteyes:

#RustLang #Rust

nostr:npub1z70sk8dp9daycrrpg4xwss9t0cujpxat5u6ynxc9yy2tvraw890sqgjtuz Never mind, I did just switch to yansi (1.0.0-rc) since it supports everything colored does, but it does not only work on strings! This means that I can use it with the debug formatter {:?}

I did delete my post about the synchronous HTTP client `ureq`. Why reinvent the wheel when `reqwest` already has a blocking API?

https://docs.rs/reqwest/latest/reqwest/blocking/index.html

This means that you can use `reqwest` for async and sync applications. Profit from the strong ecosystem around hyper :D

#RustLang #Rust

Replying to Avatar Southern Wolf

nostr:npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg Ah gotcha! Was gonna say you can do that styling in Alacritty, but you want to shell itself to be coloured.

I'll have to check those packages out later and see! Be curious if you land on a good one. :blobfoxcomputer:

nostr:npub1z70sk8dp9daycrrpg4xwss9t0cujpxat5u6ynxc9yy2tvraw890sqgjtuz Went with colored in case you are interested :D

Replying to Avatar laund

nostr:npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg hmmm what advantage does this have over reqwests sync API?

nostr:npub19pgazvl0rfwjlf057k2q8ss3s8vxgvc8qsl0s6w8yx4lzv9yggmqtyygka Good question. I thought that the blocking version of reqwest would use the tokio runtime under the hood which would be a big overhead. But now that you asked, I did check it again and that does not seem to be the case. ureq is just reinventing the wheel? A good simple crate to study HTTP clients, I guess. Deleting the original post ;)

Replying to Avatar Southern Wolf

nostr:npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg Nice, and yeah Reqwest is top tier for sync https stuff. Gloo-Net is a great choice for front-end/WASM stuff as well.

nostr:npub1z70sk8dp9daycrrpg4xwss9t0cujpxat5u6ynxc9yy2tvraw890sqgjtuz Yes. I am not looking for a terminal, I am looking for crate that produces colored terminal output.

Why do we have at least three crates that seem to do the same thing? :blobcatsadpats:

I want terminal colors and found these three crates:

- colored

- yansi

- owo-colors

Any recommendation? :blobthinkingeyes:

#RustLang #Rust

`ureq` is an awesome sync #Rust HTTP client!

https://github.com/algesten/ureq

It is pretty simple! :blobcatcookienom:

If you need a more powerful and async client, use `reqwest`:

https://github.com/seanmonstar/reqwest

#RustLang

I did release some updates to #OxiTraffic, a self-hosted, simple and privacy respecting website traffic tracker 🌐

https://codeberg.org/mo8it/oxitraffic

I did improve the design, add more stats and fix some bugs ✨

I did also finally add some tests 😅

Any feature suggestions? :ablobcathappypaws:

I can host it for you if you want to test it with your website :blobcatheart:

#RustLang #Rust #Analytics #Traffic #Selfhosted #Indieweb