If I have a good idea or concept of what I want to write, I usually can do it, if I'm in a coding mood. I can't say I have great stamina, although I usually don't stop until I'm done with implementing my idea.
I probably wouldn't be able to work an ENTERPRISE coding job doing boring stuff, but I'm usually fine implementing what I want by myself for myself. I've done coding for pay, but while I could finish a project in a few days to a week, I tend to take a few months, because I can't bring myself to work when I don't personally care a lot about a project.