I answered this question.
Since I didn't want to provide a link-only answer I quoted the most important code examples in my answer.
Then I have found this meta-post and realized my mistake. I have edited the code quotation out but in the revision it is surely still readable.
What can I do? Should I delete my answer instead? I'm so sorry.
Edit: The code has an Apache 2.0 licence. The meta-post says it will be posted here under a CC BY-SA licence and I'm not allowed to do that even under "fair use".