The code is available on Github as a gist:
It is licensed under a Creative Commons Attribution 3.0 Unported License.
This code is simple enough (and there's a ton of comments), but I'll still provide a brief overview. As a reminder, this code is for the Arduino Uno.
The setup() function is line 85. Here we set up all the pins and attach an interrupt to the microphone. There's also various Serial prints throughout the code that I commented out but can be enabled to get a better idea of what is going on.
Line 118 is the loop() function. Because I do the majority of my code in functions or interrupts, I made the loop() function only run once a millisecond. This code just takes care of the time between detecting claps and runs the machine to clap.
soundDetected() on line 54 is called when the microphone detects sound. It sets some flags that are used inside the loop(). It also contains a flag to do some debouncing of the microphone input. If you recall, it's very noisy, and I debounce it here instead of adding a capacitor across the pins on the board.
The next function is my clapAlgorithim() on line 37. You'll have to read the code yourself to see what that does ;).
Final code is the clapWithDelay() function on line 101 that spins the motor one rotation and makes the hands clap.
I hope you found this description useful! I'd be happy to help with any questions related to the code.