I finally found a solution to my problem. It is mainly based on an other user's answer but it needs some rearrangement to fit to my specific needs. I think about displaying the final code for any potentially interested users but where to put it ?
- Editing the question to put it at the end does not feel right. We don't want the answers to be in the question. Do we ?
- Adding an answer is a bit off since the upvotes we could get should be for the OP
- We could add the final code in a comment on the accepted answer but there will be no code formatting.
So what is the best way to do this? Or could we expect a new dedicated place for the finally used solution.