Posts with #ElixirTips

#ElixirTips

Public posts on X that use #ElixirTips.

Related hashtags

  1. Charlie Holtz✓@charlieholtz
    (ignore if you're not interested in Phoenix LiveView) I find myself re-using the same "copy to clipboard" logic across my liveview projects. So I wrote a quick gist for how I do it. It's simple + interactive + works across browsers. #elixirtips
    Download
    219997
  2. Jacob Luetzow✓@jacob_luetzow
    🚨 Developer Alert! 🚨 Michael, founder of @paraxialio, is here to discuss a critical Elixir security tip. Discover why Erlang's binary to term could be your code's hidden enemy and the safer alternative you should use. Don't risk your app's security! #ElixirLang #ElixirTips
    Download
    26231.8K
  3. Learning Elixir@Learning_Elixir
    #ElixirTips Ash Framework
    Chaz Watkins @chaz_watkins
    Mainly learning the Ash way vs the Ecto's. Defining resource actions and domain code interfaces with arguments is significantly different from writing normal functions. However, the validations and changes feel much easier once you understand them. The best part is conditional validations and changes with the where option that validates all conditions before executing the change or validation. Query composition moves from just functions to Preparations where you can do the same style of function head pattern matching. Same can be said for custom Changes and Actions. Managing relationships is made way easier in Ash. Instead of doing put_assoc, you can put the manage_relationship change and specify what should happen when adding the relationship. Like create if one doesn't exist, relate when it does exist, or remove and add a new one. Still not fully clear on how to compose actions by leveraging Hooks like before_action, after_action, before_transaction, after_transaction to replace Ecto.Multi uses or leverage Notifiers for async actions. But, I've mostly been able to replace Ecto.Multi uses with manage_relationship for my use cases. Planning to dive into Notifiers soon for writing to an action logs table. The main challenge of learning the framework has been a lack of search-ability as opposed to Ecto. That's just due to the framework being young. However, you can learn a ton with the documentation, Discord, Elixir Forum, and using references like I'm still actively learning the framework and figuring things out. I constantly go from "Why isn't this working???? I could just write a function or use the Ecto way" and then when it finally works "Holy crap! It was that simple?! This is awesome."
    003113
  4. Chaz Watkins✓@chaz_watkins
    @Learning_Elixir
    Mainly learning the Ash way vs the Ecto's. Defining resource actions and domain code interfaces with arguments is significantly different from writing normal functions. However, the validations and changes feel much easier once you understand them. The best part is conditional validations and changes with the where option that validates all conditions before executing the change or validation. Query composition moves from just functions to Preparations where you can do the same style of function head pattern matching. Same can be said for custom Changes and Actions. Managing relationships is made way easier in Ash. Instead of doing put_assoc, you can put the manage_relationship change and specify what should happen when adding the relationship. Like create if one doesn't exist, relate when it does exist, or remove and add a new one. Still not fully clear on how to compose actions by leveraging Hooks like before_action, after_action, before_transaction, after_transaction to replace Ecto.Multi uses or leverage Notifiers for async actions. But, I've mostly been able to replace Ecto.Multi uses with manage_relationship for my use cases. Planning to dive into Notifiers soon for writing to an action logs table. The main challenge of learning the framework has been a lack of search-ability as opposed to Ecto. That's just due to the framework being young. However, you can learn a ton with the documentation, Discord, Elixir Forum, and using references like I'm still actively learning the framework and figuring things out. I constantly go from "Why isn't this working???? I could just write a function or use the Ecto way" and then when it finally works "Holy crap! It was that simple?! This is awesome."
    118510
  5. Groxio✓@GroxioLearning
    #elixirtips #myelixirstatus
    Bruce Tate: grox.io Founder @redrapids
    #elixirtips Elixir text types pack up unicode integers (code points) two ways: iex> ?a 97 iex> <<97, 98, 99>> "abc" iex> [97, 98, 99] 'abc' Charlists ARE lists of integers. Strings ARE binaries, continuous bytes in memory. Charlists are Lists, linked lists. #myelixirstatus
    001
  6. Bruce Tate: grox.io Founder@redrapids
    #elixirtips Elixir text types pack up unicode integers (code points) two ways: iex> ?a 97 iex> <<97, 98, 99>> "abc" iex> [97, 98, 99] 'abc' Charlists ARE lists of integers. Strings ARE binaries, continuous bytes in memory. Charlists are Lists, linked lists. #myelixirstatus
    Download
    007
  7. Bruce Tate: grox.io Founder@redrapids
    #elixirtips Sometimes a tuple is a better map key. Examples: - a cache key of { item.updated_at} => item, ... - a game token {x, y} => :black_queen, ... - a course catalog {:elixir, :basics} => lesson, ... Works great. #myelixirstatus
    21143
  8. Bruce Tate: grox.io Founder@redrapids
    1/2 #elixirtips reducers. Reducers take an accumulator and x, and return another accumulator. Enum.reduce takes a reducer function that specifies the acc *second*. My advice? In modules, place the acc *first* for better piping and use an anon fn to flip args. #myelixirstatus
    2212
  9. Show more posts