I am pleased to announce that the latest episode of the Polyglot Developer Podcast has been published and is now available on all of the major podcast networks!
As many of you know, The Polyglot Developer is a static website composed of strictly HTML, JavaScript and CSS. There is no backend technology, no database, nothing dynamic, and as a result it is fast, cheap to operate, and easy to maintain.
This episode, Static Website Generation with Hugo, will shed some light into static site generation and how it differs and is advantageous over the popular alternatives such as WordPress and Drupal.
There are many static site generators available, but the focus of this episode is on Hugo, a popular generator because of its speed and functionality. To talk about Hugo, the core maintainer of the open source project, Bjørn Erik Pedersen, is on the show.
Read MoreWhen working with Go or any programming language for that matter, there is almost aways a need to validate the data that the user provides before you start working with it or storing it in a database. A sloppy way to validate data would be to use a series of if/else conditions, switch statements, and a bunch of regular expressions, but there are better ways to get the job done without having a disaster of a codebase in terms of maintainability.
We’re going to see how to use the validator.v9 package in Golang to validate native Go data structures, their fields, and any variables that don’t quite fit in.
Read MoreIf you’ve been following along, you’re probably familiar with my love of Node.js and the Go programming language. Over the past few weeks I’ve been writing a lot about API development with MongoDB and Node.js, but did you know that MongoDB also has an official SDK for Golang? As of now the SDK is in beta, but at least it exists and is progressing.
The good news is that it isn’t difficult to develop with the Go SDK for MongoDB and you can accomplish quite a bit with it.
In this tutorial we’re going to take a look at building a simple REST API that leverages the Go SDK for creating data and querying in a MongoDB NoSQL database.
Read MoreI’ve mentioned this numerous times before, but The Polyglot Developer is powered by Hugo which is a static site generator that takes Markdown and converts it to HTML. While Markdown is easy to use and can accomplish quite a bit, the syntax doesn’t accomplish everything that you’d hope to accomplish when it comes to a website. For example audio and video aren’t a thing in Markdown while it is in HTML. So how do you add custom components to a Hugo article?
In Hugo, you can create what is called a shortcode, which is a custom tag that gets processed differently than standard Markdown syntax. We’re going to see how to create shortcodes to take Hugo posts and pages to the next level.
Read MoreA couple of years ago I was lucky enough to win an Echo Dot in a company hackathon. Since then I have been trying to develop Alexa Skills that interest me in my spare time. Before exploring this new field of development, I had been interested in learning and practicing a language that was new to me, Golang (or just Go). Considering Alexa skills are based on web services, one of the area where Go excels, it seemed like a great way to “have my cake and eat it too.”
It was a couple of months ago when I came across a great post by Nic Raboy on writing about writing Alexa Skills with Golang and AWS Lambda which can be found here. Most of the Skills I have developed started before Lambda had first-class support for Go so I am much more comfortable writing Skills using self-hosted web services. Using Lambda for Alexa Skills is definitely a great approach but there are some instances where using your own server might make more sense. If you are looking to reuse an existing server or rapidly prototype an idea then maybe it makes more sense to use this approach.
In this post, I will detail the steps necessary to deploy a web service that can be used to fulfill Alexa Skill requests. To make it easier to compare this approach with using Lambda, the functionality of the Skill will remain almost identical to Nic Raboy’s example. It is only the deployment process that will be changed.
Read MoreIt has been a few years since I last worked on and published an application, otherwise known as a Skill, for Alexa powered voice assistants. My last Skill titled, BART Control, was built out of necessity because of my commuting on the Bay Area Rapid Transit system. While I didn’t open source it, I had created the Skill with Node.js and a publicly available BART web service. Since then I had written a tutorial titled, Create an Amazon Alexa Skill Using Node.js and AWS Lambda, which also focused on Node.js.
I’m a huge fan of Golang and was pleased to see that AWS Lambda recently started to officially support it. AWS Lambda isn’t a requirement to creating Alexa Skills, but it is a huge convenience. To make things even better, Amazon recently sent me an invitation to take part in their developer offer to receive an Amazon Echo Show for publishing another Skill. The offer and Golang inspired me to develop another Skill and this time I wanted to share my process.
Read MoreI was recently tasked with a project where I needed to gather data from Stack Overflow so it could be easily evaluated without having to dig around the website. Stack Exchange has many REST APIs available, some of which that don’t even need tokens or authentication, so it came down to how I wanted to consume this data.
In this tutorial, we’re going to see how to consume question and comment data from the Stack Exchange API using Golang and then export it to comma separated value (CSV) for further evaluation.
Read More