Communist until you get rich; Feminist until you get married;
This fallacy is called Argumentum ad consequentiam, which says that something is true or false depending on the desired consequences.
Atheist until the airplane starts falling;
This fallacy is called Argumentum ad baculum, which says that something is true or false depending on your fear of the consequences.