Skip to content

Instantly share code, notes, and snippets.


Jonathan Bell jonathanbell

View GitHub Profile
jonathanbell /
Last active Feb 21, 2022
Compare two dates in VBA
Option Explicit

'Compares `leftDate` (first param) to `rightDate` (second param).
'Returns true if leftDate is LESS than (earlier in time) than
'rightDate, otherwise false. HANDLES ONLY DATES IN "AD" (no dates
'in "BC" format are valid. :(
'@param String leftDate
'@param String rightDate
jonathanbell / What I Did with 3 Months
Last active Jan 3, 2019
December 29 2018 - What I Did With 3 Months Off
View What I Did with 3 Months

What I Did With 3 Months Off

From approximately September 2018 to the end of December 2018 I did not work. Well, I didn't work in a way that would be considered a normal way to work. I studied JavaScript and made a lot of personal apps/projects in order to learn new tech. So, in a way, I guess you could say that I worked on myself.

The idea to take 3 months off came from the desire to attend a coding bootcamp wayyy back in about November of 2016. TBH, I had not heard of coding bootcamps until I heard about them on a tech podcast. I thought the idea was cool so naturally I looked into them.

The more I looked into bootcamps, the more I came to realize two things: 1. They were expensive. 2. They were geared primarily at people who had never coded before. Regarding point number 2, a lot of the coding bootcamps marketing teams will tell you that they are geared for all levels of coders (and to some degree, I'd agree). However,

jonathanbell / What have I been working on (2018 edition).md
Last active Dec 28, 2018
October 17 2018 - What Have I Been Working On? (2018 Edition)
View What have I been working on (2018 edition).md

What Have I Been Working On? (2018 Edition)

Since I left my government job over 6 months ago, a lot of people have been asking me, "What have you been up to?" It's a fair question. My life as a contractor/student has been busy and quiet and then busy again (kind of like a "hurry up and wait" situation on repeat inside a front-loading washing machine). I've decided to start looking for full-time employment in November of this year. I hope that until then I will have enough time to study all of the things that I want to (there's just never enough time).

Anyways, this is a post that I hope to update periodically. I think that I will make a post like this every year from now on. It's really handy to have. I just want to simply list out the things that I have been working on over the year and update them as time moves on (via Git). Next year I will be sure to create a post like this near the start of the year and keep adding to it throughout the year. However this year, I am a little tardy (it's October).


jonathanbell / Get Data from an API with
Last active Oct 1, 2018
September 30 2018 - Get Data From an API with VBA
View Get Data from an API with

Getting Data from an API with VBA

The other day I had to use VBA in order to retrive data from the StockWatch offers a fairly extensive stock API with a daily changing API key. StockWatch allows up to 100 stocks to be queried via a query string in each call.

getStockDataString() takes: an array of strings which represent each stock symbol, the market or "region" where the symbols are located, and the daily API/authorization key (provided to you by StockWatch).

I wrote the function/"sub" in Excel 2010 and the HTTP_GET request uses the MSXML2 library and the XMLHTTP method. I don't know if this library is available in later versions of Excel, but I'm sure the process for making HTTP requests would be similar.

The StockWatch API returns each stock on each line of the response and each requested field seperated by a comma. For example:

jonathanbell / Using rsync as a Backup
Last active Oct 1, 2018
September 30 2018 - Using rsync as a Backup Method
View Using rsync as a Backup

Using rsync as a Backup Method

I like rsync. It's an amazing little Unix utility that allows the user to sync files across two drives/folder structures. I use it personally for backuping up photos and other important documents to a mounted USB drive. I then (periodically) update the drive and keep it locked up in a safe place when it's not in use.

Here is an example script that you could use to backup your Dropbox's Code, Documents, Sites and Photos directories (on Windows, using Git Bash):


rsync --size-only \
jonathanbell / Checking Out Microsoft Cognitive
Last active Sep 30, 2018
April 11 2018 - Checking Out Microsoft Cognitive Services
View Checking Out Microsoft Cognitive

Checking Out Microsoft Cognitive Services with PHP

AI? Huh?? Oh.... yeah.. I've heard of that! That's that movie where the Skynet becomes sentient and attempts to destroy mankind, right? Scary stuff.

What's that you say? Artificial intelligence won't kill me?! Huh.. OK - well, maybe I'll stop smoking a pack of cigarettes a day then. I kid.. I don't smoke - sorry if you do (if you are still alive and able to read this).

I was listening to the Shoptalk Show podcast the other day and heard about this crazy new(?) thing that Microsoft and some of the other big data players are cooking up.

Cognitive services is a form of artificial intelligence because you have to train it first on a controlled dataset and then it gets smarter and more accurate based on its previous experiences.

jonathanbell / How to Setup SSH
Last active Sep 30, 2018 — forked from stormpython/
April 10 2018 - How to Setup SSH Keys
View How to Setup SSH
jonathanbell / Scrape HTML Into an RSS
Last active Sep 30, 2018
April 4 2018 - Scrape HTML Into an RSS Feed with PHP
View Scrape HTML Into an RSS

Scrape HTML Content Into an RSS Feed

If you still like RSS as a technology (like I do), then you might be interested in creating an RSS feed for a website that no longer supports RSS. That way, you can point your RSS reader to a PHP file on your server and have your RSS reader update when new content is created. Yes folks, we are screen scrapping with PHP today!

One of my favourite photographs is Hedi Slimane. I really like his style and exculsive use of black and white. However his blog site doens't support RSS. Since I really want to know when new content is posted, I created a little PHP script that will check his site and return an XML RSS feed from my server to my RSS reader.

This is just an example of what is possible in the vast and scary world of screen scraping. I just thought that I would post this script up as an example.


jonathanbell / Coding
Last active Sep 30, 2018
April 3 2018 - Taking a Coding Sabbatical
View Coding

Taking a Coding Sabbatical

I did it! I left my secure job. I even left without having another job lined up. My dad told me never to do that (sorry, dad).

The plan for the next 3 months is to accept only small jobs and to study a lot in my spare time. I want to level up my JavaScript skills and to eventually get a local or remote position with a company that I find engaging and inclusive.

I feel like quiting my job was necessary as I simply did not have enough time available during the day in order to study and work. I need several hours a day free and clear if I'm to be efficient. Web developers constantly need to be learning these days. Every time you turn around there is a new framework or a new tool or a new best practice bandwagon that we should all be jumping on. It's very hard to keep up - I'm sure that you agree.

It's not surprising that the 2018 Stack Overflow Developer Survey found that developers really want code and that they want to learn

jonathanbell / Jonathan Goes
Last active Sep 30, 2018
March 17 2018 - Jonathan Goes Windows
View Jonathan Goes

Jonathan Goes Windows

It's "official", I have switched to Windows! Some may call me crazy (and maybe I am) but I've actually been enjoying the web dev experience on Windoze. Like those brave soles before me, I have decided that it's time to combat the Mac monoculture and try something different.

It's strange to me that the web is all about open technologies and inclusiveness and then we all use Mac and preach our technology choices hard from the rooftops. I started off using Windows for photography in 2005 on a severely under powered machine, switched over to Mac around 2007 and then became a semi-hardcore Linux user from about 2013 to 2018. I've come to learn that it really doesn't matter which machine the web developer is using, as long as they get the job done at the end of the day.

Tools That Made the Switch Easier

Obviously, I couldn't give up the tools that I need to do my job. I was curious if there would be useful alternatives on Windows. Tur