First of all, I never use "general" licenses (like CC-BY) for code, or code licenses for general content. Creative Commons themselves recommend against such license misuse, and I wholeheartedly agree.
Also, I'm always specific about licenses. I never say "The BSD License", or "The Creative Commons License", as these can actually be used to describe very different licenses. Instead, I say "The 3BSD License", or "The CC-BY License", which is unambigous.
Now, talking about actually picking a license. If it's something I didn't put much effort in, or if I don't care if people credit me, I use 0BSD or CC0. For example, this site is licensed that way because people can still credit me if they want to, and if they don't - that's fine too, I'm just putting my opinion out there. In particular, it's important to release code snippets under CC0 - if every little code snippet was as much as using the MIT license, everyone's code would be full of copyright notices... Wait, what do you mean most code snippets are "All rights reserved" because authors don't specify the license? All right then...
In general, code snippets aren't protected by copyright if they lack "artistic expression", but it's one thing to rely on such a vague law and another thing for me to make it clear that you can copy my code.
If it's something I put at least a bit of effort in that would be easy to credit me for, I usually use MIT/CC-BY. For example, I would never use CC-BY for releasing a sample pack - it's very hard to credit samples, but it's fine if it's a library I want to be useful for even proprietary software, or a finished music track.
Finally, if it's something that I either don't want to be used in proprietary works, or am decently proud of, I might use (A)GPL/CC-BY-SA. As an example, if I'm writing a program for the free software community, I can rest assured the target audience wouldn't in any way be troubled by such a license, and it doesn't matter whether it's useful to entities outside the target audience, so I can safely pick (A)GPL.
To summarize, there isn't a strict set of rules I follow, but I try to pick a license that wouldn't inconvenience anyone I don't want to inconvenience.