what does the double exclamations do? quite difficult to google it.
The exlamation point "!" is the C/C++ logical NOT operator. If you apply the operator twice (!!) - anything not zero will be equal to "1" and anyting zero will remain as zero. One alternative to using this trick with the double NOT operator would be something like:
if (val & (1 << i)) digitalWrite(dataPin,HIGH);
else digitalWrite(dataPin, LOW);
and where do you find this source code of internal functions?
The source is part of the Arduino download. Whenever you compile/upload a sketch - the Arduino core (such as the shiftOut function) will also be compiled and linked with your program.