I think we have a tendency to view the first of these as an epithet applied to the police, particularly in America in the 1960s. Images of violence on the one hand and police brutality on the other conjure up visions of protestors screaming "Pigs" usually preceeded with another epithet beginning with the sixth letter of the alphabet.
One of the earliest references to this usage is found in the Lexicon Balatronicum: A Dictionary of Buckish Slang, Unicversity Wit, and Pickpocket Eloquence (1811), where "Pig" is defined as "a police officer. A China street pig; a Bow-street officer. Floor the pig and bolt; knock down the officer and run away." Another example, found under the definition of "Panney" is, "The pigs frisked my panney, and nailed my screws," which translates to "the officers searched my house, and seized my picklock keys."
So, the derogatory usage of the term to refer to a police officer appears to come from England, rather that the United States, and dates from at least the early decades of the nineteenth century rather than the 1960s.
The other interesting term I want to mention is "gay." One of the definitions found in the Oxford English Dictionary is "Bright or lively-looking, esp. in colour; brilliant, showy." It is not a huge leap from this to the use of the term to describe a prostitute. Indeed, The Slang Dictionary (1869) defines it as meaning, "loose, dissipated; 'Gay Woman' or kept mistress or prostitute." In The New Cheats of London Exposed (1792) we find a description of the ways in which gay ladies (and their protectors) might seduce the gullible, and while this is pre-Victorian, the same methods would have been used even while the dear Queen reigned over Albion.
Those bullies who live upon whores of fashion, affect the dress and airs of men of rank and fortune, and by strutting occasionally by the side of a gay lady, add a consequence to her and themselves, and induce the ignorant cully to think that miss confers her favours on gentlemen alone, and that he cannot therefore dream of a favour from her without an adequate return, which, in proportion to her splendid appearance, must be considerable.
While most definitions of "gay" focus on female prostitution, there is evidence that it was also applied to males. In 1889, a male homosexual brothel was discovered by police at 19 Cleveland Street, London. John Saul, one of the prostitutes who had worked there referred to himself as "a professional 'Mary-ann.'" This term usually referred to an effeminant man or a prostitute; either male or female. According to Morris B. Kaplan's Sodom on the Thames,
The Criminal Law Amendment Act had targeted female prostitutes - "gay women" - and "gross indecency between men" - the defining activities of those who were to become "gay men."
Generally, of course, the term "gay" referring to prostitution, was used either for women or to describe a life of prostitution as in "gay life." We can see some of this in a marvelous cartoon by John Leech which first appeared in Punch in 1857 and which specifically uses "gay" in this context.
While Thomas Hardy's poem, "The Ruined Maid," does not specifically use "gay" in this way, it does use the term to describe some elements of her dress, thus effecting the linguistic crossover between the two usages.
"O 'Melia, my dear, this does everything crown!
Who could have supposed I should meet you in Town?
And whence such fair garments, such prosperi-ty?" —
"O didn't you know I'd been ruined?" said she.
— "You left us in tatters, without shoes or socks,
Tired of digging potatoes, and spudding up docks;
And now you've gay bracelets and bright feathers three!" —
"Yes: that's how we dress when we're ruined," said she.
— "At home in the barton you said `thee' and `thou,'
And `thik oon,' and `theƤs oon,' and `t'other'; but now
Your talking quite fits 'ee for high compa-ny!" —
"Some polish is gained with one's ruin," said she.
— "Your hands were like paws then, your face blue and bleak
But now I'm bewitched by your delicate cheek,
And your little gloves fit as on any la-dy!" —
"We never do work when we're ruined," said she.
— "You used to call home-life a hag-ridden dream,
And you'd sigh, and you'd sock; but at present you seem
To know not of megrims or melancho-ly!" —
"True. One's pretty lively when ruined," said she.
— "I wish I had feathers, a fine sweeping gown,
And a delicate face, and could strut about Town!" —
"My dear — a raw country girl, such as you be,
Cannot quite expect that. You ain't ruined," said she.
It does, somehow, give a whole new meaning to "having a gay old time!"
To read Bob Nicholson's article in the Guardian, click here.