Runar Ovesen Hjerpbakk

Programmer. Software Architect. Technical Manager.

Navnedag - Norwegian name days 🇳🇴

Navnedag is my latest Norwegian app highlighting, the age old tradition of name days. A name day is day where you can celebrate your given name and get a free dinner at IKEA. This app shows you all the Norwegian name days, when your contacts have name days and the etymology of the various names.

Hent Navnedag på App Store

Dear Google Cloud - Your Deprecation Policy is Killing You

Many of you have already read this masterpiece, but this rant is one of the great ones and deserves all the readers it can get.

The gist of it is that in order for you to be a trustworthy platform player, even on a small scale, you need to take backwards compatibility seriously:

Backwards compatibility keeps systems alive and relevant for decades.

And GCP does not.

Backwards compatibility is a design goal of all successful systems that are designed for open use; that is, implemented as open source, and/or guided by open standards. I feel like I’m stating something that’s so obvious that we should all be awkwardly embarrassed, but no. It’s a political issue, so I need examples.

Birthday Reminder++ 2020.1

Never forget a birthday

We’ve all got a lot of people in our contacts, some that we care more about than others. For these special someone, we import their birthdays from Facebook, Twitter or our own brain. But keeping track of these important events can be a hassle, both in a calendar filled to the brim and in the contact app itself.

Enter Birthday Reminder++, the app which keeps your congratulations on track, making your relationship with your closest friends and family even more meaningful.

Get Birthday Reminder++ in the App Store

Features

  • See today’s birthdays from your contacts
  • See future birthdays sorted chronologically by upcoming birthday
  • Edit your contacts quickly from within the app
  • Remove birthdays from contacts faster than any other app

Golden Ratio Calculator++ 2020.1

Golden Ratio Calculator++ version 2020.1 is ready for iOS 13 and dark mode!

I’ve also added improvements based on your feedback:

  • The calculated value is automatically added to the clipboard for easier sharing with other apps
  • The ratio selection box is no longer empty when no named ratios are selected
  • Width and Height can be separately adjusted in any orientation

Golden Ratio Calculator++ is the best and fastest way to easily incorporate the golden ratio in your layouts or designs!

Buy Golden Ratio Calculator++ on the App Store

Perhaps More Than Ever – Truth Matters

Steven Novella is a personal hero of mine. Not only is he the primary host of my favorite podcast, The Skeptics’ Guide to the Universe, he’s also an excellent communicator of science, skepticism and neuroscience.

The latest post on his blog really hit home, encouraging us to step out of our bubble, dig deeper and indeed challenge ourselves to understand each other better.

Humans are tribal by nature. We now know from years of psychological study that we tend to plant our flag with one group, one ideology, one narrative – and then defend it at all costs. The more we identify with a position, or see it as a marker of our group, and the more we do, the greater our motivated reasoning. For things we don’t care about, or do not identify with, we tend to revert to a fairly rational approach – listening to new evidence and incorporating into our view. So we have the capacity to be rational, when our identity does not get in the way.

Jekyll error - does not have a valid date in the YAML front matter

I’ve now encountered this problem twice and had to DuckDuckGo it both times, so here is the blogpost.

When building a Jekyll website from a template for the first time, some templates will give the following error:

Error: could not read file /srv/jekyll/tmp/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb: Invalid date ‘<%= Time.now.strftime(‘%Y-%m-%d %H:%M:%S %z’) %>’: Document ‘tmp/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb’ does not have a valid date in the YAML front matter.
ERROR: YOUR SITE COULD NOT BE BUILT:
————————————
Invalid date ‘<%= Time.now.strftime(‘%Y-%m-%d %H:%M:%S %z’) %>’: Document ‘tmp/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb’ does not have a valid date in the YAML front matter.

Read More

Introducing .NET Multi-platform App UI

Late last year I wrote on how to use F# and functional patterns for creating apps with Xamarin Forms. This Build, Microsoft has both understood the power of the MVU-pattern and unveiled a new unified way of building cross-platform native frontends from a single codebase!

Introducing .NET Multi-platform App UI

Introducing .NET Multi-platform App UI, simplifying the choices for .NET developers, providing a single stack that supports all modern workloads: Android, iOS, macOS, and Windows. The native features of each platform and UI control are within reach in a simple, cross-platform API for you to deliver no-compromise user experiences while sharing even more code than before.

I even supports MVU, enabling you to write your UI-code and logic in C# like this:

readonly State<int> count = 0;

[Body]
View body() => new StackLayout
{
    new Label("Welcome to MAUI!"),
    new Button(
        () => $"You clicked {count} times.",
        () => count.Value ++)
    )
};

Simple, understandable and hot-reload friendly. I for one can’t wait to get my hands on MAUI!

Redirects in Jekyll

So, a friend told me:

Runar, your site has a 404.

How can that be I thought? I haven’t redesigned in a while, and the couple of pages I’ve moved have valid redirects. The URL in question was https://hjerpbakk.com/fermicontainer/, so I clicked the link to prove him wrong, reveling in my future success, and got this:

Read More

Use the cache action to speedup GitHub Actions

My Norwegian site, Pappaperm.com, is built using Jekyll and I run a simple CI-workflow on every pull request using GitHub Actions. The workflow checks both my writing and technical matters, such that no links return 404 or that every image also have an alternate text.

name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      JEKYLL_VERSION: 3.8
    steps:
    - uses: actions/checkout@v2
    - name: Check formatting, build and test site
      run: |
        docker pull andmos/markdownlint
        docker run --rm -v $PWD:/usr/src/app/files andmos/markdownlint **/*.md -i ./_drafts -i ./_my_tags
        docker pull jekyll/jekyll:$JEKYLL_VERSION
        docker run --rm --volume="$PWD:/srv/jekyll:delegated" --volume="$PWD/tmp:/usr/local/bundle:delegated" jekyll/jekyll:$JEKYLL_VERSION /bin/bash -c "chmod a+wx . && bundle check || bundle install && rake ci"

The build first pulls a Docker image containing a linter for Markdown and uses it to check my Markdown-files for style. Then it pulls a Docker image with Ruby correctly configured for Jekyll 3.8 before running tests on the actual website. The tests are run using a simple rake action within the Jekyll-powered container instance and could do with a bit of explaining.

Since Jekyll is a Ruby-tool, Gemfile.lock specifies the sites’s dependency graph, and bundle check is run first to check if the dependencies are already satisfied. If they’re not, they’ll be installed into the tmp directory using bundle install. This directory is mounted within the container instance as /usr/local/bundle, the place where the Ruby bundler stores the dependency graph.

All well and good and the build clocks in under 2 minutes. Sadly though, the majority of this time is spent doing unnecessary work. The sites’s dependency graph remains unchanged between runs more often than not. Thus, the script above wastes a lot of time downloading already known dependencies.

Enter GitHub Action’s Cache Action.

Read More

HTMLProofer encoding woes

Pappaperm.com is my Norwegian rosablogg, a blog with recipes and other homely matters. Pappaperm is built using Jekyll and I use the HTMLProofer gem during the build to verify that all links are still reachable.

Good idea in theory and it works perfectly on this site. On Pappaperm however, HTMLProofer failed with:

Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8

Read More