Matthew Lang avatar

Matthew Lang

Family guy and web developer

Personal projects do make you a better developer.

My focus just now is on a larger project though. It still affords me much of the same benefits, just less of an opportunity to try new things. I’m okay with that though for the sake of getting it off the ground.

A product decision over some code and coffee

For the last few months, I’ve been building a content management system aimed at a particular industry.

I’m close to finishing the first working version of the product. There are still a few things to do, like account management and theme options, but these are trivial things that will not present any problems.

While reviewing the CMS source code this morning, I spotted a way that I can refactor a part of the CMS. The change involves simplifying the different content from multiple types of content to a single base content model that I can base other content on. This is a significant structural change to the product. It involves changes in how the CMS presents and manages the content.

If I spend the time making the change now, it would be much easier to handle any created content and migrations of data in the future.

If I schedule the switch for later on after the release, I’ll always know that I have this change in the structure to make and will be presented with an increasing problem of migrating data.

Thinking on it, I like the idea of taking the hit now and getting this right before the product gets released. I’m just wondering now why I didn’t see this before when I was modeling the content for the CMS.

Second day on the new job.

Another day of online courses, health and safety training and getting myself up to speed with the organisation.

God, I miss freelancing.

I’m starting to wonder if running a side product is worth the hassle, given the amount of regulation on privacy and payment processing there is now.

Playing with the Dark Sky API and the Bootstrap card component

As part of a side-project I’m working on, I’ve been trying to build an informative weather widget that gives current and forecasted stats for the next few hours.

I’m using the card component from Bootstrap to structure the widget. The card component is excellent for this, as it allows me to structure the widget but will enable it to have different styles for different websites. I’m surprised by just how much I’ve been using the card component, as it’s quite versatile.

Dark Sky provides all the weather stats that I need. I have a background worker that fetches the stats from the Dark Sky API and saves it to the database. I can then query the database for the stats as well as cache the widget for a short period.

The Dark Sky API is excellent as the forecast request gives you minute by minute forecasted weather for the hour, as well as hourly and daily forecasts for the next seven days.

The Dark Sky API also includes descriptions for icons that you can use. These standard descriptions can then be used to map to whatever icon you want. I’m using Font Awesome for my weather widget’s icons. I have a helper method in my application that maps the icon description from the Dark Sky API to the correct Font Awesome icon.

So far I’m pretty happy with the results.