I can’t really answer this question, but I am really curious.
During work, I often have small(ish) tasks to solve, and when it is possible I rather write small one-shot scripts instead of doing some manual labor.
These scripts are rough, they are not made perfect because they don’t have to, they have one purpose, and they have to do it right. Sometimes they have small mistakes in them, sometimes they just aren’t perfect, sometimes they are awful. There are always compromises when creating these like ‘does this task worth that plus hours to put them, or just aim for the solvable problem’.
Let me show this in an example. Today I am working on a script what copies big amounts of data between two servers, I want to do it multithreaded, but I also want to limit the number of threads.
My quick and dirty solution looks like this:
for row in cursor:
while len(threading.enumerate()) > MAXTHREADS + 1:
worker = Worker(row)
Yes, I know, civilized people don’t use ‘sleep’, because that is a waste of CPU, but hey, I will run this script on an ephemeral EC2 instance, so I really don’t care. This will do it, so deal with it.
But after the migration, I do want to keep this script somewhere because it is possible that I’ll need something like this in the future, and I don’t want to reinvent the wheel then.
My GitHub account would be a perfect place for them, but I am not sure if I can put them there. I mean GitHub account is like a business card (remember Patrick Bateman), I don’t want to put ugly code them – I mean if I want to find a new workplace, then it will be possible that they will check my GitHub stuff, and I don’t want them to think if I am a bad coder.
If I had a paid account (which I don’t have) then I’d put these into a private repo.
Nowadays I put these into gists, but gists are not easy to search, so that is not perfect as well.
I am not sure what would be the best.