The modify part leads to more concrete questions, more Googling, more detailed reading of docs, until at some point I'm engaged enough to go back to zero and actually start learning the language from the basics.
(This doesn't work for those languages who's paradigm you first need to understand before being able to do anything, but most languages allow for hacking straightforward procedural code at the basic level.)
SE had a sample dummy event listener add function, complete with // do stuff here. I cut and paste the whole thing and added what I needed.
I suppose I could've retyped the addEventListener function from scratch but...I dunno, that seemed inefficient. I just needed the name.
That scenario might not be entirely possible given the terms of GPL and Apache, but that's how they talk about it.
Even political parties who's slogan is more police and harsher punishment don't understand copyright. In Sweden, the extreme right just plucked some images from the internet, did not check the license, and used it in their party program and commercials. In the end, every Swedish household got sent a pirate copy.
The problem is that copyright infringement is so extremely easy to do, that it happens everywhere, and will likely keep happening regardless of scans.