If the group operation is denoted <>, with identity e, and the inverse of 'a' is 'inv(a)' then you would do
a = a0;
b = b0; // initial assignment
a = a <> b; // a = a0 <> b0 and b = b0.
b = a <> inv(b); // a = a0 <> b0 and b = a0 <> b0 <> inv(b0) = a0.
a = inv(b) <> a; // a = inv(a0) <> a0 <> b0 = b0 and b = a0.
This works when a and b are ints, which are a group with the operator '+' and identity '0', and inverses inv(n) = -n (see [1])It works when a and b are nonzero floats, which are a group under multiplication with identity 1.0 and inverses inv(x) = 1/x (but see [2]).
It works when a and b have fixed-length binary representations, because fixed-length binary strings are a group where the operation is xor (or '^') and inv(x) = x.
It works when a and b are matrices of the same dimension, which form a group in two different ways - under matrix addition, where the inverse is elementwise negation, and under matrix multiplication (if a and b are nonsingular) where the inverse is the regular matrix inverse [3].
Note that in my third line, the right-hand side of the assignment is inv(b) <> a, whereas all the examples in the blog post used a <> inv(b). They were implicitly assuming a commutative group (i.e. a <> b == b <> a for all a and b) whereas my procedure works even for non-commutative groups, e.g. matrices under matrix multiplication.
Edit: Obviously, if you actually use this in real code... WAT.
[0] http://en.wikipedia.org/wiki/Group_(mathematics)
[1] this even works if one of the operations causes an integer overflow - the magic of modular arithmetic!
[2] floats don't really form a group, because of non-associativity of floating point multiplication.