The question

If I have an invention that I want to immediately go into the public domain (become prior art) when I show it to the public, how should I publicly disclose it so someone else cannot get a patent based off of my public disclosure? Is disclosing my invention through a YouTube video or a social media post enough for it to count as prior art for a 3rd party, blocking them from getting a patent? I'm considering making my invention open-source so anyone can use it and build off of it, and I'd like to know the best way to disclose it so someone else cannot come along and patent my idea.