Carl Topham

React.js & JavaScript developer


Recent articles

Run report: To the Top of Corfu

May 27, 2022

A 33 km off-road trail run from the Corfiot sea side town of Roda, to the highest point on the island, Mount Pantokrator at (911 metres (2,989 ft)). A beautiful route, through olive groves, tiny villages, with views to die for, but took longer than estimated resulting in a bit of a hot and stressful finish!

The route

Because I was unsure of the route and wanted to make sure I was going a sensible path I ended up plotted this using Strava, and then again in Komoot. I also imported it into Garmin Connect (to ...


Fixing issues with NextJS local file APIs and Netlify functions

May 17, 2022

Recently I migrated my personal website to Next.js and thought I had everything working well with Netlify, however on deployment I noticed an issue with the API data...

Background

As part of my migration from Gatsby to Next.js I moved the .gpx data to a Next.js API end point so that I can easily access the data in multiple places. I'm currently using the data in a custom Leaflet map component on posts. Each <Map /> component requests the geo json data it needs and the renders the routes and elevation profiles...


Type narrowing and discriminating unions in TypeScript

May 10, 2022

Type narrowing is the process of moving from a less precise set of types to a more precise type or set of types. The aim of type narrowing is to reduce the types down to only the ones where the following methods or properties can be correctly accessed or called without throwing errors.

It's a bit like playing a game of "Twenty questions".

In the traditional game, one player is chosen to be the answerer. That person chooses a subject but does not reveal this to the others. All other players are questioners....


Putting the `S` in SOLID JavaScript

February 16, 2021

S - Single-Responsibility Principle (SRP) is the first design principal covered by SOLID principals.

SOLID is an Object oriented design principal. It stands for:

  • S - Single-responsiblity Principle
  • O - Open-closed Principle
  • L - Liskov Substitution Principle
  • I - Interface Segregation Principle
  • D - Dependency Inversion Principle

The principals were originally created and promoted by Robert Martin (aka Uncle Bob).

SRP simply states that Classes and functions should only have a single responsibility. This sounds...


Getting started with Blender

February 13, 2021

I recently picked up 3d modelling after quite a few years away. I have not used Blender before so learning the basics involved many seaches and skimming videos to fine what I needed. This post is a quick guide to getting started with blender that I have created from my notes.

Hopefully it will enable you to get started more quickly than I did!

Navigation

Firstly if you're on a (mac) laptop without a numpad then you will want to enable numpad emulation. This will allow you to use the normal numbers to navigate...


Recent projects

Migrate carl-topham.com from Gatsby to Next.js

Rebuild my portfolio site (carl-topham.com) in Next.js, migrating from Gatsby


Running kit bag

Interactive kit bag checklist app to ensure that I always have the right running kit for training, races and all weather!


SmartSave & LiveLend WebApps

React.js Redux WebApps using REST APIs with Auth.


Advanced Strava Stats

Sync your Strava data and analyse it in extra ways than the official app. React, Redux, Saga, Axios & D3.


SmartSave Public Website

Wagtail/Django/Python backend with WebPack, React & Bootstrap frontend