Some of the smaller programs I have written are most useful as
examples of techniques and approaches to problems in programming.
Some were written with this purpose in mind, others were actually
useful for something.

libfaketime

libfaketime is a small, trivial library that lets you fake the
system time on a POSIX environment, via the gettimeofday() system call:

It came about because a friend of mine wanted to circumvent a
time-based check in a binary for which he didn't have the
source code. I called it libfaketime since that seemed to be
the most appropriate name for such a thing. It may prove a
good reference for people interested in learning how to hijack
a system library via LD_PRELOAD, or write a shared library.
faketime.tar.gz, 920 bytes.
Only tested on Linux, public domain.

If you want something more sophisticated, which also overrides
time/ftime, and allows you to set relative offsets, go to http://www.code-wizards.com/projects/libfaketime/, a
library which basically uses the same approach but wraps all
the time syscalls and is also called libfaketime.

C++ Lecture

At some point in the second year of uni, I had a C++ tutorial
with 4 other people (my Software Engineering group-mates). We
managed to go to the wrong room, however- and since we didn't
know where we should have been, we decided to revise the topic
ourselves.

Basically, I lectured the material to my group-mates, and my
friend (who has asked to remain nameless, due to his poor
handwriting) wrote it up on his snazzy tablet PC. The results
are these notes on delegation, adaptors and decorators in C++
(c++_lecture.pdf).