For folks reading this topic, be aware of what version of Discourse you are using. As @Mittineague indicates the Post mechanisms changed waaaay back in Feb of 2016 making the hide-post sources available in GitHub obsolete.
If you are using Discourse versions newer than approximately 1.5.0 don’t use the hide-post example.
At this date, from what I can see in github, it looks like 1.8.8 is stable and 1.9.0 is in the works.
Read A new versioned API for client side plugins topic for more details about the new versioned plugin API
Personally, I started looking at the Translator plugin to figure out how the new API works in order to add buttons after each post.
Good luck!