Nachmanides (in his commentary on Genesis) and others posit that we have much to learn from the actions of, especially, Abraham, Isaac, and Jacob in Genesis. In his introduction to 32:4, he writes:
This section was written to inform us that God helped His servant and saved him from the power of someone stronger than he, sending His agent and saving him. It informs us also that he [=Jacob] did not rely on his piety: he tried to save [himself] to the extent he could. There's a further hint here for generations: that whatever happened to our father [Jacob] with his brother Esau will happen to us always with Esau's descendants, and it is appropriate for us to hold on to the righteous [Jacob]'s way. That is, we should set ourselves up for the three things he set himself up for: prayer; a gift; and being saved militarily, to flee and be saved.
So for cases of threat of direct attack (rather than nonviolent demonstrations of hatred), there are three components: prayer to God for safety, appeasing the enemy so as to prevent an attack, and practical plans in case the attack does (chas v'shalomchas v'shalom) take place. (How Jacob did these is described in verses 8–24.) As to a case of nonviolent hatred (e.g., a peaceable demonstration), well, the following is merely my own thoughts on the matter, so take them with a heavy grain of salt, but it seems to me that such things can lead (immediately or later) to threats of violence, chas v'shalom, so the above three steps still make sense (but must, of course, be informed by context). None of this is very detailed, however: none of it says what to give an enemy (or how to do so) in order to appease him, or what military strategy. I don't know whether those issues are dealt with in Torah texts; even if they are, doubtless the particulars of a case would be important in deciding.