The Big Bang Theory Season 4 Episode 12
The Bus Pants Utilization
Leonard has an idea for a smart phone application, and the gang decides to work together on it.
Sheldon initially tries to take the reins of the project, but Leonard exerts authority and Sheldon reluctantly acquiesces, only to ridicule Leonard's efforts. Leonard fires Sheldon.
Sheldon tries to lure Howard and Raj away from Leonard's project, to no avail, and then tries to sabotage their project by distracting them using a theremin, resulting in his expulsion from the apartment.
Penny takes pity on Sheldon, invites him up for cocoa but regrets it and tries to get the guys to take Sheldon back, convincing Sheldon to apologize, all the while knowing he's intention is sarcastic.
Howard, Raj and Leonard allow Sheldon back on the project, and immediately Sheldon tries to take it over again.
Sheldon sullenly ends up working on an app with Penny to identify and purchase shoes based on a photograph