Skip to content

Instantly share code, notes, and snippets.

View arvindsivakumar's full-sized avatar

Arvind Sivakumar arvindsivakumar

  • New York, NY
View GitHub Profile
@arvindsivakumar
arvindsivakumar / search.ex
Last active September 12, 2025 13:49
Multi Conditional Search
read :search do
argument :query, :ci_string do
constraints allow_empty?: false
default ""
end
argument :role_filter, Role, allow_nil?: false
# Filtering expressions work on an individual row at a time rather than an entire table, helpful to parse
# the filtering logic in stages like so:
@arvindsivakumar
arvindsivakumar / user_auth.ex
Last active May 1, 2025 20:05
Signed In Path
def signed_in_path(%{assigns: %{current_scope: %{user: %{}}}}), do: ~p"/users/settings"
def signed_in_path(_), do: ~p"/listings"
@arvindsivakumar
arvindsivakumar / submission.ts
Last active April 15, 2025 18:02
Stainless Submission
export type Schema =
| {
type: "integer" | "string";
}
| {
type: "object";
properties: Record<string, Schema>;
};
const isNumberType = (value: any) => typeof value === "number";