August 31, 2021

Decoding Unknown Data with Codable

A friend recently asked me how to decode the following JSON through Swift’s Codable type. { "a": 1, "b": "foobar", "option.extra": { "a": 1 }, "option.extra.more": 4 } The problem is that only the first two keys (a and b) are guaranteed to exist, anything aside from that (here everything prefixed with option) is extra and unknown at compile-time. Unknown keys should not be discarded however, they should be decoded into a dictionary for later use, we want a type like this. ... Read more

July 26, 2018

Server Setup with traefik and docker-compose

In the last post I hinted towards how I used docker-compose to run all the services I need on my server. Since someone asked me to describe it in a little more detail I’ll do just that in this post. It would probably also make sense to document it a bit for myself as I know that I’m going to forget parts of it at some point 🙈 The basic gist is that everything runs in a docker container and exposes only what’s necessary to the public web (and not directly by itself). ... Read more

July 20, 2018

Paperless

For the past few years I’ve been scanning all paper correspondence, be that something I receive via snail-mail, invoices, contracts or whatever else. This has been a huge improvement over not doing so. Before I had troubles finding documents when I needed them and usually had them lying around at home, not at hand when necessary. Both of these issues are easily resolvable by having digital copies. They can be accessed remotely and are searchable. ... Read more

July 2, 2018

Chat Statistics

I recently stumbled across yet another statistics from my chat with my girlfriend post on /r/dataisbeautiful so today I wanted to evaluate some simple data myself. Unfortunately I’m quite far from being an actual datascientist (below you’ll see some of the first matplotlib plots I’ve ever made), so I’m going to focus a bit more on data acquisition and some very simple findings and visualizations. Since I probably don’t have any chats quite as active as the one with my girlfriend that seemed to be the obvious choice to analyze as well. ... Read more

January 29, 2018

Docker Swift Runtime

I recently wrote a small Vapor web app in Swift which I then wanted to deploy on my server inside a docker container. Not having all too much experience with docker my simple Dockerfile looked something like this. FROM swift:4 COPY . . EXPOSE 8080 RUN swift build --configuration release ENTRYPOINT [".build/release/Run"] CMD ["serve", "--env=production"] Whilst this worked perfectly fine, the image size turned out to be a whopping 1.5GB. That didn’t quite feel right if for an app as small as mine. ... Read more

May 30, 2017

Reverse Engineering iOS Apps

As promised in my last post I wanted to write a post about a talk I recently held at Mobile Camp 2017. I also held the talk again at our local Cocoaheads Meetup on May 24th 2017, this time being recorded on video (Thanks, Ben!). But since the talk is in German, I promised to publish an English summary here as well, so here we go 😊 The slides are online as well and can be found on GitHub Pages. ... Read more

May 10, 2017

Downloading older iOS app versions with iTunes

Update (2017-09-23): Apple recently removed the App Store entirely from iTunes (a welcome move), which kinda broke the entire workflow here. It is however still possible to download IPA files to your Mac through the use of Apple Configurator 2. Buy and download the app via your iOS device Open Apple Configurator and login under “Account” Connect your device, then go to “Add” > “Application” and choose the app in question from your purchase history A dialog will open asking you if you want to overwrite the app or continue in another fashion. ... Read more

April 10, 2017

Keeping Static Images out of your GitHub Repo

People love images [citation needed]. Or at least I know I do. And I’ve previously stated elsewhere that I hate downloading or installing software that doesn’t show me any obvious references to its visuals beforehand. I mean come on, it’s just a screenshot, how hard can it be? GIFs or videos get bonus ✨ points. This obviously also goes for CLIs, which doesn’t mean you should skimp on man pages and/or good --help documentation, but a link to a “video” powered by asciinema speaks volumes compared to a textual description of usage patterns! ... Read more

April 8, 2017

Akronymisierbar

I’m a podcast addict. I have been for a few years now and I can’t seem to stop. Podcastprofile has a not very current list of all the feeds I’m subscribed to. With all the content I consume it only seems logical to produce something at some point as well, or at least try. Hendrik and me have had that plan for quite a while if I recall correctly, and two months ago we finally decided to do something about it. ... Read more

November 9, 2016

Automatically Increment Your Xcode Project's Build Number

Those of us who use Xcode to build, run and deploy projects of ours have probably run into an issue where we’ve forgotten to increment the build number before trying to deploy a project. In my case the problem is usually iTunes Connect, which doesn’t take your app’s version (or CFBundleShortVersionString) into account, but only the build number (or CFBundleVersion). The former is the version we usually set (according to semver if you’re a good person, although it really doesn’t make much of a difference for user-facing versions) to identify the version internally. ... Read more