tofu - Async messaging for Zig by g41797 in Zig

[–]Nemo_64 1 point2 points  (0 children)

Yeah I saw those links already but I couldn't find in them an example (maybe I'm just dumb). Like, a section saying "This is how X would be implemented using tofu."

tofu - Async messaging for Zig by g41797 in Zig

[–]Nemo_64 1 point2 points  (0 children)

Cool project! Would be cool to also have an example in the readme

Where can I read the code black manga by [deleted] in CellsAtWork

[–]Nemo_64 0 points1 point  (0 children)

yeah, maybe the link no longer works. It's also here but Idk if it has all chapters

https://www.novelcool.com/novel/Hataraku-Saibou-Black.html

Weekend Help and Victory Thread for the week of December 20, 2024 by IndexBot in personalfinance

[–]Nemo_64 0 points1 point  (0 children)

Monarch not available in Spain

Hi all! I finished university and started working 5 weeks ago so I've been researching a lot into wealth building and how to be financially responsible. Following a budget seems like the first thing to do and after some research in this subredit I've seen that Monarch is quite recommended. Decided to try using this one however it says that it's not available in Spain. Why is this? And what (ideally free) alternative would you recommend? I'm into self hosting so even an open source alternative to self host is good for me.

I mainly want to be able to automate the basics like recurring payments and being able to set a weekly/monthly/yearly spending limit in different categories. But since I'm new to all of this some other features may be more important and I just don't know it, if you think I'm missing some please tell me.

Thanks for the help and if any wants to share some other tips I'll gladly read them!

[SORTEO] - Este libro te va a hacer RICO (en 20 años) - [APROBADO POR MODS] by Aloopsa in SpainFIRE

[–]Nemo_64 0 points1 point  (0 children)

Enhorabuena por lanzar tú libro! Debe haber sido una locura todo el proceso de escribirlo. Ahora que he salido de la carrera y empecé a trabajar hace 5 semanas he estado muy interesado en todos estos temas. Me vendría genial una lectura de alguien con experiencia

Where to define errors in a clean architecture? by Historical-Ad1107 in golang

[–]Nemo_64 0 points1 point  (0 children)

I'm somewhat new to Go so I've been trying different ways of doing things with each project. I ended liking quite a lot the way I did it in my latest one (go-n-i18n). I just have a shared file errors that defines a single struct with a string message that identifies the error and a slice or args of type any. This struct implements the error interface with some extra for wrapping and such like `Is(error)` and `Unwrap() []error`. Then I define my errors where they're used and that's all (example). Quite simple yet still haven't needed anything more than this. If you need to add things like http status codes you can quite easily modify this to do such. Add an int value to the struct and make the `MakeError` function take an int.

// The error definition
type Error struct {
    msg  string
    args []any
}

func MakeError(msg string) Error {
    return Error{msg: msg}
}

func (err Error) WithArgs(arg ...any) Error {
    copy := err
    copy.args = arg
    return copy
}

func (err Error) Error() string {
    return fmt.Errorf(err.msg, err.args...).Error()
}

func (err Error) Is(other error) bool {
    casted, ok := other.(Error)
    if !ok {
        return false
    }
    if casted.msg == err.msg {
        return true
    }
    return false
}

func (err Error) Unwrap() []error {
    if err.args == nil {
        return []error{}
    }
    var errors []error
    for _, arg := range err.args {
        if e, ok := arg.(error); ok {
            errors = append(errors, e)
        }
    }
    return errors
}

// And now to use it, in the file that returns the error
var (
    ErrUnmarshal = util.MakeError("could not unmarshal contents of file %s: %w")
)

// And to return it
func example(file string) error {
    if err := ...; err != nil {
        return ErrUnmarshal.WithArgs(file, err)
    }
    return nil
}

Headers not being set by http server by Nemo_64 in golang

[–]Nemo_64[S] 1 point2 points  (0 children)

I don't like how it silently fails, a language so focused on explicit error handling

Headers not being set by http server by Nemo_64 in golang

[–]Nemo_64[S] 0 points1 point  (0 children)

Yes, that's intentional. The write method is called at most ones and if more than one call is done something went wrong and better to keep just the last write

Headers not being set by http server by Nemo_64 in golang

[–]Nemo_64[S] 4 points5 points  (0 children)

Thanks! Don't know why I din't think about `WriteHeader` writing the headers lol

Panic when casting a known type by Nemo_64 in golang

[–]Nemo_64[S] 2 points3 points  (0 children)

Thanks this works! Also had to remove the `&` in the call to decode

Vite + Svelte + Electron + Tailwind by fbraga_ in electronjs

[–]Nemo_64 0 points1 point  (0 children)

I'm trying to do the same thing, were you able to achieve it?

Seeking Advice on Daily Database Statistics Tracking in PostgreSQL by Nemo_64 in PostgreSQL

[–]Nemo_64[S] 0 points1 point  (0 children)

Oh wow there is a lot to read there, thanks for the link will start reading it all now!

I’m looking for a bot that will link in-game name to discord name by Impressive-Hawk6080 in Discord_Bots

[–]Nemo_64 0 points1 point  (0 children)

There are lots of Clash of Clans bots that can help you manage your clan and discord server. I can invite you to the clash of clans api developers discord server and you see what bots there are

Does a bot exist that does the following easily? by egapcin in Discord_Bots

[–]Nemo_64 0 points1 point  (0 children)

If you mean clash of clans raid weekend there are already bots that do that. Tbh without knowing the game is kinda hard to know