I don’t think that casting a range of bits as some other arbitrary type “is a bug nobody sees coming”.

C++ compilers also warn you that this is likely an issue and will fail to compile if configured to do so. But it will let you do it if you really want to.

That’s why I love C++

  • qaz@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    2 days ago

    https://github.com/Shadlock0133/cargo-vibe

    I thought it was a joke, but this is actually viable and even configurable

    By default, cargo-vibe will, on success, vibe full strength for 3 seconds.

    You can change that by setting CARGO_VIBE_PATTERN environment variable. For example, to set it vibe for 1.5 second on 20% strength, you can do:

    CARGO_VIBE_PATTERN="0.2 1.5s" cargo vibe <cmd>
    

    You can also set full patterns of vibes to run, by separating them with slashes /. Here is one example:

    CARGO_VIBE_PATTERN="0.4 1s/0.6 1s/0.8 0.75s/1.0 0.25s"
    

    Wait, there’s more! https://github.com/funkeleinhorn/cargo-shock

    To let Cargo Shock trigger your shock collar use: cargo shock build

    To use it everytime you can alias cargo="cargo shock".

    Cargo Shock can also be combined with other tools like Cargo Mommy and Cargo Vibe like this: cargo mommy vibe shock build ...

    And they have a really slick site: https://openshock.org/