david
Avatarex is an elixir package for generating unique, reproducible Avatars from hashed strings.
The package is inspired by Robohash
Hey everyone! I’ve been working on a personal project and was in want of some unique placeholder avatars for my users. I really love the Robohash python lib, but wanted something a bit for “functional”. So here’s what I put together this weekend.
Current Avatar sets include Birdy and Kitty avatars created using images created
by David Revoy and used under CC-BY-4.0.
You can create your own avatar sets, see the AvatarexSet docs for more details.
Images are generated using @kip’s Image elixir package.
Note: The package is currently under development but is up on hex.
Cheers
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security












Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Eiji
Looks like there is a bug in this line:
https://github.com/davidkuhta/avatarex/blob/ecaa02a90558c8dfd6432100b408b32a00f79e83/lib/avatarex/Kitty.ex#L10
it should be:
Same patch should be applied to the
birdy…Unfortunately current macro code does not allow it and I was in need to use it like:
which cannot be used in
prodenvironment static paths are not guaranteed to work in all environments and therefore you should support::code.priv_dir/1.Similarly the macro does not allows to use a sigil for
keysi.e.:The other problem is
priv/renders. Once again there should be a:code.priv_dir/1call. To supportprivdirectory forcurrentproject you should useotp_appand pass this option to said function. Your documentation does not mentions to create such a directory which would not work in app generated usingmix newtask. I would recommend to create it automatically usingFile.mkdir_pwith combination to:code.priv_dir/1call mentioned above.Also why do you use
AvatarexSetinstead ofAvatarex.Set? It’s like reserving 2 namespaces for just one package and therefore it’s not seen as a good practice.david
Updated with all your suggestions.
Eiji
Already better, but you have still a lot to learn. I reserved some time, deeply investigated your code and created an example pull request with project rewrite proposal to show what code you would be able to write in future.
https://github.com/davidkuhta/avatarex/pull/1
If you do not understand something feel free to ask questions in this thread.
Have a nice day!
Eiji
I have dropped some more comments in your latest 3 commits. You still doing the same mistake i.e. you are thinking from author perspective and not from someone who would use the library. Therefore for example default values for optional options are more confusing than helpful even if they work excellent in
avatarexitself. You are just used to write project and nothexdependency. Hope my comments helped.david
Thanks for the comments, they are excellent and appreciated. Yep, I’ve been definitely wrapping my head around some of the meta programming side of things and how they differ from solely project based. Particularly around the conventions for where to put things, how to spec & test, and working with AST at compile time.
david
Addressed all the project rewrite suggestions in the latest push to the
rewritebranch. Using it in my personal project and am quite pleased with the revised API. Wanted to get your feedback before merging that into themainbranch and pushing a0.2.0version. Still have some features I want to add before1.0.0.david
Updated to
0.2.0with new API per @Eiji proposal and feedback.