Out of the 30 questions in the triage queue I review almost every day, more than 10 are "give me teh codez" questions. I simply just flag them as either "unclear" or "too broad".
Here is why.
There are two types of "give me teh codez" questions. One which are clear, and the other which are unclear.
Questions which ask for straightaway code like this are normally closed as "Too Broad", and sometimes also as "unclear". This is because the question is both unclear and broad. Although, I prefer the too broad option in most cases. In some cases, when the user narrows the question down to the type of code he / she wants, closing as too broad might some times be awkward, but there are such cases.
In other cases, where the question is clear, but still "give me the codez", like this, should be closed as too broad. I flagged that as too broad. In cases such as this, you cannot flag it as unclear as it is clear. It is narrowing down things, but still "too broad" is the best flag option over here. "unclear" will be wrong, and has chances of being declined or disputed.
I always flag a "give me teh codez" questions, whether I find them in the triage queue, or elsewhere. This is because, downvoting the question does not mean deleting. I know that it will automatically get deleted by Roomba, but not instantly. Till then some user will post an answer to such a question, only for gaining reputation, and even if it is downvoted, it won't get deleted because there is an answer (in many cases). Here is an example in which a user responded to a "give me the codez" question just to gain reputation.
So in short, flag a "give me the codez" question either as "unclear" or "too broad", based on the type it is.
Not related to the question: Many "give me the codez" questions are tricky. They show the exact output they want, and they look perfect. They even get upvoted, and most reviewers approve them.
For example:
This question is a pure "give me the codez" question. Although, it even gained two upvotes, and as soon as it gained them, it came out of the triage review queue. Till then two reviewers reviewed it, one of them being me. The other one even approved it as "Looks OK".
This question is asking for code in an indirect way. Most reviewers thus approved it. This shows that the reviewers were just passing their time doing robo-reviewing,or even not just paying much attention to the question. And clicking Looks OK whenever the see a question with something that looks like code.
Finally I mean to say that do not just think that if a question has code, it has to be ok. Please read the post and then review it.
To apply a analogy, I'll tell two well known quotes:
Think before you leap.
Do not judge a book by its cover.
Both of them apply here. The first one clearly means that always think carefully before you press a review button, either to approve or reject. The second quote applies here as most reviewers just have a glance at the question, and if it is properly formatted, long and has code, they just approve it. Which many times turns out to be wrong.
Major Edit 1
I agree the questions are "give me teh codez" and poor questions; my purpose with the comment about a 1 line answer is that this seems to rule out a "too broad" flag - a question which can be answered so concisely can't really be too broad. Which then leads back to my original question - what on earth is the best response.
Now this is a very good comment by Stuart Whitehouse. He clearly says that "give me teh codez" questions which can be answered in one-line, cannot be closed as too broad. I agree with this point.
So now here is what to do.
When you flag to close a question, you see a menu. In that, choose the off-topic option:

Next, you will see another menu:

I think the image shows what to choose, but for clarity, I'll put the text here:
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Now let's see how can we close a "give me teh codez" question, which can be answered in one line, with this reason.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow...(emphasis mine)
Now this clearly applies to "give me teh codez" questions. If you see the highlighted word "find", that is what they are exactly asking us to do. They are asking us to give code, which can in another way also mean for us to "find code for the OP". So now, the code giving reason is clearly put in this reason.
Instead, describe the problem and what has been done so far to solve it (emphasis mine).
This line also clearly applies to "give me teh codez" questions. Questions are known as "give me teh codez" questions when they show no research, are poor quality, and are just asking us for code. This line says that you should tell what has been done till now. Otherwise, it is just another poor research question. And "give me teh codez" questions are always poor research questions. Thus, this line is also appropriate.
they tend to attract opinionated answers and spam...
This line clearly applies to asking code questions. This is because, many users just post answers to gain reputation. There are going to be opinionated answers as there might be hundreds of ways to solve a problem.
Now I'll give an example where this reason has been used to close a "give me teh codez" question.
This question is closed with the exact same reason. It is just another "give me teh codez" question. I know that this question is not one-liner, but this is the only closed "give me teh codez" question I could find with very few lines. I think this example is sufficient.
REQUEST: Please do not delete the linked question in Major Edit 1. Downvote it if you feel so. This is because, in many meta posts I've come across, the linked question is deleted, and it makes a gap in that post. I don't think any bad will come if we just let one question not get deleted.