Pick your favourite phrase: "Hoist by his own petard", "live by the sword, die by the sword", "karma will out".

However you view it, Donald Trump's tantrums and rages as US President are coming back to torment him, under the cloak of anonymity.

Trump staffers may have been keeping their powder dry for just the right moment and just the right outlet. ( Simon & Schuster via AP )

It's the same tactic that he has used for years, as a real estate developer, candidate and President, dropping information on journalists by either demanding that his name not be used or using a pseudonym.

Mr Trump this week was pummelled by successive volleys: an essay in The New York Times Opinion section, titled "I Am Part of the Resistance Inside The Trump Administration". Written under a rare grant of anonymity, it was released on Wednesday afternoon in the US.

It came on the heels of excerpts from legendary political journalist Bob Woodward's new book, Fear, scheduled to be published next Tuesday, which relies heavily on unnamed as well as named sources.

Both describe a White House in which administration officials regularly try to control the President, and prevent actions that could endanger the country.

Wrote the anonymous official, "…Many of the senior officials in his own administration are working diligently from within to frustrate parts of his agenda and his worst inclinations".

'I don't even know why any of us are here'

Woodward recounted a meeting in which presidential chief of staff John Kelly spoke in a more colourful fashion.

"He's an idiot. It's pointless to try to convince him of anything. He's gone off the rails. We're in Crazytown. I don't even know why any of us are here. This is the worst job I've ever had," he said.

(Mr Kelly issued a statement on Wednesday saying: "The idea that I called the President an idiot is not true.")

The Times piece sparked a frenzied guessing game on social media over who might have written it, with the leading candidates being Vice-President Mike Pence and Defence Secretary James Mattis, whose verbiage matched that in the essay.

Loading

Loading

Mr Trump, on Wednesday evening, appeared livid. "Can you believe it? An anonymous editorial. A gutless editorial!" he declared at a White House event.

And he fired back with his own tweet:

Loading

Apparently, Mr Trump still strikes fear in enough hearts that staffers in his administration don't dare speak on the record.

But, that only makes it harder for Mr Trump to know who is critical of him.

Kelly and Mattis were keeping their powder dry

Indeed, for months, many people in politics have wondered how respected public servants, such as Mr Mattis and Mr Kelly, could stand working for such an erratic boss.

The answer may be that they were keeping their powder dry for just the right moment and just the right outlet, whether Woodward or the Times.

What triggered the sudden flood now?

Legendary journalist Bob Woodward describes a White House in which administration officials regularly try to control the President, and prevent actions that could endanger the country. ( AP: Alex Brandon )

One factor is the timing of Woodward's book, which long been planned for its September 11 publication.

What wasn't expected was the funeral service in Washington last Saturday for Arizona Republican senator John McCain.

His memorial generated a litany of speeches, from the emotional eulogy delivered by his daughter Meghan, to stately addresses from former presidents George W Bush and Barack Obama.

All of them exhorted the congregation, and those watching, to return to a time when civility and bipartisanship ruled the political scene.

Meghan McCain fired directly at Mr Trump's "Make America Great Again" slogan, declaring: "The America of John McCain has no need to be made great again, because America was always great."

Said Mr Obama: "So much of our politics, our public life, our public discourse, can seem small and mean and petty, trafficking in bombast and insult, in phony controversies and manufactured outrage. It's a politics that pretends to be brave and tough, but in fact is born of fear."

Though Mr Trump's name was never mentioned, it was clear who all the speakers meant.

Will the ghost of John McCain haunt Trump?

Sorry, this video has expired Meghan McCain's eulogy directly challenged Mr Trump without naming him. (Photo: AP/Martinez Monsivais)

McCain himself left behind his own message to the American people, which was widely seen as a call to arms to take the country back from Mr Trump.

"We weaken our greatness when we confuse our patriotism with tribal rivalries that have sown resentment and hatred and violence in all the corners of the globe," he wrote.

"We weaken it when we hide behind walls, rather than tear them down, when we doubt the power of our ideals, rather than trust them to be the great force for change they have always been."

Something that's apparently not in Woodward's book, but which was widely circulated on social media, was a rumour that Mr Trump believes there are ghosts in the White House.

It seemed plausible, given that the White House has been said to be populated by ghosts for as far back as the 1860s.

And, the spoofsters reasoned, it might explain why Mr Trump spends so much time away from the residence on weekends, playing golf.

Well, if there are really are ghosts in the White House, perhaps they've now been joined by McCain.

Micheline Maynard is a US-based author and journalist who served as a White House intern.