Simple Alpha shader wihout texture

So I don’t use textures in my game but i want to have transparency on my object. I want to control the opacity of the model by code and when alpha = 1 I want it to have no opacity, not even with itself. I was able to control the opacity on the diffuse/transparent material, but when Alpha is one it is transparent to its own polygons.

If you could post the entire shader that could do this that would be swell. I aim to learn shaders but I think looking at a code that works is a great learning experience.

Found a good shader in the “Transparency and Rim lighting (Fresnel)” forum thread.
Still curious how alpha would work without any code about textures.