• How to do a regular expression search and replace in Visual Studio Code

    I upgraded to V6 in React Router. One of the upgrades was to replace all occurrences of with As you can see there is no simple way to do this as a normal text search and replace. But in Visual Studio code you can use regular expressions to match, and then replace the text. Solution […]

    How to do a regular expression search and replace in Visual Studio Code
  • 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>

  • How to call Freshbooks Classic directly in Node.js using axios

    I was using the freshbooks npm module, but started having issues with its dependencies as it was last updated 3 years ago. It turns out even though the payloads are in XML, it’s not too bad calling their classic API directly once you know how. Of course, then you need to process an XML response. […]

  • 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 […]

  • 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 […]

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

    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

    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 View this gist on GitHub and then the jQuery that takes the selected CSV file, […]

  • How to grab the page source from any dynamically generated webpage and then process it

    [fusion_youtube id=”y8UhYZrFE8U” width=”640″ height=”360″ autoplay=”false” api_params=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=””][/fusion_youtube]   I had an issue where I needed to scrape some data from a dynamically generated webpage. Open this page in a browser and you’ll see what I mean. I tried a lot of options, and the solution that ended up working for me was to use […]