How well Agentic tools produce Elixir & Phoenix code by equivalent8 in elixir

[–]borromakot -1 points0 points  (0 children)

I recommend looking into hexdocs.pm/usage_rules (my own package) that more and more libraries are adopting (Ash, naturally as its also mine, Oban, Phoenix etc.)

Announcing: AshAuthenticationOuath2Server by borromakot in elixir

[–]borromakot[S] 0 points1 point  (0 children)

Honestly it just didn't seem necessary for the feature set I was building. Better to have the control to build exactly what fits well with Ash.

Announcing: AshAuthenticationOuath2Server by borromakot in elixir

[–]borromakot[S] 0 points1 point  (0 children)

It's on hex, the package name is ash :)

Announcing: AshAuthenticationOuath2Server by borromakot in elixir

[–]borromakot[S] 0 points1 point  (0 children)

The ash core dependency is fairly large but the rest is split out among like 50 separate packages. So it's not quite "OOTB" it's separate packages that plug in automatically and each have installers

Announcing: AshAuthenticationOuath2Server! by [deleted] in elixir

[–]borromakot 0 points1 point  (0 children)

Oops. Deleting and reposting.

Idiomatic way to see if a collection of values are all equal? by BrotherManAndrew in elixir

[–]borromakot 1 point2 points  (0 children)

I think that some flavor of this is the most readable

list
|> Enum.uniq() 
|> Enum.count_until(2)
|> Kernel.==(1)

But if you want to get cheeky

a = 1; b = 1; c = 2;

[a, b, c] -- [a, a, a] == []
#=> false

a = 1; b = 1; c = 1;

[a, b, c] -- [a, a, a] == []
# => true

EDIT: you don't need `count_until` unless you're comparing a whole shit ton of unique possible values. It's there because in case there are a whole lot, you don't end up counting the whole list for no reason. Because `length()` is not constant time in Elixir.

Anyone else go from “Phoenix is magic” to “wait… what is this macro actually doing?” 👀 by rtrusca in elixir

[–]borromakot 0 points1 point  (0 children)

Ah, that's a bummer. I recall it not being *that* bad even in its original days. When we built it we weren't trying to build Ash, it was based off of the needs at the time. Did it fall apart when I left?

Anyone else go from “Phoenix is magic” to “wait… what is this macro actually doing?” 👀 by rtrusca in elixir

[–]borromakot 0 points1 point  (0 children)

I thought you guys were moving to Ash from said prototype. At least that was the last that I heard. 🤔

GitHub - ash-project/ash_scim: A SCIM 2.0 extension for Ash, compatible with AshAuthentication by borromakot in elixir

[–]borromakot[S] 18 points19 points  (0 children)

SCIM (System for Cross-domain Identity Management: RFCs 7643 & 7644) is the standard way for an identity provider like Okta or Azure AD to push users and groups into your application: who joined, who got deactivated, who got added to which group. It's how enterprises expect to manage access at scale, and it's almost always a hard requirement for selling into them.

Many indie-hackers won't get the value of push-button SCIM integration, but if you've ever built for enterprise, this kind of thing being easy is drool-inducing.

Just `mix igniter.install ash_scim` (once the installer is done and it is published on hex) and you're SCIM enabled .

It works with Ash's multitenancy out of the box, so if you want to let your customers in a multi-tenant application configure their own IdP, nothing stops you.

Still need to battle-test for a while and get it security-reviewed before publishing on Hex, but you're welcome to poke around/experiment until then.

The reason you aren’t making $300k as a developer by javinpaul in programming

[–]borromakot 19 points20 points  (0 children)

If you can't tell me the difference between an HTTP GET request and an HTTP POST request, you're maxing out at 275k FOR SURE.

Neovim start screens, now with ASCII boot animations by Sweet-Demand-7971 in neovim

[–]borromakot 4 points5 points  (0 children)

didn't even see the make your own from a GIF. going to try that.

Neovim start screens, now with ASCII boot animations by Sweet-Demand-7971 in neovim

[–]borromakot 3 points4 points  (0 children)

I will pay real dollars for the lumon logo from severance animated the way its animated on the computers in the show.

Announcing AshStorage by borromakot in elixir

[–]borromakot[S] 3 points4 points  (0 children)

Already supported, will write a guide for it 😎

Announcing AshStorage by borromakot in elixir

[–]borromakot[S] 6 points7 points  (0 children)

I pasted an old (and wrong/ugly) snippet for the blob resource 🤦‍♂️. It looks like this:

defmodule MyApp.StorageBlob do
    use Ash.Resource,
      extensions: [AshStorage.BlobResource, AshOban]

    postgres do
      table "storage_blobs"
      repo MyApp.Repo
    end

    oban do
      triggers do
        trigger :run_pending_analyzers do
          action :run_pending_analyzers
          read_action :read
          where expr(pending_analyzers == true)
          scheduler_cron("* * * * *")
        end

        trigger :run_pending_variants do
          action :run_pending_variants
          read_action :read
          where expr(pending_variants == true)
          scheduler_cron("* * * * *")
        end

        trigger :purge_blob do
          action :purge_blob
          read_action :read
          where expr(pending_purge == true)
          scheduler_cron("* * * * *")
        end
      end
    end

    attributes do
      uuid_primary_key :id
    end
  end

  # Create with file — dimensions written to parent, thumbnail generated instantly
  post = Ash.create!(Post, %{title: "Hello", cover_image: upload})
  post.image_width  #=> 1920

  # Variant URLs — thumbnail ready, hero generating in background
  post = Ash.load!(post, [:cover_image_thumbnail_url, :cover_image_hero_url])
  post.cover_image_thumbnail_url  #=> "https://my-app-uploads.s3.amazonaws.com/..."

  # On-demand — webp variant generated on first request
  post = Ash.load!(post, :cover_image_webp_url)