I really don't like to give anybody who asks for it cash, because I don't know what they're going to spend it on. However, I'm also aware there are people who legitimately need help and resort to begging/panhandling. The thing I learned from somebody to do is to always have a few gift cards to food places on hand, like Subway or something. Right around $10, just enough to get a good meal or two. That way if they do legitimately need money for food you make sure they get it, and if they didn't legitimately need it then all they can buy with that is food.
I've considered doing the same for gas cards, but honestly most of the people I see asking for gas money are parked at WalMarts or places that very obviously don't have gas pumps and are very obviously just trying to get free cash. I can be a bleeding heart and I'm okay with giving random people gift cards at the risk of being scammed, but even I can't bring myself to believe a single one of those people driving around WalMarts and malls asking for gas money. You need some gas in your tank to get home? Be at a gas station and let me personally pump you a few gallons. Don't be driving your supposedly empty vehicle around in circles in the mall parking lot and try to tell me you don't have enough gas to see your dying sister.