Skip to content

Instantly share code, notes, and snippets.

View meantheory's full-sized avatar
:shipit:
shenanigans

Jeremiah Campbell meantheory

:shipit:
shenanigans
View GitHub Profile
@meantheory
meantheory / role.ex
Last active September 15, 2023 02:48
defmodule Example.UserRole do
use Ash.Resource, data_layer: AshPostgres.DataLayer, extensions: [AshTypeID]
postgres do
schema "this"
table "user_role"
repo Example.Repo
end
defmodule AshTypeID.TypeID do
@constraints [
prefix: [type: :string, doc: "Prefix", default: "id"],
# string?: [type: :boolean, doc: "String?", default: true]
]
@moduledoc """
AshTypeID - type-safe, K-sortable, globally unique identifier inspired by Stripe IDs.
```Elixir
first_column = {
1: "Tiny",
2: "Apple",
# ... fill in rest
31: "Sunny",
}
second_column = {
"A": "Rays",
"B": "Heart",
#!/usr/bin/env python
"""
Packet external inventory script
=================================
Usage: copy file to `/etc/ansible/hosts` and chmod +x the file.
This script sources data from the Packet api.

Keybase proof

I hereby claim:

  • I am meantheory on github.
  • I am meantheory (https://keybase.io/meantheory) on keybase.
  • I have a public key whose fingerprint is CB3A ECE8 A147 755B D881 B944 955B 6572 6006 D460

To claim this, I am signing this object: