Skip to content

Instantly share code, notes, and snippets.

💭
Browsing your repos. 🤝

Jonathan Bell jonathanbell

View GitHub Profile
@jonathanbell
jonathanbell / What I Did with 3 Months Off.md
Last active Jan 3, 2019
December 29 2018 - What I Did With 3 Months Off
View What I Did with 3 Months Off.md

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
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).

Lik

@jonathanbell
jonathanbell / Obtaining a Perfect Score with Google PageSpeed Insights.md
Last active Nov 19, 2018
December 11 2016 - Obtaining a Perfect Score with Google PageSpeed Insights in WordPress
View Obtaining a Perfect Score with Google PageSpeed Insights.md

Obtaining a Perfect Score with Google PageSpeed Insights (in WordPress or other systems)

My personal blog (http://30.jonathanbell.ca) just got a little uglier and a little faster.

I recently set a lofty goal for my blog. I wanted the site to achieve a perfect score (100/100) with Google PageSpeed Insights. Google PageSpeed Insights is a (very picky) tool to help front-end people make their pages load quickly in the browser.

A lot of people will tell you that you don't need a perfect score from Google to have a fast and performant website. I would tend to agree – especially after executing these changes 😓. You don't need to have a 100/100 score in order to have a speedy, modern, and accessible website. Still, I was hungry to try for the 100/100 score! After I got going on this idea 100 seemed like the holy grail. I wanted it. I hungered for it. After a lot of fussing, I got it. Well, ok.. I scored 99/100 but you'll see why I lost one point

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

Getting Data from an API with VBA

The other day I had to use VBA in order to retrive data from the stockwatch.com. 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
jonathanbell / Using rsync as a Backup Method.md
Last active Oct 1, 2018
September 30 2018 - Using rsync as a Backup Method
View Using rsync as a Backup Method.md

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):

#!/bin/bash

rsync --size-only \
@jonathanbell
jonathanbell / Instarss.md
Last active Sep 30, 2018
August 28 2014 - InstaRss
View Instarss.md

Instarss

I was looking around for a way to get a user's public Instagram feed as an RSS feed without using the Instagram API when I came across this question on Stack Overflow.

Probably the best way to do this, would be to use the Instagram API. However, I had no desire to sign up for an Instagram account.

Initially, this answer on Stack Overflow suited my needs quite well. However, as fate would have it, Instagram changed its HTML output and the page's JSON data structure changed. Since the idea is quite simple (we're just screen scrapping here) I decided to write my own script. If this works well for you, consider upvoting my answer on Stack Overflow: http://stackoverflow.com/a/25559442/1171790

EDIT August 2017: I no longer support this scipt. The Instagram HTML output of any given user page changes often and it's been a fun game of cat and mouse but I no longer have a need for an I

@jonathanbell
jonathanbell / New Theme: 30.jonathanbell.ca.md
Last active Sep 30, 2018
November 21 2015 - New Theme: 30.jonathanbell.ca
View New Theme: 30.jonathanbell.ca.md

New Theme: 30.jonathanbell.ca

My site has a new look and feel! I thought I should update its theme to a more modern one. I’m growing, along with my blog’s theme (awwww, how cute) 😂.

Generally, what I write on my blog is pretty personal and I write as if no one is reading. I like to do that because it keeps it personal and honest and I can be myself.

However, in my professional life I always write code as if another developer will be (at some point) reading it. Doing this, can take more time than just haphazardly writing functions and selectors that won't scale or make sense in the future. And, while I have no plans of releasing the new theme to the open source community at this time, I tried to write the theme so that it could be used on anyone else's site with minimal headache. One item that is currently hard-coded is the photo and the personal "greeting message" at the top of the homepage.

@jonathanbell
jonathanbell / MS Ends Support for IE 8-11.md
Last active Sep 30, 2018
January 9 2016 - Microsoft to End Support of IE 8,9,10 & 11
View MS Ends Support for IE 8-11.md

Microsoft to End Support of IE 8,9,10 & 11 = Happy Birthday to Me!

Microsoft has announced that it will end support for Internet Explorer versions 8, 9, 10, and 11 on January 12th 2016! That’s just one more reason to celebrate my birthday!! (My birthday is pretty close to this date).

I feel like Microsoft has given me an early birthday gift, just by making this announcement. Long have I toiled with this inconsistent, piece-of-poop browser. No longer! I am officially dropping my support (in all future web projects) for IE 8, 9, 10 & (even) 11! It’s been way too long – and IE has always caused me so much grief. I'm done – I'm not accepting any new projects that want to support these ancient and unreliable browsers. There will still be IE Edge to contend with but, from what I hear, that browser is quite standards compliant and modern. We shall see! 😉

It's been a long road to travel with you, IE - but now I must bid you adieu. Happy

@jonathanbell
jonathanbell / Connect PHP to LDAP.md
Last active Sep 30, 2018
January 28 2018 - How to Connect PHP to LDAP
View Connect PHP to LDAP.md

How to Connect PHP to LDAP

The other day I needed to connect PHP to my organization's LDAP/Active Directory server. I hadn't done this before and found it pretty difficult/annoying.

Hopefully, this will help someone else in the future or even just the future version of me if I have to do this again. I've heavily commented the code below for clairity. We are just outputing a form that asks for the LDAP credentials. If we do not have any relevant $_POST values submitted to our webpage/server we output the form. Otherwise, we will attempt to login to the LDAP server with the credentials provided and retrive some of the user's information.

Now that the user has passed authentication, you could check to see if the user is part of a certain group or has certain value(s) associated with their account.

@jonathanbell
jonathanbell / Connect Mac OS X to a Samba File Server Remotely via PHP.md
Last active Sep 30, 2018
February 20 2018 - Connect Mac OS X to a Samba File Server Remotely via PHP
View Connect Mac OS X to a Samba File Server Remotely via PHP.md

Connect Mac OS X to a Samba File Server Remotely via PHP

Ever had to connect a Mac web server to a Samba file share remotely via a PHP/HMTL form? No?! Really!? Are you sure?? Check again, I'll wait.

What's that you say!? The answer is still no!? Oh. Well.. OK.

Well anyways, I had to do this the other day and I'm going to write it down here so that I don't forget how I did it.

My work uses a little Mac web server to serve up a GitList installation (a listing of all our repos). Problem is, the Git repositories live on our LAN (Samba) file server. The Mac needs to talk to the LAN so that it can read the Git repositories and display them on the page via GitList. The Mac web server doesn't have any credentials of its own to supply to the Samba share, so, with this scipt, we ask the user for their credentials and then use those to connect to the Samba share.

You can’t perform that action at this time.