I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, and I saw the usec variant (e.g. :utc_datetime_usec), then I searched the docs for the nth time to see if that is the more precise variant.
And then it hit me: The ‘u’ in usec stands for ‘micro’, as in ‘microseconds’. Which is exactly what the ‘usec’ data type is for. I thought it was some random database jargon. I just never made the connection.
So, Elixir Forum members: What took you way too long to figure out?
Getting ex_aws_ses to send a test email. There is no understandable documentation, no examples! Finally, Google Gemini provided some code in the right direction.
quote and unquote. finally clicked thanks to Saša’s incredible Understanding Elixir Macros series. i swear his narration and answers were exactly 30 seconds ahead of me, asking questions
On HexDocs, the width of the side panel is adjustable. This can be used to read those really long module names that don’t fit in the sidebar at its normal width.
The draggable handle is pretty small, so I added a screenshot with a poorly-drawn red arrow to highlight it. Works on Chrome and Firefox (and maybe Safari? ).
Wow, with all my time using hexdocs I had no idea the panel was resizeable!
Ah, maybe it’s because I primarily use Safari and the draggable handle isn’t showing up for me on Safari but it does on Firefox and Chrome.
Which is a bit surprising because from what I can see it looks like it’s driven by the css resize: horizontal which it looks like desktop Safari has supported for a long time (although not on iOS):
I remember I had something in mind for this back when you first posted but I think maybe I was too embarrassed by it something? I hope not because that would be dumb since embarrassing myself is my special move (doesn’t even cost me very much mana)
One thing did come up recently with a colleague who is new to Elixir that also tripped me up initially: While their names suggest as much, dbg and IO.inspect are optimized for debugging, ie, they use inspect protocol, ie, they don’t give you full the picture of a struct, ie, they are the wrong tool when it comes to learning. The thing about this one is that there is some “mental-context” at play. When debugging, I knew full well that I was getting a to_string version, but when in learning mode, I was expecting the computer to know that and show me the full struct :zoidberg:
So if you want the full picture, do this:
dbg(struct, structs: false)
Actually, that reminds of something else that took me too long to realize: dbg and IO.inspect both take the exact same opts (second argument).
Multiple select, I used two different libraries and tried using CSS and JavaScript before it finally work. Even give up before I saw the live_select library and was able to achieve what I wanted to do with it https://hexdocs.pm/live_select/LiveSelect.html
Still contemplating on doing a video on my YouTube channel to explain it