IANAL but people who Are A Lawyer seem to feel that there's no legally meaningful way to place anything in the public domain, currently, at least in the United States.
Write up what you did and publish it somewhere. It's not magic - patent examiners would still need to find what you did, and if the patent is eventually granted and someone sued, it's always expensive to deal with lawsuits even if you're in the right. But if you clearly state what you did and put that write-up in some place that is accessible by others and clearly dated, then you've established that others should not be able to patent it.
The public domain is the wrong place for this, but you can certainly grant irrevocable patent licenses. IIRC this is how the GPL3 works. (Not that you'd have to license under the GPL to use the same strategy, it just shows it's possible)