Mark Grealish

Cats and wizardry.


Hólavallagarður

in iceland

Hólavallagarður in Reykjavik
Hólavallagarður in Reykjavik
Hólavallagarður in Reykjavik
Hólavallagarður in Reykjavik
Hólavallagarður in Reykjavik
Hólavallagarður in Reykjavik
Hólavallagarður in Reykjavik
Hólavallagarður in Reykjavik
Hólavallagarður in Reykjavik

Some will answer Hallgrímskirkja and others Harpa or the Perlan, but to me Hólavallagarður is the most remarkable location in Iceland’s capital, life and death intertwined like nowhere else that I’ve been.


From Oregon!

in family

My ex-wife has moved herself and the kids to near Bend in Oregon. The kids love it there-the Internet is better, there’s so much outdoors to get lost in, and it’s snowed consistently over the past few weeks. Only last night Garrett blistered his hands in the cold because he kept going out in the snow.

Garrett
Garrett
Caira
Caira
Caira and Garrett
Garrett
Caira
Garrett
Garrett

Remap a JavaScript Object

in code

Eh, gods, this one bothered me a fair bit. At work our API returns some data that I’ve found I have to remap. As it happens with any organically-grown system, there are a number of small inconsistencies between different objects with similar attributes. For example:

interface Foo {
  ices: {
    type: 'vanilla';
  }
}

interface Bar {
   icecream: 'vanilla';
}

interface Fizz {
   confectionaries: {
    ice_cream: 'vanilla';
  }
}

I want to map all of these consistently so I could call (say) foo.ices.type. For this I found schm’s translate method through a founder’s blog post. Using Lodash’s _.set to go with _.get, I can set arbitrary paths as well as being able to read from them:

import { get, isObject, set } from 'lodash';

function translate(source: object, map?: object): object {
  if (isObject(map)) {
    return Object.keys(map).reduce(
      (acc, key) => set(acc, key, get(source, map[key])),
      source
    );
  } else {
    return source;
  }
}

Example:

const map = {
  'ices.type' = 'confectionaries.ice_cream',
  'ices.taste' = 'appraisal.deliciousness'
};

My next step will be to create a higher-order function that takes the map and translates the passed object.


And the Land Beyond

in ireland

Mayo countryside from Croagh Patrick
Mayo countryside from Croagh Patrick
Mayo countryside from Croagh Patrick

Taken on Croagh Patrick, Mayo, October 27 2018.


Clontarf Half Marathon

in running

Me tired but happy at the finish
Run route on Strava
  • Date: 2018-11-17
  • Time: 01:42:29
  • Distance: 21km
  • Pace: 00:04:53/km
  • Finished: 366/1605 (23/100 normalised)

Previous race: Gaelforce Howth Summit 10k


Went well. Flat course. Ran long and hard.

Yesterday I applied the lessons of the Phoenix Park half marathon:

  1. I wore warm clothes. Beanie, gloves and an over layer.
  2. I found my desired pacer in the starting pen and began from there.
  3. I carried more gels and used them at the halfway and three-quarters marks.
  4. I set and stopped my run timer as I crossed the start and finish lines.

Other than that, the run was a straightforward out-and-back to Sutton. I got ahead of the 1:45 pacer popped on a podcast and shut off for two hours.


Esjan and Þverfellshorn

in iceland

Looking toward Mosfellsbær from Þverfellshorn
The view west from Þverfellshorn
The view east from Þverfellshorn
Snowy plateau at the top of Esja
Þverfellshorn peak marker