Some libraries should ship with mocks

Most complex or volatile libraries should ship with two extra things: an abstract interface or protocol (whatever the language has), and a mock that implements it. Standard libraries of programming languages should lead by example, as engineers often look up to them when designing libraries.

Do not use unsigned for non-negativity

It is common to find C/C++ code using unsigned types for no better reason than to annotate non-negativity of an integer. C++ Core Guidelines and Google Style Guide advise against that, but do not elaborate enough why.

Run Xcode tests in source file order

Here is not very pretty but definitely the easiest way to change invocation order of XCTestCase methods from default alphabetical order to the order they are written in the source file (like GoogleTest does, for example) — with no bullshit like starting test names with a number.

Manipulating OS X login items from command line

I will leave this post as a reference for those who need their installer postflight scripts (and uninstallers) to manipulate login items in OS X.

Prevent Mac sleep when `make` is running

Ever came back in the morning only to find 40-minute make is still running? OS X 10.8 “Mountain Lion” now includes a nice command /usr/bin/caffeinate which will prevent system from going to sleep while a program is running.

Shell prompt that spans console width

This is how I solved the problem of separating commands from their output, once and for all.

How to actually fix FOV in Mass Effect

The viewing angle (FOV) in Mass Effect games is too small, PC players are upset, but developers never cared. By the time of this writing the only solution to be found on gaming forums is clumsy and messes up cutscenes. So here is the actually working fix, for each of three Mass Effect games.

Why you can just forget about UTF-32

Very often when a discussion of encoding strings comes up someone claims UTF-32 allows for “fast” character access at the cost of wasting some memory. Unfortunately, wasting memory is the only thing it does.