Of these two, the first is clearly the personification.
Personification is when an author gives an inanimate (not alive) object the characteristics of a living object. You can see that this is going on in the first quote. The author is saying that the signals are making fun of this person. Obviously, traffic (or is it railroad?) signals cannot actually make fun of a person. Only people can make fun of other people. That means the author is saying an inanimate object is doing something only people can do.
I suppose the second one is a metaphor -- it is saying that her purse is as large as a hardware drawer or some other place that could have a hammer and nails in it.