unit and acceptance testing, automation, productivity

Hacker News Button

You might have noticed that each post on mokacoding has an Hacker News button. Hopefully you even clicked it.

Adding a share to Hacker News button to your blog is super easy thanks to the work of the guys at

You can go to their Hacker News Button website to use a wizard to configure the button and get the code, or use the same one I use for mokacoding.

Jade version:

  !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);;js.src=p+'://';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');"",
      Vote on Hacker News

HTML version:

  !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);;js.src=p+'://';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');

<a class="hn-button"
  data-title="POST TITLE"
  Vote on Hacker News

There you go. If you found this post useful I would really appreciate if you could hit my Hacker News button, and the ones next to it too 😎.

Happy coding, and leave the codebase better than you found it.

Want more of these posts?

Subscribe to receive new posts in your inbox.