Lol, how could you!? (totally did this myself 5 years ago. I know i'm a terrible person, poor kitty). One thing to note, even if its a legit opiate/painkiller, the dosages are absurdly low for a human. Even if you have a script for a 100lb great dane, you could take the whole thing and likely not feel anything (assuming its a short-term pain treatment with a few days of dosages). That's to say nothing of the poor ol' pooch. I know its probably tempting but considering the risk of discomfort to pet, and the likely result of it being wasted since you wont feel a damn thing, make it not worth it IMO.
Safety wise, your not going to keel over and die or OD from a pet dose, thats for sure. If your set on doing it though, make sure to find out what it is exactly, if your unfamiliar with it then google it and determine its properties.