Dynamically Pluralize Like(s)
I just wanted to share a snippet we use at ForkJoy for pluralizing the various "like" counters on the website. Every menu item has one of these counters and the text can read "no likes", "1 like", "2 likes", etc. Originally we were using an if statement to do this until we realized it can be fit on one line instead.
ParseInt Fails on Small Numbers
A while ago I was trying to get the floor of a number using parseInt() in a Node.js app. The specific use case was expected to return 0, but a larger integer was returned instead. I opened up the node REPL to test out the behaviour of parseInt() and it turns out that when working with very small or very large numbers parseInt() breaks....
👋 Hello Internet
I got fed up with WordPress so I developed my own simple blogging platform using Node.js, Express, and Markdown as a post format. It's called simple-blog if you want to check it out!