Anecdotally, the easiest way to bring shimmy under control is to clamp your knees to the top tube.
“This works by adding damping (your body contacting the frame) and increasing the stiffness of the system,” Rinard explains. “By making the system stiffer, you’ve increased the system’s resonant frequency. For bikes that means you’d need a higher speed to shimmy. In practice that’s OK, because you’re not riding at that higher speed right now, you’re riding at the shimmy speed. So the shimmy stops.”