content_id
large_stringlengths
40
40
size_bytes
int64
1.5k
25k
repo_ids
large listlengths
1
410
tags
large listlengths
0
7
content
large_stringlengths
681
25k
05d6e2e74899979d7bd97f26ec0d9d8ac2155504
1,564
[ 97303687 ]
[ "macro", "documented", "phoenix" ]
defmodule TwoMinutes.Web do @moduledoc """ A module that keeps using definitions for controllers, views and so on. This can be used in your application as: use TwoMinutes.Web, :controller use TwoMinutes.Web, :view The definitions below will be executed for every view, controller, etc, so keep...
05d716a74d533cad7bdc731677edbba968b56664
2,223
[ 72379119 ]
[ "documented" ]
defmodule Ueberauth.Strategy.Heroku.OAuth do @moduledoc """ An implementation of OAuth2 for Heroku. To add your `client_id` and `client_secret` include these values in your configuration. config :ueberauth, Ueberauth.Strategy.Heroku.OAuth, client_id: System.get_env("HEROKU_CLIENT_ID"), cli...
05d7a1a130b9d6a47b9696dadba8c586d8e40cc3
1,977
[ 130404696 ]
[]
defmodule HeliosWeb.Schema.Resolvers.Location do alias HeliosWeb.Schema.Helpers.Location, as: LocationHelpers alias HeliosWeb.Clients.WeatherClient alias Helios.{Repo, Locations.Location, Events.Announcement, Widgets.TrafficCam} def location(_parent, %{city_name: city_name}, _info) do {:ok, Repo.get_by(Loc...
05d7d0abfbe885edf854c5eff094140e46d9d96d
2,880
[ 760034052 ]
[ "genserver", "liveview", "ecto" ]
defmodule LiveViewStudioWeb.DesksLive do use LiveViewStudioWeb, :live_view alias LiveViewStudio.Desks alias LiveViewStudio.Desks.Desk @s3_bucket "liveview-uploads" @s3_url "//#{@s3_bucket}.s3.amazonaws.com" @s3_region "us-west-2" def mount(_params, _session, socket) do if connected?(socket), do: De...
05d7d1b323202dc646da086ace23994a20fdc4c8
2,917
[ 208383529 ]
[ "test" ]
defmodule Hangman.GameTest do use ExUnit.Case alias Hangman.Game test "new_game returns structure" do game = Game.new_game() assert game.turns_left == 7 assert game.game_state == :initializing assert game.letters > 0 assert game.letters |> Enum.all?(&(?a <= &1 and &1 >= ?z)) end test "...
05d81765575c82e3f4d330f3ea6b539aed7f1485
2,952
[ 434173773 ]
[]
defmodule AdventOfCodex2022.Day11 do defmodule Monkey do defstruct [:id, :items, :op, :num, :test, :if_true, :if_false] end defmodule Item do defstruct [:id, :val, views: %{}] end def puzzle1() do monkeys = input_to_monkeys() limiter_fn = &div(&1, 3) monkeys |> Enum.map(&Map.get(&1 ...
05d8402734512316c76bea83665bcc3257a622fd
2,907
[ 338118832 ]
[ "liveview", "ecto" ]
defmodule EpiViewpointWeb.CaseInvestigationStartInterviewLive do use EpiViewpointWeb, :live_view import EpiViewpointWeb.ConfirmationModal, only: [confirmation_prompt: 1] import EpiViewpointWeb.IconView, only: [back_icon: 0] import EpiViewpointWeb.Forms.StartInterviewForm, only: [start_interview_form_builder: 2...
05d8482b9c2cfbab151986527bfa47c2fd86f338
3,322
[ 413973130 ]
[]
defmodule Fade.Broker.ConnectionTypes do use TypedStruct alias Fade.Broker.Core.Types.Rate typedstruct module: GarbageCollectionDetails do field(:minor_garbage_collection, String.t()) field(:full_sweepAfter, integer()) field(:minimum_heap_size, integer()) field(:minimum_binary_virtual_heap_size,...
05d8aa7e4e26559f3fbb94f67b1f646b7070c2b5
3,386
[ 179247377 ]
[ "test" ]
defmodule CanTest do use ExUnit.Case alias SignalBase.Message # Create a suporvised instance. # See code for `AppNgCan.start_link` for clarification. test "test create message" do supervised_start() GenServer.cast(:canWriter, {:signal, %Message{name_values: [{WheelSpeedReR, 10}, {FuelLevelIndicated, ...
05d8aa88f74df9602d8fcdc31f1a4946463130fd
3,910
[ 372520469 ]
[]
%{ "bakeware": {:hex, :bakeware, "0.2.0", "e2efb323cc25e857ac2869f0d25a92cac55ed6e1f53399cb5c035d211d27d5ce", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "cad65fcf20162d60c2a159238d1ebfa1f9763b5d671b0992caf1777be42fe3ae"}, "certifi": {:hex, :certifi, "2.6...
05d8c18da771e14548bc00c6d37112b8067d34c1
2,473
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoCloudKmsConfig do @moduledoc """ ## Attributes * `gcpProjectId` (*type:* `String.t`, *default:* `nil`) - Optional. The id of GCP project where the KMS key is stored. If not provided, assume the key is stored in the same GCP project defined i...
05d9109134e25a320218ec865723b2f8c31e778a
2,832
[ 483186965 ]
[ "test" ]
defmodule EtherManagement.TranscationsTest do use EtherManagement.DataCase alias EtherManagement.Transactions test "create_transaction/1 with valid data creates a transaction" do valid_attrs = %{ "blockHash" => "0xbaee22af41ce5cb4d28a6a377da26f4fc4f9d893fdfaa6878fb732f42367a947", "blockNumber" =>...
05d920bfd1aa2e6c80d38e3cbde75f695e5a0e0a
2,829
[ 532029827 ]
[ "genserver" ]
defmodule RumblWeb.VideoChannel do use RumblWeb, :channel alias Rumbl.{Accounts, Multimedia} alias RumblWeb.AnnotationView @impl true def join("videos:" <> video_id, params, socket) do send(self(), :after_join) last_seen_id = params["last_seen_id"] # socket = assign(socket, :video_id, String.to_...
05d93d9502a7f0082e964941d1211395e139ffc6
2,010
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaSearchResponseSummaryReference do @moduledoc """ Document reference. ## Attributes * `chunkContents` (*type:* `list(GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaSearchResponseSummaryReferenceChunkConte...
05da20fc48dd9b9364a3f3273387d6b5c3c4596a
3,760
[ 990619007 ]
[ "liveview", "test" ]
defmodule MyappWeb.PostLiveTest do use MyappWeb.ConnCase import Phoenix.LiveViewTest import Myapp.BlogFixtures @create_attrs %{title: "some title", body: "some body"} @update_attrs %{title: "some updated title", body: "some updated body"} @invalid_attrs %{title: nil, body: nil} setup :register_and_log_...
05da2a3e52a03a944d9e9822a4efde6a80d8d2e9
3,291
[ 821328923 ]
[ "supervisor", "documented" ]
defmodule SupermarketCashier.CheckoutSupervisor do @moduledoc """ A `DynamicSupervisor` responsible for supervising checkout processes. This supervisor dynamically starts and supervises `SupermarketCashier.Checkout` processes. Each checkout process can handle a different set of pricing rules. ## Example ...
05da66e8338966e79ca5e2ce470da41f26f5fc56
13,887
[ 1004256260 ]
[ "documented", "ecto" ]
defmodule CrimeToGo.Player do @moduledoc """ The Player context. This context manages player-related operations including creation, game membership, host management, and avatar/nickname availability checking. """ import Ecto.Query, warn: false alias CrimeToGo.Repo alias CrimeToGo.Shared alias Crime...
05da76a1dd3ffc4ce22bd108f86f0920e666dd4e
5,105
[ 168225131 ]
[]
%{ "argon2_elixir": {:hex, :argon2_elixir, "2.0.1", "ee3fb90f070d1286fad09018bb0cc03f1fead27137e990d0694cbbd4392fe99e", [:make, :mix], [{:comeonin, "~> 5.1", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"}, "artificery": {:h...
05da802e4ddc851f66980dd8ee0dbb6dcdaabfe9
5,446
[ 226820764 ]
[ "genserver", "typespec", "supervisor" ]
defmodule MishkaContent.Cache.ContentDraftManagement do use GenServer, restart: :temporary require Logger alias MishkaContent.Cache.ContentDraftDynamicSupervisor @type params() :: map() @type id() :: String.t() @type token() :: String.t() def start_link(args) do id = Keyword.get(args, :id) || Ecto.U...
05dac50017287dec59f50d235393c5cf87c64a7e
1,687
[ 105159340 ]
[]
defmodule MontrealElixirWeb.Mixfile do use Mix.Project def project do [app: :montreal_elixir_web, version: "0.0.1", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", elixir: "~> 1.5.1", elixirc_paths: elix...
05db0acc118ecbfae7ee209d8d0f31b7a63f1286
1,809
[ 49292670 ]
[ "documented" ]
defmodule Cog.Repository.Permissions do alias Cog.Models.Permission alias Cog.Repo def all do Permission |> Repo.all |> Repo.preload(:bundle) end def by_name(full_name) do case Cog.Queries.Permission.from_full_name(full_name) |> Repo.one do %Permission{}=permission -> preload(...
05db11f5a99a582a042cbec08c8dadff588151b0
4,772
[ 149684258 ]
[ "typespec" ]
defmodule LifeCLI do @rle_regex :re.compile("((\d*)(b|o))") @grid %{0 => %{0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0}, 1 => %{0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0}, 2 => %{0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 =...
05dbcffd3267a2077df4c22bc05465ff36dac9e1
2,441
[ 1015079188 ]
[]
# Script for populating the database. You can run it as: # # mix run priv/repo/seeds.exs # # Inside the script, you can read and write to any of your # repositories directly: # # HakuServer.Repo.insert!(%HakuServer.SomeSchema{}) # # We recommend using the bang functions (`insert!`, `update!` # and so on) as the...
05dc5344764f17ccec8ecab6de0359cc354dea60
2,697
[ 512311278 ]
[ "ecto" ]
defmodule StatesApi.Resolve.Logradouro do use StatesApiWeb, :graphql_resolver alias StatesApi.{Logradouro, LogradouroSearch, Helpers} def handle(%{cep: cep}, _) do { :ok, with_cep(cep) |> by_nome() |> Repo.all() } end def handle(%{busca: nil}, _), do: {:error, "Especifique uma busca"} ...
05dc7cff85f293336a6d1864e39b1e65b0245e5e
15,923
[ 739262096, 223255738, 1234714, 742840268, 139261729 ]
[ "macro", "test" ]
Code.require_file("../test_helper.exs", __DIR__) defmodule Kernel.ComprehensionTest do use ExUnit.Case, async: true import ExUnit.CaptureIO require Integer defmodule Pdict do defstruct [] defimpl Collectable do def into(struct) do fun = fn _, {:cont, x} -> Process.put(:into_c...
05dc8b8f924e8a7dc113ec43f6e2412d0e8580f8
1,826
[ 46998301, 47085266 ]
[]
defmodule Jumble.Helper.Stats do alias Jumble.Helper @factorial_cache 1..50 |> Enum.scan(&(&1 * &2)) |> Helper.with_index(1) |> Enum.into(Map.new) ##################################### external API ##################################### # ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ...
05dc96c7d1917ef688add67eb9058f010944d016
1,767
[ 548014039 ]
[ "genserver", "liveview" ]
defmodule RealtimeWeb.BetterProductLive.Show do use RealtimeWeb, :live_view alias Realtime.BetterCommerce alias Realtime.Commerce.InventoryEvents alias Realtime.Commerce.Product alias Realtime.Commerce.User @impl true def mount(_params, _session, socket) do {:ok, socket} end @impl true def ha...
05dc9b20d774434b9269fe637471add961539e0f
12,417
[ 809314488 ]
[ "documented", "ecto" ]
defmodule Planet.Cosmos do @moduledoc """ The Cosmos context. """ import Ecto.Query, warn: false alias Planet.Repo alias Planet.Cosmos.Asset alias Planet.Cosmos.SocialIssue alias Planet.Cosmos.Solution @doc """ Returns the list of assets. ## Examples iex> list_assets() [%Asset{}, ...
05dd5e5673b0257b86c7f6f0c2b54710a3fe2ba9
4,504
[ 67210941 ]
[ "test" ]
defmodule HexWeb.RegistryBuilderTest do use HexWeb.ModelCase, async: true alias HexWeb.User alias HexWeb.Package alias HexWeb.Release alias HexWeb.Install alias HexWeb.RegistryBuilder @ets_table :hex_registry @endpoint HexWeb.Endpoint setup do user = User.build(%{username: "eric", email: "<EMAI...
05dd8adf5634a5199d24039d0dc5540cc4ae8482
1,625
[ 86480476 ]
[ "macro", "documented", "ecto", "phoenix" ]
defmodule Kptboard.Web do @moduledoc """ A module that keeps using definitions for controllers, views and so on. This can be used in your application as: use Kptboard.Web, :controller use Kptboard.Web, :view The definitions below will be executed for every view, controller, etc, so keep them ...
05ddc58688ad6c2160fd085796c8b3f7bb0afd84
5,002
[ 148630360 ]
[]
%{ "bbmustache": {:hex, :bbmustache, "1.12.2", "0cabdce0db9fe6d3318131174b9f2b351328a4c0afbeb3e6e99bb0e02e9b621d", [:rebar3], [], "hexpm", "688b33a4d5cc2d51f575adf0b3683fc40a38314a2f150906edcfc77f5b577b3b"}, "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:...
05ddcebdff6fe2274d977e3fbdba69a23fe36a10
1,596
[ 50949065 ]
[ "documented" ]
defmodule GitHubAuth do @moduledoc """ An OAuth2 strategy for GitHub. """ use OAuth2.Strategy alias OAuth2.Strategy.AuthCode @github_access_token Application.get_env(:hex_faktor, :github_access_token) @github_client_id Application.get_env(:hex_faktor, :github_client_id) @github_client_secret Applicati...
05dee32f93373c8c24a54b504fd3cf01a2a44db0
3,802
[ 314758276 ]
[]
defmodule TweetCollector.Repo do alias GoogleApi.Firestore.V1.Api.Projects alias GoogleApi.Firestore.V1.Model def connect() do {:ok, token} = Goth.Token.for_scope("https://www.googleapis.com/auth/cloud-platform") GoogleApi.Firestore.V1.Connection.new(token.token) end def find(conn, path) do cas...
05df332a5231b0763ab2729b4710e3c7c8a102f1
3,532
[ 529451757, 567369526, 588790131, 712696481, 563730500 ]
[ "genserver", "typespec", "documented", "ecto" ]
defmodule Explorer.Counters.AverageBlockTime do use GenServer @moduledoc """ Caches the number of token holders of a token. """ import Ecto.Query, only: [from: 2, where: 2] alias Explorer.Chain.Block alias Explorer.Repo alias Timex.Duration @doc """ Starts a process to periodically update the co...
05df3d3e9cc94b607cff2ebef1f3b37df7bc1fa8
1,931
[ 82679362 ]
[]
defmodule Game.ItemStore do def create_table do :ets.new(__MODULE__, [:public, :named_table, read_concurrency: true]) end def options_pool(name) do %{creators: creators_by_category(name), locations: locations_by_category(name), creation_date...
05df413f2928454f34b9269bad76f5c2de2b4cef
1,568
[ 98200103 ]
[ "test" ]
defmodule Cake.EmailTest do use ExUnit.Case alias Cake.Email doctest Email defmodule TestTemplate do defstruct [ formatter: &TestTemplate.format/1, name: nil, message: nil ] def format(%{ name: name, message: message }) do %Email{...
05dfd5bc1dae64050ef0b9350003d6121cf71668
8,118
[ 829059969 ]
[ "typespec", "documented" ]
defmodule BACnet.Protocol.Services.AcknowledgeAlarm do @moduledoc """ This module represents the BACnet Acknowledge Alarm service. The Acknowledge Alarm service is used to acknowledge a human operator has seen the alarm notification. Service Description (ASHRAE 135): > In some systems a device may need to k...
05e02aaaef1055df4bc4ef17ecfeabe487537557
2,015
[ 248817168 ]
[ "test", "documented" ]
defmodule Membrane.RTP.MuxerDemuxerTest do @moduledoc false use ExUnit.Case import Membrane.Testing.Assertions alias Membrane.Testing @input_path "test/fixtures/rtp/h264/bun.h264" defmodule MuxerDemuxerPipeline do use Membrane.Pipeline @impl true def handle_init(_ctx, opts) do spec = [ ...
05e06fb033674978a6eec05b1300941c817dbcd5
1,626
[ 162990301 ]
[]
defmodule Semtex.Utils do def scheme(nil) do nil end def scheme(raw_str) when is_binary(raw_str) do raw_str |> String.trim() |> String.split(":", parts: 2, trim: true) |> case do [scheme | _] -> scheme _ -> nil end end def unwrap_nodes([], [_tag_to_find |...
05e0ef6650f3f06b20ab73b097e456d1e1338e2e
6,651
[ 967333066 ]
[ "typespec", "documented" ]
defmodule Eventasaurus.Services.PollAnalyticsService do @moduledoc """ Service for tracking poll-related analytics events to PostHog. Handles all poll engagement metrics including voting, creation, and interactions. """ alias Eventasaurus.Services.PosthogService require Logger # Poll creation events @...
05e1190fdfd2bbc74104877fdf3cc10b0c9a7c4f
12,040
[ 418504855 ]
[ "typespec", "liveview", "documented", "ecto" ]
defmodule Flagsmith.Client.Poller do @moduledoc false require Logger alias Flagsmith.Configuration alias Flagsmith.Schemas @behaviour :gen_statem @type poller_identifier :: {__MODULE__, String.t()} @type environment_key :: String.t() @type identity_id :: String.t() | non_neg_integer() @default_ref...
05e17accad90cdb0ddda104362de332b2c019b2b
1,994
[ 1015669945 ]
[]
#!/usr/bin/env elixir # Examine Arsenal layout issues Mix.install([ {:playwriter, github: "nshkrdotcom/playwriter"} ]) defmodule ExamineArsenalLayout do require Logger @base_url "http://localhost:4000" @arsenal_url "#{@base_url}/arsenal" def run do Logger.info("Examining Arsenal layout issues...") ...
05e17c66a07b4fed481345c99f77993b3824d74e
1,760
[ 44694475 ]
[ "phoenix" ]
defmodule FacebookClone.PostView do use FacebookClone.Web, :view alias FacebookClone.Like alias FacebookClone.Repo alias FacebookClone.Group def post_links(conn, post, current_user_id) do if post.user_id == current_user_id do [ link("Edit", to: post_path(conn, :edit, post)), link(...
05e1a66a2c9062e8c397f5604343305b390bbe84
8,045
[ 227165372 ]
[]
defmodule Militerm.Systems.Entity.Timers do alias Militerm.Systems.Entity def add_recurring_timer({:thing, entity_id, coord}, delay, event, args) do add_recurring_timer({:thing, entity_id}, delay, event, Map.put(args, "coord", coord)) end def add_recurring_timer({:thing, entity_id} = entity, delay, event,...
05e216e2c18c519c58eb5025af3630b8c42c7d33
5,925
[ 973638971 ]
[ "genserver", "liveview", "ecto" ]
defmodule PoofWeb.TodayLive.Index do use PoofWeb, :live_view alias Poof.ExpiryNotes alias PoofWeb.TodayLive.EditNoteComponent # ---------------------------------------------------------------------------- # Mount # ---------------------------------------------------------------------------- @impl true ...
05e2d1f850201b2328dd12944822a7c332612e57
6,635
[ 939806310 ]
[ "liveview" ]
# lib/workout_tracker_web/live/landing_live.ex defmodule WorkoutTrackerWeb.LandingLive do use WorkoutTrackerWeb, :live_view def mount(_params, _session, socket) do {:ok, socket} end def handle_params(_params, _uri, socket) do {:noreply, socket} end def render(assigns) do ~H""" <link rel=...
05e2f4665361a7fc53a46377af15749876eef015
5,998
[ 85307666 ]
[]
%{ "castore": {:hex, :castore, "0.1.5", "591c763a637af2cc468a72f006878584bc6c306f8d111ef8ba1d4c10e0684010", [:mix], [], "hexpm", "6db356b2bc6cc22561e051ff545c20ad064af57647e436650aa24d7d06cd941a"}, "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{...
05e35c1f7af5d2d51468c8268be5494b731905f9
3,017
[ 176420218 ]
[ "test", "phoenix" ]
defmodule SelfWeb.CompraControllerTest do use SelfWeb.ConnCase alias Self.Movimentacao @create_attrs %{data: ~D[2010-04-17], desconto: "120.5", icms: "some icms", numero: "some numero", vencimento: ~D[2010-04-17]} @update_attrs %{data: ~D[2011-05-18], desconto: "456.7", icms: "some updated icms", numero: "som...
05e3ba83adb15e54d3703694da9ea07a06284824
3,633
[ 57192889 ]
[ "phoenix", "ecto" ]
defmodule VutuvWeb.PasswordResetController do use VutuvWeb, :controller alias Vutuv.{Accounts, UserProfiles} alias VutuvWeb.{Auth.Otp, Email} plug VutuvWeb.RateLimiter, [type: :password_reset] when action in [:create] def new_request(conn, _params) do render(conn, "new_request.html") end def creat...
05e3ff78fad81e7b0ecf19173944269558be26e8
4,488
[ 958547004 ]
[ "test", "documented" ]
defmodule SharedUtils.Test.Support.HTTPSandbox do @moduledoc """ For mocking out HTTP GET requests in test. Stores a map of functions in a Registry under the PID of the test case when `set_get_responses/1` is called. """ @registry :http_sandbox @keys :unique # state is a sub-key to allow multiple cont...
05e4164a87ff7949ea9c681f055699c24435b66e
5,978
[ 240986321 ]
[ "test" ]
defmodule SwitchX.Test.Connection.Inbound do use ExUnit.Case, async: false import Mock alias SwitchX.{ Connection } describe "Test authentication" do setup do port = 9900 connection_opts = [ host: "127.0.0.1", port: port ] SwitchX.Test.Mock.ESLServer.start_...
05e4440d0282405a5f9f39daf6f17f57fb2e98b8
4,250
[ 993653045 ]
[ "liveview" ]
defmodule OfftherecordWeb.AuthLive do use OfftherecordWeb, :live_view @impl true def mount(_params, _session, socket) do {:ok, socket} end @impl true def render(assigns) do ~H""" <div class="min-h-screen bg-gray-50 flex items-center justify-center p-6"> <div class="max-w-md w-full"> ...
05e494651a5c0f41e10ef7a9b75354bc729458fd
1,827
[ 269783465 ]
[ "liveview" ]
defmodule LittlechatWeb.Room.NewLive do use LittlechatWeb, :live_view alias Littlechat.Repo alias Littlechat.Room @impl true def render(assigns) do ~L""" <main class="main main--new-room"> <%= form_for @changeset, "#", [phx_change: "validate", phx_submit: "save", class: "form"], fn f -> %> ...
05e4e5a9e84a8b6334e74422f2e1f97751330697
2,437
[ 650889764 ]
[ "phoenix" ]
defmodule BnApisWeb.FeedTransactionView do use BnApisWeb, :view alias BnApisWeb.FeedTransactionView alias BnApis.Helpers.Time alias BnApis.FeedTransactions.FeedTransactionLocality def render("index.json", %{ feed_transactions: feed_transactions, total_count: total_count, has_more_feed...
05e4e83863a2fdf2b45ea300975efe9cd088cbb0
3,496
[ 147044165 ]
[]
defmodule Worker do # TODO: Multi processes without duplicate names #def init(name) do @name :worker #end #@result_list [] def fetchTask(boss_pid, is_new_process) do if is_new_process do send(boss_pid, {self(), :fetch_task, []}) end receive do ...
05e5e144e1ff78e198021da40141c0e8d2e118b4
2,599
[ 191315971 ]
[ "phoenix", "ecto" ]
defmodule SchoolWeb.AssessmentMarkController do use SchoolWeb, :controller alias School.Affairs alias School.Affairs.AssessmentMark def index(conn, _params) do assessment_mark = Affairs.list_assessment_mark() render(conn, "index.html", assessment_mark: assessment_mark) end def assessment_report(c...
05e6a8c40388e3f5eb88255b121bf2feb0037fbc
2,830
[ 318691177 ]
[ "test", "ecto" ]
defmodule Monobanco.CustomersTest do use Monobanco.DataCase alias Monobanco.Customers describe "transactions" do alias Monobanco.Customers.Transaction @valid_attrs %{amount: 120, category: "some category", description: "some description", is_deposit: true} @update_attrs %{amount: 456, category: "so...
05e6a9ffd68616ddebc0b59affa63be0191b6708
1,754
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec do @moduledoc """ A specification for configuring snippets in a search response. ## Attributes * `maxSnippetCount` (*type:* `integer()`, *default:* `nil`) - [DEPRECATED] This field is d...
05e79174fa23150069b08ed0ae6c0701fbd62cae
1,743
[ 282221604 ]
[]
defmodule Poker.Card do defstruct value: nil, suit: nil def render_hidden do "🂠" end def render(nil) do "" end def render(%Poker.Card{value: v, suit: s}) do case {v,s} do {1 ,:hearts} -> "🂱" {2 ,:hearts} -> "🂲" {3 ,:hearts} -> "🂳" {4 ,:hearts} -> "🂴" {5 ,:he...
05e7ac92b5096a24210e4d95140cb4acb6635fb7
1,840
[ 93285553 ]
[]
defmodule Kronky.Mixfile do use Mix.Project @version "0.5.0" def project do [ app: :kronky, version: @version, elixir: "~> 1.4", test_coverage: [tool: ExCoveralls], preferred_cli_env: [coveralls: :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test...
05e81893e89165055478e691fa9f069f535e77cb
7,000
[ 1013321258 ]
[ "typespec", "documented" ]
defmodule RubberDuck.Planning.Execution.ExecutionState do @moduledoc """ Manages the execution state for plan execution. Tracks task statuses, dependencies, resources, and provides state snapshots for checkpointing and rollback. """ defstruct [ :execution_id, :plan_id, :all_tasks, :complet...
05e826003dfc1ae1d8834dc326179ce330ebf11e
2,729
[ 102299144 ]
[ "genserver", "documented" ]
defmodule Mpdart.Middleware.Mpd.Util do @moduledoc """ Add document """ import Logger use GenServer alias Mpdart.Middleware.Mpd.Query def start_link(_) do Logger.debug fn -> "Mpdart.Middleware.Mpd.Util start" end {:ok, pid} = GenServer.start_link(__MODULE__, []) Process.register(pid, :ut...
05e8398904d26ad0df4d97651071cd7c2ecd741d
2,597
[ 141150118 ]
[ "genserver" ]
defmodule Cryptozaur.Drivers.GateRest do use HTTPoison.Base use GenServer require OK import OK, only: [success: 1, failure: 1] import Logger import Cryptozaur.Utils @timeout 600_000 @http_timeout 30000 def start_link(state, opts \\ []) do GenServer.start_link(__MODULE__, state, opts) end de...
05e847f816a9b8f7c2465d0adc2d72c071f12753
5,026
[ 136544670 ]
[ "typespec", "documented", "ecto", "phoenix" ]
defmodule PartyplugWeb.Coherence.PasswordController do @moduledoc """ Handle password recovery actions. Controller that handles the recover password feature. Actions: * new - render the recover password form * create - verify user's email address, generate a token, and send the email * edit - render th...
05e880854ee03c11fdf678ec509b9d3fd104f297
1,637
[ 235479037 ]
[ "phoenix" ]
defmodule PortfolioMonitorWeb.Endpoint do use Phoenix.Endpoint, otp_app: :portfolio_monitor use Appsignal.Phoenix socket "/socket", PortfolioMonitorWeb.UserSocket, websocket: [timeout: 45_000], longpoll: false # Serve at "/" the static files from "priv/static" directory. # # You should set gzip to...
05e8843d8e56f17e3e51a4a5dc6ab93a0463e336
5,536
[ 281158280 ]
[ "documented" ]
defmodule Linear.Actions do require Logger alias __MODULE__ alias Linear.Synchronize.Event alias Linear.Synchronize.ContentWriter @doc """ """ def for_event(%Event{source: :github, action: :opened_issue} = event, context) do handle_existing_linear_issue = if context.issue_sync.sync_github_issu...
05e8e2a1fdd9e349716ccad000e6468f5293256c
2,683
[ 328011745 ]
[ "test", "phoenix" ]
defmodule HotwirePhoenixDemoChatWeb.RoomControllerTest do use HotwirePhoenixDemoChatWeb.ConnCase alias HotwirePhoenixDemoChat.Chat @create_attrs %{name: "some name"} @update_attrs %{name: "some updated name"} @invalid_attrs %{name: nil} def fixture(:room) do {:ok, room} = Chat.create_room(@create_att...
05e90a0a371dadd67a32425ff4b998b53bdd2269
1,669
[ 466233588 ]
[ "typespec", "documented" ]
defmodule Ppc.Plan.PricingScheme do @moduledoc """ ## Reference - [Pricing Scheme docs](https://developer.paypal.com/api/subscriptions/v1/#definition-pricing_scheme) """ alias Ppc.Plan.{PricingTier, Money} defstruct [:version, :fixed_price, :pricing_model, :tiers] @type pricing_model :: nil | :volume |...
05e92ccac3b341b5be2e933887eeadd4c042db2c
1,695
[ 465488115 ]
[]
defmodule GenReport do alias GenReport.Parser @avariable_persons [ "daniele", "mayk", "giuliano", "cleiton", "jakeliny", "joseph", "diego", "danilo", "rafael", "vinicius" ] def build(filename) do filename |> Parser.parse_file() |> Enum.reduce(report_acc(), &s...
05e979f18fad12143a4e3174577266adec64c74a
4,166
[ 52833973 ]
[ "test" ]
defmodule ShakerTest do use ShouldI alias HTTPotion.Response import Plug.Conn.Status defp response(body \\ "foobar"), do: %Response{status_code: 200, body: body} should "pass status code on non-200 responses" do assert %Response{status_code: 420, body: "foobar"} |> Shaker.parse_salt_resp == 420 end ...
05ea858905b432a8834ea6ae932cfb97e53d0808
1,801
[ 72556503 ]
[ "phoenix" ]
defmodule Pomerol.UserView do use Pomerol.Web, :view def render("index.json", %{users: users}) do %{data: render_many(users, Pomerol.UserView, "user.json")} end def render("show.json", %{user: user}) do %{ user: render_one(user, Pomerol.UserView, "user.json"), organizations: render_many(us...
05eab00b5b339dedd3fc1ab053fbdde006b8a141
6,279
[ 119285389 ]
[]
%{ "certifi": {:hex, :certifi, "2.0.0", "a0c0e475107135f76b8c1d5bc7efb33cd3815cb3cf3dea7aefdd174dabead064", [:rebar3], []}, "connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], []}, "cowboy": {:hex, :cowboy, "1.1.2", "61ac29ea970389a88eca5a65601460...
05eab47ddc20fa3bfe608cbc64488c42478943f3
5,106
[ 150022048 ]
[ "documented", "ecto" ]
defmodule Myflightmap.Travel.Flight do @moduledoc """ A flight owned by a user. """ use Ecto.Schema import Ecto.Changeset alias Myflightmap.Accounts.User alias Myflightmap.Transport alias Myflightmap.Transport.{AircraftType, Airline, Airport} alias Myflightmap.Travel.Trip schema "flights" do b...
05eabc8cf0365923d451b526feabce8345fa5557
16,312
[ 73010257 ]
[]
%{ "bbmustache": {:hex, :bbmustache, "1.8.1", "22af8ad50383b7022066c246486aaf2db980e3883c6c620600e9299caa420c10", [:rebar3], [], "hexpm", "4e8d1a5870f6e874e917cdc55e5c874c1b1965b9b5e8e34c69c01699ba48626c"}, "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:re...
05eada559408f696cb473f0fee30fe581d590f0d
7,595
[ 35227066 ]
[ "documented" ]
defmodule ElixirFBP.Subscription do @moduledoc """ A Subscription serves as a conduit and a control mechanism for the delivery of data from Publishers (Components) to Subscribers (Components). A Subscriber must specify how many IPs it is willing to receive via a {:request, n} message where n is some integer o...
05eb264f546d83b70747f7bc5240faf071a1706d
3,194
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.DriveActivity.V2.Model.QueryDriveActivityRequest do @moduledoc """ The request message for querying Drive activity. ## Attributes * `ancestorName` (*type:* `String.t`, *default:* `nil`) - Return activities for this Drive folder, plus all children and descendants. The format is `items/ITE...
05eb3212432aa613d7202b907aecbbbf079314db
8,690
[ 996920193 ]
[ "test", "documented" ]
defmodule MABEAM.DiscoveryContractTest do @moduledoc """ Property-based contract tests for MABEAM.Discovery service boundaries. This test module validates that Discovery service implementations consistently follow the proper contract format, preventing the API evolution mismatches identified in P23aTranscend...
05eb32190511bb99cf87981166fe7e4a2458d69a
2,278
[ 756918333 ]
[ "test", "ecto" ]
defmodule CurrencyTrader.AgentsTest do use CurrencyTrader.DataCase alias CurrencyTrader.Agents describe "agents" do alias CurrencyTrader.Agents.Agent import CurrencyTrader.AgentsFixtures @invalid_attrs %{name: nil, username: nil, hash_password: nil} test "list_agents/0 returns all agents" do ...
05ebea559943abde41d73a4a62d2f77699b8783e
2,637
[ 354406133 ]
[ "documented", "ecto" ]
defmodule CookingApp.OwnedIngredients do @moduledoc """ The OwnedIngredients context. """ import Ecto.Query, warn: false alias CookingApp.Repo alias CookingApp.OwnedIngredients.OwnedIngredient @doc """ Returns the list of ownedingredients. ## Examples iex> list_ownedingredients() [%Ow...
05ec0a0fdeaf6d3df194da80beaf3dff7e0ee333
9,551
[ 196200304, 211097139, 19643959, 180274417 ]
[ "test" ]
Code.require_file("test_helper.exs", __DIR__) defmodule VersionTest do use ExUnit.Case, async: true doctest Version alias Version.Parser test "compare/2 with valid versions" do assert Version.compare("1.0.1", "1.0.0") == :gt assert Version.compare("1.1.0", "1.0.1") == :gt assert Version.compare(...
05ec6eba0a1253b8e9aa74a5252b5ae6e7341fbf
3,124
[ 435695470 ]
[]
defmodule AdventOfCode.Aoc2021.Day9SmokeBasin do use AdventOfCode def part_1(input) do lists = parse(input) build_neighbors(lists) |> get_smallest_neighbor(lists) |> Enum.filter(fn {{_, v1}, {_, v2}} -> v1 < v2 end) |> find_lowpoints() |> Enum.reduce(0, fn {_, val}, acc -> acc + val + 1 en...
05ec906e9a5ebe9e95822d11fddaa8ef7b96b41c
1,836
[ 636415386 ]
[ "documented", "ecto" ]
defmodule VirtualGym.Trainers do @moduledoc """ The Trainers context. """ import Ecto.Query, warn: false alias VirtualGym.Repo alias VirtualGym.Trainers.Trainer @doc """ Returns the list of trainers. ## Examples iex> list_trainers() [%Trainer{}, ...] """ def list_trainers do ...
05edb48398807cf0c60e45a63eb25ea58188f743
1,860
[ 923235917 ]
[ "typespec" ]
defmodule BankEventSourcing.Account do alias BankEventSourcing.Events.{AccountCreated, MoneyDeposited, MoneyWithdrawn} @derive {Jason.Encoder, only: [:account_id, :balance, :version]} defstruct [:account_id, :balance, :version] # Command handlers def create_account(account_id, initial_balance) when initial_...
05edd4d1b5eb4b5a481745a10515d8181b540959
4,374
[ 171686197 ]
[]
defmodule Huffman do def sample do 'the quick brown fox jumps over the lazy dog this is a sample text that we will use when we build up a table we will only handle lower case letters and no punctuation symbols the frequency will of course not represent english but it is probably not that far off'...
05ee1eaf5866d6c7e0634334858bdd0927400ddb
3,461
[ 339509357 ]
[ "genserver" ]
defmodule Elm.PidWorker do use GenServer require Logger # Show current data @obd_mode "01" def start_link(obd_pid_name, extra_logging, write_interval \\ 1000) do GenServer.start(__MODULE__, [obd_pid_name, write_interval, extra_logging], name: obd_pid_name) end def init(opts = [obd_pid_name, write_...
05ee3f84f2d86712c46031eb4cd3625abcd27020
2,134
[ 991804814, 916358298, 977779154, 912346615, 971199978, 316823064, 932764196, 994945360, 972624742 ]
[]
defmodule App.Router do use Plug.Router plug(:match) plug(:dispatch) get "/metrics" do metrics = :app |> Peep.get_all_metrics() |> Peep.Prometheus.export() conn |> put_resp_content_type("text/plain") |> send_resp(200, metrics) |> halt() end get "/healthz" do con...
05ee8e1284ab560a5ec384b249d768a05ddb39d0
2,388
[ 493636191 ]
[ "liveview", "documented" ]
defmodule SelphiDaisy.Form.UrlInput.Example06 do @moduledoc """ UrlInput 示例。 演示了如何动态修改 按钮链接的 href """ use Surface.Catalogue.Example, subject: SelphiDaisy.Form.UrlInput, height: "500px", title: "UrlInput 组件 addon ", direction: "vertical" alias SelphiDaisy.Form.SampleModel alias...
05eeaf162c3f927e60fc962ce6d09c2649b43331
3,785
[ 724859626 ]
[ "test" ]
defmodule DryhardTest do use ExUnit.Case, async: true alias Dryhard.{Repo, User} import Dryhard.Factory @user %{username: "Bruce Lee", age: 2023 - 1940, bio: "Bruce Lee - the legend"} @user2 %{username: "Bruce Willis", age: 2023 - 1955, bio: "Dry Hard"} defmodule UserContext do # https://elixirforum....
05ef568bf8ff057869843888e1b078bdbd0be9dc
2,510
[ 436267088 ]
[ "liveview", "documented" ]
defmodule ExshomePlayer.Live.EditLinkModal do @moduledoc """ Modal for editing links. """ alias Phoenix.LiveView.Socket use ExshomeWeb, :live_component @impl LiveComponent def render(assigns) do ~H""" <section id="edit_link_modal" class="h-full flex flex-col justify-center items-center"> <%...
05ef5b1f4498f098d2ff72c5b32db46c2358dfb4
2,522
[ 73890408 ]
[ "typespec", "documented" ]
defmodule Shopify.Fulfillment do @moduledoc """ [https://help.shopify.com/en/api/reference/shipping_and_fulfillment/fulfillment](https://help.shopify.com/en/api/reference/shipping_and_fulfillment/fulfillment) """ @doc """ Cancel a fulfillment. """ @spec cancel(binary, binary) :: Shopify.Operation.t() d...
05efbc473837cce86196d4379b81bad4ee61ec1e
4,042
[ 120816279 ]
[ "typespec", "documented" ]
defmodule AWS.CodeGen.Spec do @moduledoc """ Parse and process the specfication for an AWS service. """ @module_acronyms ~w(SMS WAF API SES HSM FSx IoT MTurk QLDB DB RDS A2I XRay EC2 SSO IVS MQ SDB OIDC ACMPCA SSM) @type t :: %__MODULE__{ protocol: binary(), module_name: binary(), ...
05efeca9fca627cc1b210743d2c9a75b9ae1044b
1,969
[ 435708249 ]
[ "phoenix" ]
defmodule SlashServerWeb.SlashController do use SlashServerWeb, :controller @embed_color 0xFF4C3B defp get_public_key() do Application.get_env(:slash_server, :app_public_key) end defp construct_response(name, desc, resp) do embed = %{ title: desc, description: resp, type: "rich", ...
05f0499191d2d89efc0aadde283f9160cf87d018
3,496
[ 10641158 ]
[ "documented" ]
defmodule Atlas.Adapters.Postgres do @behaviour Atlas.Database.Adapter import Atlas.Query.Builder, only: [list_to_binding_placeholders: 1] import Atlas.Database.FieldNormalizer alias :pgsql, as: PG def connect(config) do case PG.connect( binary_to_list(config.host), binary_to_list(config.user...
05f053f331368cf4b2ede6a5b4975045385c3ed0
1,868
[ 369657185 ]
[ "macro", "documented", "phoenix" ]
defmodule BijouWeb do @moduledoc """ The entrypoint for defining your web interface, such as controllers, views, channels and so on. This can be used in your application as: use BijouWeb, :controller use BijouWeb, :view The definitions below will be executed for every view, controller, etc, s...
05f07841728e744b5b403de3244e88284a54fdb8
7,391
[ 151978561 ]
[ "test" ]
defmodule Phoenixblog.UserControllerTest do use Phoenixblog.ConnCase alias Phoenixblog.User alias Phoenixblog.TestHelper @valid_create_attrs %{email: "<EMAIL>", username: "test", password: "test", password_confirmation: "test"} @valid_attrs %{email: "<EMAIL>", username: "test"} @invalid_attrs %{} setup ...
05f0a0d1c38f9bb9db4c3253b4490afd60cd2463
2,048
[ 434716703 ]
[ "documented" ]
defmodule Aoc.TwentyOne.Day2 do @input File.read!(Path.join(__DIR__, "inputs/day2.txt")) @doc """ ## Examples iex> #{__MODULE__}.part1(~s(forward 5\\ndown 5\\nforward 8\\nup 3\\ndown 8\\nforward 2)) 150 """ def part1(input \\ @input) do parsed_input = parse(input) {horizontal, vertical} =...
05f0da046f2dd73bef2277345bf979263a27a574
2,617
[ 523176488 ]
[ "liveview", "documented" ]
defmodule PanicWeb.UserLive.FormComponent do @moduledoc false use PanicWeb, :live_component @impl true def render(assigns) do ~H""" <div> <.header> {@title} </.header> <.simple_form for={@form} id="user-form" phx-target={@myself} phx-change="va...
05f127488c805f8a8cdacfd3654e56bc646378d3
3,177
[ 417636968 ]
[ "test" ]
defmodule WabanexWeb.SchemaTest do use WabanexWeb.ConnCase, async: true alias Wabanex.User alias Wabanex.Users describe "users queries" do test "when a valid id is given, returns the user", %{conn: conn} do params = %{ name: "Paulo", email: "<EMAIL>", password: "password", ...
05f15e299cf758e50f65467f43a477e4d7d9717c
1,810
[ 293855404 ]
[ "documented", "ecto" ]
defmodule OnlineBookStore.AuthorSchema do @moduledoc """ The AuthorSchema context. """ import Ecto.Query, warn: false alias OnlineBookStore.Repo alias OnlineBookStore.AuthorSchema.Author @doc """ Returns the list of author. ## Examples iex> list_author() [%Author{}, ...] """ def ...
05f1853ce1a3ff430fa762520a60441a00f04502
5,691
[ 822149439 ]
[ "typespec", "documented" ]
defmodule OpenAPIClient.Plugs.RequestTypedEncoder do @moduledoc """ A plug for encoding `:request_body`, `:request_path_params`, `:request_query_params`, `:request_headers` and `:request_cookies` using types provided by the `oapi_generator` library Accepts the following `opts`: * `:typed_encoder` - Module th...