yosh

@yoshuawuyts

Software researcher. he/they

Berlin, UTC+2
Vrijeme pridruživanja: svibanj 2009.

Medijski sadržaj

  1. prije 20 sati

    For reference: here's my meal list for week 2. That was a lot of work to author, and didn't help make the next week's version easier to write. In contrast the new layout allows tracking recipes over time, which seems much more fun!

    Prikaži ovu nit
  2. prije 20 sati

    New weekly spread for grocery planning. Had a different one for the last 5 weeks; but this one feels like it'll be less work. Have a lot of space on the left page to scribble down ingredients and recipes. Can then use that to later reference & tweak.

    Prikaži ovu nit
  3. 2. velj

    January complete

    Sleep tracking January
    Prikaži ovu nit
  4. 1. velj

    New video: Rust 1.41 patch review! Went over everything new in 1.41, including the orphan rule changes, all in magnificent 320p high-resolution video. (Promise next video will *actually* be in a decent resolution, lmao)

  5. 1. velj

    If I had the time, I'd copy over Surf's API so that it could look like this:

    #[test]
fn nested_cookies() -> io::Result<()> {
    let mut inner = tide::new();
    inner.at("/2").get(|_req| async move {
        let mut r = Response::new(200);
        r.set_cookie(Cookie::new("snack", "tuna"));
        r.body_string(String::from("ok"))
    });

    let mut outer = tide::new();
    outer.at("/1").nest(inner);
    let mut server = outer.into_mock()?;

    let cookies = server.get("/1/2").await?;
    Prikaži ovu nit
  6. 1. velj

    Tide test I wrote earlier today, fixing a bug on how cookie serialization worked when nesting services. I think there's still a lot of room to improve ergonomics (code blocks 3 + 4), but overall I'm very pleased with how good this already is!

    #[test]
fn nested_cookies() -> io::Result<()> {
    let mut inner = tide::new();
    inner.at("/2").get(|_req| async move {
        let mut r = Response::new(200);
        r.set_cookie(Cookie::new("snack", "tuna"));
        r.body_string(String::from("ok"))
    });

    let mut outer = tide::new();
    outer.at("/1").nest(inner);
    let mut server = outer.into_mock()?;

    let req = http::Request::get("/1/2").body(
    Prikaži ovu nit
  7. 31. sij
    Odgovor korisnicima

    These are the basic wrist movements I do every day. Usually on hands and knees, alternating hands between each stretch. If wrists hurt badly tho, even just being on hands and knees can be a stretch. Make sure not to take it easy!

  8. 30. sij

    Tide 0.6.0 has been released! ⬩ Cookies ⬩ CORS ⬩ Route::nest ⬩ Route::all Changelog:

    use cookie::Cookie;
use tide::Response;

let mut app = tide::new();

app.at("/").get(|req| async move {
    println!("cat snack: {:?}", req.cookie("snack"));
    Response::new(200)
});

app.at("/set").get(|req| async move {
    let mut res = Response::new(200);
    res.set_cookie(Cookie::new("snack", "tuna"));
    res
});

app.listen("127.0.0.1:8080").await?;
    Prikaži ovu nit
  9. 29. sij

    New post: Tide Channels This is a design proposal for WebSocket and Server Sent Event support in Tide. I don't usually post about things at this stage on my blog, so this is me trying something new. (Also this was drafted in a day which is unusual, heh)

    let mut app = tide::new();
app.at("/sse").get(tide::sse());
app.at("/").get(async |req| {
    req.sse().send(b"hello chashu").await?;
    Response::new(200)
});
app.listen("127.0.0.1:8080").await?;
    Prikaži ovu nit
  10. 29. sij

    Working on something new.

    Screenshot of my WIP blog -- new post: tide channels
    Prikaži ovu nit
  11. 28. sij
    Prikaži ovu nit
  12. 28. sij

    Made a silly amount of soup — shii-take, miso, soy sauce, tofu, veggies

    Big pan of soup on the stove
    Prikaži ovu nit
  13. 28. sij
    Odgovor korisniku/ci

    Software defined radio stuff is really cool; -- has done tons with this. There's a talk here:

  14. 27. sij

    Messing around with a WebSocket API sketch for Tide. Clients would create socket connections on /ws. Then that connection becomes available on all routes as part of `()`. Would have surf-like convenience methods for send & recv. Wdyt?

    use async_std::task;

#[derive(Deserialize, Serialize)]
struct Cat { name: &'static str }

let mut app = tide::new();
app.at("/wss").get(tide::ws());

app.at("/", async |req| {
    let mut socket = req.ws();

    socket.send_json(&Cat { name: "chashu" }).await?;
    let msg: Cat = socket.recv_json().await?;

    Response::new(200.into())
});

app.listen("127.0.0.1:8080").await?;
    Prikaži ovu nit
  15. 27. sij
    Odgovor korisniku/ci

    Heh, have you seen -- first half sounds pretty similar to what you're proposing hehe

  16. 27. sij
  17. 27. sij

    Video from last Friday's stream is up now -- in potato quality, but that should be fixed for next stream

  18. 25. sij

    Bucket full of cat

  19. 23. sij

    Oh I guess I posted some parts of this before. Here's uhhh 5 of the 500 lines. All the code is good like this:

        /// Attempt to downcast the error object to a concrete type.
    pub fn downcast<E>(self) -> Result<E, Self> where
        E: Display + Debug + Send + Sync + 'static
    {
        match self.repr {
            Repr::Simple => Err(self),
            Repr::Custom(err) if err.downcast_ref::<E>().is_some() => Ok(err.downcast().unwrap()),
            _ => Err(self),
        }
    }
    Prikaži ovu nit
  20. 23. sij

    That's +492 lines of sheer horror y'all.

    Prikaži ovu nit

Čini se da učitavanje traje već neko vrijeme.

Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.

    Možda bi vam se svidjelo i ovo:

    ·