This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##################################################### | |
| # COMMANDS | |
| # Commands are under "space space". | |
| # | |
| # Most commands may be run in a floating (f), down (j), or right (l) pane. | |
| # The "j" and "l" align with the movement keys (i.e. h,j,k,l). | |
| # | |
| # For example, to run a test under cursor in a pane below: | |
| # | |
| # "tab" = open command menu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| layout { | |
| default_tab_template { | |
| children | |
| pane size=2 borderless=true { | |
| plugin location="zellij:status-bar" | |
| } | |
| } | |
| tab name="dev" focus=true { | |
| pane split_direction="vertical" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Static tasks configuration. | |
| [ | |
| { | |
| "label": "Sublime Merge", | |
| "command": "smerge .", | |
| "reveal": "never", | |
| "hide": "always" | |
| }, | |
| { | |
| "label": "Lazygit", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| //////////////////////////////////////////// | |
| // All Contexts | |
| //////////////////////////////////////////// | |
| { | |
| "bindings": { | |
| // Open Project | |
| "cmd-shift-p": "projects::OpenRecent", | |
| // Left Dock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "assistant": { | |
| "default_model": { | |
| "provider": "copilot_chat", | |
| "model": "gpt-3.5-turbo" | |
| }, | |
| "version": "2" | |
| }, | |
| "auto_update": true, | |
| "theme": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule MyApp.Crud do | |
| defmacro list(config) do | |
| quote bind_quoted: [config: config] do | |
| def unquote(:"list_#{config.plural_name}")(queries \\ & &1) do | |
| unquote(config.schema) | |
| |> queries.() | |
| |> unquote(config.repo).all() | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule MyApp.Factories.BuildStubbedStrategy do | |
| use ExMachina.Strategy, function_name: :build_stubbed | |
| alias Ecto.Association.BelongsTo | |
| alias Ecto.Association.Has | |
| alias Ecto.Association.NotLoaded | |
| alias Ecto.UUID | |
| def handle_build_stubbed(record, _opts \\ []) do | |
| record |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################################ | |
| # APP ROLES | |
| ############################################################ | |
| def insert_app_super_admin_role, do: insert(:super_admin) |> Roles.role_for() | |
| def insert_app_admin_role, do: insert(:admin) |> Roles.role_for() | |
| def insert_app_marketer_role, do: insert(:marketer) |> Roles.role_for() | |
| def insert_app_user_role, do: insert(:user) |> Roles.role_for() | |
| def insert_all_app_roles, do: insert_app_roles(@roles) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unit_statuses = | |
| # There is a Unit schema that is tied to a "units" table | |
| from(unit in Unit, | |
| # grab a lease tied to a unit (office space) | |
| # Leases have start and end dates so the lease must be during the week | |
| # of the given `date`. This will scope leases to that requirement. | |
| left_join: lease in ^Leasing.filter_active_leases_during_week(Lease, date), | |
| on: lease.unit_id == unit.id, | |
| # join the unit type (Salon, Office, Focus, etc) | |
| join: unit_type in assoc(unit, :unit_type), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Capturepipe do | |
| @doc """ | |
| A pipe-operator that extends the normal pipe | |
| in one tiny way: | |
| It allows the syntax of having a bare `&1` capture | |
| to exist inside a datastructure as one of the pipe results. | |
| This is useful to insert the pipe's results into a datastructure | |
| such as a tuple. |
NewerOlder