How to get a new Google access token from a refresh token on Node.js

By | November 12th, 2017|gist|

If you're creating an app where you need to access Google services from a server, you'll need to store the refresh token from the Google Oauth process. The access tokens periodically expire, so you need the refresh token to manually get a new access token when you need it. So if you're using the Passport [...]

How To Use jQuery To Post A CSV File To A Node.js Server

By | August 2nd, 2017|gist|

If you have a front-end that needs to accept a CSV file, upload it to a server using jQuery, and then have that Node.js server process that CSV file, then this a way to do it. First up, the HTML https://gist.github.com/magician11/94e7e900b9b390fb4a53b1d32cc38476#file-index-html and then the jQuery that takes the selected CSV file, and uploads it to [...]

How To A Create A JSON API Wrapper For SOAP

By | May 12th, 2017|gist|

I had a project where I needed to setup a server that communicated over the SOAP protocol. I use Node.js for my backend server, so I began looking for libraries to use to work with. I settled on strong-soap, but began to have issues with doing simple changes to the XML like editing the prefix [...]

How To Create Your Own Currency Conversion App

By | April 15th, 2017|gist|

For a recent Shopify job, I had to update a variety of prices by converting them to a different currency. I found this great API from Fixr.io. It's super fast to use (response times in less than 7ms), and responses themselves are simple JSON objects. The exchange rates are updated almost every day from the [...]

How to add encryption (https) to your JavaScript application

By | December 15th, 2016|blog|

I hadn't given too much thought to encrypting the traffic to my applications, until developing for 3rd party services like Facebook Messenger or using service workers require your server to use https. For a full stack JavaScript application we need to setup encrypt on both the front-end and the back-end. Front-End Encryption I'm serving my files (fonts, [...]

How to setup Google Analytics with React.js apps

By | November 30th, 2016|gist|

If you have a single page app that has no routes, getting visitors tracked with Google Analytics is pretty straight forward using the React Google Analytics Module. First create your tracking ID from Google Analytics by going to https://analytics.google.com/ A howto guide is available here. Then in the parent component of your React.js app Install the [...]

How to listen to Shopify webhook event data with Node.js

By | November 23rd, 2016|gist|

Shopify provides webhooks for stores. What is a webhook? Webhooks are a useful tool for apps that want to execute code after a specific event happens on a shop, for example, after a customer creates a cart on the storefront, or a merchant creates a new product in their admin. -- https://help.shopify.com/api/tutorials/webhooks#about-webhooks   So let's say [...]

How to create a sticky fusion mega menu dropdown for Avada

By | November 9th, 2016|gist|

Some of you might notice that once you have created a fusion mega menu dropdown in Avada, once it appears, if you move your mouse just slightly out of its bounds, the dropdown will disappear. This can be pretty frustrating when trying to navigate around the menu when it's so easy for it to disappear. So [...]