This file contains 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 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 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 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 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 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 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 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. |
This file contains 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 S3.DirectUpload do | |
import ExAws.Auth.Utils, only: [amz_date: 1] | |
import ExAws.S3.Utils | |
@default_max_size_kilobytes 5_242_880 | |
@default_expiry_seconds 3600 | |
@type canned_acl :: | |
:private | |
| :public_read |
This file contains 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 Elevate.Networking.NetworkUpdater do | |
alias Elevate.Networking.NetworkConnection, as: Connection | |
alias Elevate.Networking.SubnetBuilder | |
def disable_access( | |
user_id: user_id, | |
network_id: network_id, | |
vlan_only_id: vlan_only_id, | |
site_id: site_id | |
) do |
NewerOlder