Are you saying his example doesn't work, or that it can't be extended to your two examples? Because when working on a file it works fine -- just not through a pipe (which both your examples are).
seq 1 20 >file.txt
(head -5; tail -5) <file.txt