Grouping items in an array is one of those things you’ve probably done a load of times. Each time you would have written a grouping function by hand or perhaps reached for lodash’s
Node.js includes built-in support for .env files
With the recent release of version 20.6.0, Node.js now has built-in support for
.envfiles. You can now load environment variables from a
process.envin your Node.js application completely dependency-free.
Easy and accessible pagination links for your Astro collections
Generating pagination links is not as straightforward as it may seem. So, while rebuilding my own site with Astro, I released a
<Pagination />component on npm as @philnash/astro-pagination that anyone can use in their Astro site. Read on to find out more.
Build bots on Bluesky with Node.js and GitHub Actions
Bluesky is the new social network in town and it’s an exciting place to explore right now. I was fortunate enough to get an invite early on and take part in the early community. But Bluesky is not just a Twitter clone, it’s an application on top of The AT Protocol, a (still being built) federated protocol for social networks with some interesting properties.
Create a CLI Chatbot with the ChatGPT API and Node.js
ChatGPT has taken the world by storm and this week OpenAI released the ChatGPT API. I’ve spent some time playing with ChatGPT in the browser, but the best way to really get on board with these new capabilities is to try building something with it. With the API available, now is that time.
I recently came across this blog post from Ruud van Asseldonk titled “The yaml document from hell”. I’ve always heard that yaml has its pitfalls, but hadn’t looked into the details and thankfully hadn’t been affected, mainly due to my very infrequent and simple use of yaml. If you are in the same boat as me, I recommend reading that article now as I almost can’t believe I’ve avoided any issues with it.
Better two factor authentication experiences with WebOTP
Two factor authentication (2FA) is a great way to improve the security of user accounts in an application. It helps protect against common issues with passwords, like users picking easily guessable passwords or reusing the same password across multiple sites. There are different ways to implement two factor authentication, including SMS, using an authenticator application and WebAuthn.
Alias your Mastodon username to your own domain with Jekyll
Mastodon is different to most online services. It is a federated network, so when you set up an account you need to choose a server to use. Your username then becomes a combination of your handle and that server you signed up to. For example, I am currently @email@example.com.
How to use the Bitly API in Ruby
Link shortening has been around for a long time and Bitly is arguably the king of the link shorteners. It has support for shortening long URLs as well as custom short links, custom domains, and metrics to track how each link is performing.
Don't ever write your own function to parse URL parameters
Sometimes the platform we are building on provides more functionality than we can keep in our own heads. However, depending on the problem, we often find ourselves trying to write the code to solve the issue rather than finding and using the existing solution provided by the platform. I almost fell for this recently when trying to parse a query string.