Fantastic, but unfortunately the source code is minified: https://github.com/txstc55/ugly-avatar, making it difficult to see how it was done and learn from or contribute to the project.
You can change the branch to main and see the code. (I agree that having the pages branch as the default branch and uploading built code instead of building it with a GH action is still odd)
Thanks! I found the Vue source in Firefox by going into the Debugger tab in DevTools, and clicking on Sources > Webpack > ugly-face > src.
Chrome makes it a bit more intuitive, since the tab is called Sources, then click into Page > top > ugly-face > src.
That said, I don't understand why the author didn't simply commit the source code into the GH repo, especially since it's fully retrievable anyway. Maybe there's some goal in doing that other than security by obscurity I'm missing, since they've followed the same pattern for multiple of their repos. It seems kind of anti-collaborative to me.
I believe for avatar generations i have including this one, three of them. I thought i pushed the code already. For any code that requires a database access I don't push the code
Thanks, I appreciate seeing the code! For code with database access, you could use an environment variable from a .env file and gitignore that file, making it safe to share. (you're probably already aware of this practice and may have another reason not to want to push it)
For things working with database I mainly don’t want to expose the rpc calls or the database queries. I know people can just get it by checking dev tool but it’s one layer of labor and can filter out many people with millacious intent
Additionally, there's no copyright license on the files. (Tangent: even if there were a free software license, the software wouldn't be free software by the FSF's definition (https://www.gnu.org/philosophy/free-sw.en.html) because source code is the form that the author prefers when the author modifies the software, and minified code usually is not that.)
You are right, I probably should have a copyright file there, just so that if people use this project they have to cite me, other than that I don’t care about how people use it
Yeah, as much as McGuirk is my favorite character on that show, I think it's a bit of a stretch to call him the main character. He's definitely the most recognizable voice from the show though!
I remember watching this show at 3am as a teenager, while my sister and I ate breakfast before heading out to our jobs on a dairy. We did not like this show, but it was really the only thing that was on at 3am. It was followed by The Oblongs which we vaguely remember as bizarre and joke about it being a shared dream we must’ve had when we fell asleep on the job.
I immediately thought the same and figured I just got one that looked kind of like that to start of with, and reloaded and reloaded and reloaded and was so pleased when I just kept getting ones that looked like Home Movies. Because of that, they all strike me as charming and amusing more than they do ugly.
It’s not hard but I don’t see the use of this, so probably not. And also although it doesn’t seem like it but the computation is quite intense for them, having multiple will lag the browser
maybe i'll explain why, it's like the finding a mate for marriage problem.
you dates enough ppl to have a taste of what you like, and then for the next one that comes along that is on par with the best you've seen, you take that.
i guess a 3x3 grid is not necessary, maybe when you click "another", push the old one up (or down) the stack but keep it around so I can always go back and pick the best one I liked so far after the sampling?
Anyway, don't sweat about it, thanks for creating this.
What you are looking for is called the secretary problem [0]. This states that in a search like yours, you can determine beforehand how often you are willing to press "another", and after 37% of attempts, you pick the first one that's better than the best one so far.
Ha! This is basically why I bought uglyavatar.com a couple of years ago. I was taken aback when I saw this on HN. Maybe I should do something with it one day...
You can't please everybody, which leaves your conscience as the deciding factor. If you would rather not draw black people with googly eyes and vacant expressions, I can hardly criticize that. Like you point out, you'll get criticized - but again, it's impossible to make everyone satisfied with this stuff.
That's cool. Hacks into our ability to recognize faces, without requiring real faces. A forum, where these avatars are randomly generated per thread would be cool. Kind of like /pol/ thread ids, but easier recognize.
You'll need a library that can render to some 2D-context that can then be converted to PNG.
JS is probably where you should look. You might be able to find a good PHP drawing library but I've never come across that in my work. Lots of image converting libraries out there (usually just a wrapper around ImageMagik), but "drawing images" usually a client-side thing and you'll find more support for it.
In JS, you'll draw the image to a `<canvas>` element, which can then be downloaded as a PNG. You could go the SVG route, too, depending on the art style. Canvas is the safer bet.
If you want to deterministically generate avatars for your users, you're looking for "identicons". Googling that will yield several libraries for any common language.
What value does it add to humanity as is? I think either both do or both don't. Money just moves value around; I guess you could argue Ethereum is bad for the environment, that's valid, but so is this GH page, though less so,
A little late disclaimer. I didn't create this project.
All the credit goes to Xuan Tang.
- https://txstc55.github.io/
- https://news.ycombinator.com/user?id=txstc55