Is there a way to disable headphone detection in Yosemite?

Solution 1:

That is not possible.

By design there is a mechanical switch inside the headphone jack that will automatically turn off the speakers.