Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Creating A Basic Chrome Extension

Chrome Extensions have been around for a long time. I believe they are a very under-explored technology - and if you’re a traditional web developer, there’s a very small learning curve since Chrome Extensions are comprised of HTML, JavaScript and CSS. Bonus - you don’t have to worry about every browser under the sun, just Chrome! (though Firefox is becoming extension-friendly, it might be a good idea to not include Chrome-only web features).

Read More

Convert Data Between CSV And JSON With Simple JavaScript

A popular subject on the blog has always been around the conversion of one data format to another data format. For example we’ve already seen how to convert XML data to JSON data with JavaScript, but what if we wanted to work with comma separated value (CSV) data instead?

We’re going to see how to take a CSV file, parse it into JSON, make some changes, and then convert it back into a CSV file using Node.js and a few readily available packages.

Read More

Convert Amazon Links In A Hugo Site To Affiliate Links With Gulp

As you may already know, The Polyglot Developer is a statically generated website built with Hugo. That means that there are no databases involved, no server side languages, only HTML, CSS, and JavaScript.

In the past I shared the automated Gulp workflow that I use when building my blog to maintain performance and a solid standing with search engine optimization (SEO).

I received a request from a subscriber recently around affiliate link generation on a Hugo website and I figured it would be an interesting topic to tackle. Typically a WordPress plugin or similar would handle the job, but since we’re working with a static website, we have to be inventive with our build scripts.

In this tutorial we’re going to see how to build a Gulp task that will replace all Amazon links with Amazon Associates links, which is another name for their affiliate program.

Read More

Using NW.js To Convert A Website Into A Desktop Application

A while ago, I ran into a situation where I needed to make web application into a desktop application for a corporate client. The idea was to leverage as much of the existing app as possible, while still meeting the requirement of having a “desktop” application.

As a primarily Java developer, I had no idea how to do this, so I started doing research and found out that my best bet would be using JavaScript technologies.

Enter NW.js, a powerful mashup of Google Chrome and Node.js that allows you to package a web application to be run on the desktop.

Read More

Simple Data Processing With JavaScript And The HERE API

Have you ever needed to work with comma separated value (CSV) data that wasn’t formatted in a great way or figure out complete address information based on very little provided address information? While unrelated, these two topics come up quite a bit, more frequently when I’m dealing with person information or lead data that I retrieve from conferences and other events.

The great thing is that we live in a time where plenty of development libraries and services exist to make this process of data parsing and manipulation easy to accomplish in an automated fashion.

We’re going to see how to take a CSV file representing partially complete people data and convert it to JSON. Then we’re going to fill in the gaps when it comes to the geolocation side of things, using the HERE Geocoder API.

Read More

Protect GraphQL Properties With JWT In A Node.js Application

So you started playing around with GraphQL and Node.js. Did you happen to get up to speed with my previous tutorial titled, Getting Started with GraphQL Development Using Node.js? Regardless on how you’ve jumped into GraphQL, you’re probably at a time where you need to figure out how to protect certain queries or pieces of data from the general public through some kind of permissions or roles.

When building a RESTful API, the common approach to endpoint protection is with JSON web tokens (JWT). In fact, I even wrote a previous tutorial on the subject, but how does that have relevance to GraphQL?

We’re going to take the common JWT approach and apply it towards protecting queries as well as particular pieces of data in a GraphQL API created with Node.js.

Read More

Getting Started With GraphQL Development Using Node.js

I’ve been playing around with GraphQL for a little over a month now, just to see if it is worth all the buzz it has been getting when it comes to modern API development. I must say that the more I use it, the more I’m coming to like it.

I recently wrote a few tutorials around getting started with GraphQL using Golang, but being the polyglot that I am, I wanted to see how difficult it would be to accomplish the same in something else, like Node.js. After having made an attempt, I found that it really isn’t any different as it is the same concept, just a different language.

We’re going to see how to get started with developing a web application with Node.js that can be queried with GraphQL rather than the traditional RESTful API endpoint approach.

Read More