How To Extract The Audio From A YouTube Video In MP3 Format

There are a lot of songs on YouTube. To make a copy of just the audio of a video on your computer, follow these steps: Install youtube-dl. If you're using a mac and use Homebrew, you can simply type brew install youtube-dl Then from the command line, type youtube-dl --extract-audio --audio-format mp3 <video URL>

By |2019-10-13T20:19:29+00:00October 13th, 2019|gist|0 Comments

How To Convert a JavaScript Object To A Query String

Let's say you have a lot of query parameters you need to add to an Ajax request. For code maintainability, it's much cleaner to create a large JavaScript object, use string interpolation for the URL, and then adding a function that converts the JavaScript object to a query string. This is what it might look [...]

By |2018-12-17T22:25:03+00:00December 17th, 2018|gist|0 Comments

How to programatically extract YouTube captions as plain text

YouTube automatically creates subtitles for a lot of videos that are uploaded to YouTube. So instead of paying to have your videos transcribed, you can upload your video to YouTube, and programatically download the subtitles. But it took me a while to figure out how to get those subtitles programatically. I started with youtube-dl, but [...]

By |2018-08-14T17:30:17+00:00August 14th, 2018|gist|2 Comments

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

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 [...]

By |2017-08-02T21:34:46+00:00August 2nd, 2017|gist|2 Comments

How To A Create A JSON API Wrapper For SOAP

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 [...]

By |2017-05-12T19:32:34+00:00May 12th, 2017|gist|3 Comments

How To Create Your Own Currency Conversion App

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 [...]

By |2017-04-16T00:00:10+00:00April 15th, 2017|gist|0 Comments