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 |
|---|---|---|---|---|
066101d95dc9c5946713abdeadcbb28c8f44d368 | 1,635 | [
262703303
] | [
"test"
] | defmodule Square.LocationsTest do
use ExUnit.Case
import Square
import Square.Locations
test "list all locations" do
response =
client()
|> list_locations()
assert {:ok, res} = response
assert res.status == 200
end
test "create a location" do
body = %{
location: %{
... |
0661048e2f58c65b9f2f616ff1fed2fc4b5ff248 | 2,772 | [
170688697
] | [
"test"
] | defmodule AddressTest do
use ExUnit.Case, async: true
alias Types.Address
describe "type" do
test "returns map" do
assert Address.Ecto.type == :map
end
end
describe "cast" do
test "when casting from map with symbol keys returns {:ok, %Types.Address}" do
external_data = %{street: "Ko... |
06611b2c926b6a2831ae08e8a8a261ac2336a39b | 1,563 | [
317958501
] | [] | defmodule Day8 do
def acc_value_before_looping(code) do
memory = %{position: 0, acc: 0}
acc_value_before_looping(code, memory, [])
end
def acc_value_before_looping(code, memory, visited) do
pc = memory[:position]
op = Enum.at(code, pc)
cond do
op == nil ->
{:end, memory}
... |
066156658237c615f2300b4417099e792d6e0ac8 | 2,176 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.MyBusinessLodging.V1.Model.Business do
@moduledoc """
Features of the property of specific interest to the business traveler.
## Attributes
* `businessCenter` (*type:* `boolean()`, *default:* `nil`) - Business center. A designated room at the hotel with one or more desks and equipped wit... |
0661d2ce4815449dbe6b13c5d0c445a299d4c812 | 1,888 | [
80228930
] | [] | defmodule MWSClient.Utils do
alias MWSClient.Operation
# `URI.encode_query/1` explicitly does not percent-encode spaces, but Amazon requires `%20`
# instead of `+` in the query, so we essentially have to rewrite `URI.encode_query/1` and
# `URI.pair/1`.
def percent_encode_query(query_map) do
Enum.map_join... |
0661e50ce90a8d1c88c78522155a19129a3d350e | 2,003 | [
191423461
] | [
"documented"
] | defmodule MeadowWeb.Schema.HelperTypes do
@moduledoc """
Absinthe Schema for Random Queries
"""
use Absinthe.Schema.Notation
alias MeadowWeb.Resolvers
alias MeadowWeb.Schema.Middleware
object :helper_queries do
@desc "Get iiif server endpoint"
field :iiif_server_url, :url do
middleware(Mid... |
06622cf3494a2f6102caa89d83837a609dbf48e7 | 1,606 | [
685189133
] | [
"documented"
] | defmodule Breakdown.Game.Core do
defstruct scores: [], status: :playing, answer: "guess"
alias Breakdown.Game.Score
@doc """
Our constructor.
Build a Wordle game core. Track the answer, guesses, and status.
"""
def new(answer \\ "guess") do
%__MODULE__{answer: answer}
end
@doc """
Our reducer... |
06629754eda54653faa9baa91e621289edae05bd | 3,399 | [
646002880
] | [] | defmodule Inngest.MixProject do
use Mix.Project
@version File.read!("VERSION") |> String.trim()
def project do
[
app: :inngest,
version: @version,
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers(),
deps: deps(),
aliases: aliases(... |
0662b257c14acdd103409f541e0d87043b0ee478 | 2,353 | [
727468788
] | [
"liveview",
"ecto"
] | defmodule SynaiProWeb.OrgTeamLive.OrgMembershipFormComponent do
use SynaiProWeb, :live_component
alias SynaiPro.Orgs
@impl true
def render(assigns) do
~H"""
<div>
<.form
id="form-membership"
for={@form}
phx-submit="save"
phx-change="validate"
phx-target={@m... |
0662fdf52356c6d195bb93df3c1a97cee73fc8fd | 1,947 | [
151670279
] | [
"typespec",
"documented"
] | defmodule MAVLink.Types do
@moduledoc """
Core types that remain the same across dialects.
"""
@typedoc "Connection delegate modules for MAVLink.Router"
@type connection :: MAVLink.SerialConnection | MAVLink.TCPConnection | MAVLink.UDPInConnection | MAVLink.UDPOutConnection
@typedoc "A system/compone... |
06634789c11f56c99f76faabf9267f99181bd6a9 | 11,126 | [
163965238
] | [
"documented"
] | defmodule CredoCoreNode.Pool do
@moduledoc """
The Pool context.
"""
alias CredoCoreNode.{Accounts, Blockchain, Network, State}
alias CredoCoreNode.Blockchain.Block
alias CredoCoreNode.Pool.{PendingBlock, PendingBlockFragment, PendingTransaction}
alias CredoCoreNode.State.AccountState
alias CredoCoreNo... |
0663bc56755be511d3f0ea747da2c14fabf44406 | 6,527 | [
585656687
] | [
"liveview"
] | defmodule WebBaitWeb.UsersLive.Users do
use WebBaitWeb, :live_view
alias WebBait.Repo
alias WebBait.Accounts.User
alias WebBait.Accounts
alias WebBaitWeb.UsersLive.UsersNewComponent
alias WebBaitWeb.UsersLive.UsersDeleteComponent
@impl true
def mount(_params, %{"user_token" => token} = _session, socket... |
0663e2ddb903727620ee09d8e414c33fd2a20552 | 1,898 | [
564777585
] | [] | defmodule RabbitMQ.CLI.Queues.Commands.RebalanceCommand do
alias RabbitMQ.CLI.Core.DocGuide
@behaviour RabbitMQ.CLI.CommandBehaviour
use RabbitMQ.CLI.DefaultOutput
@known_types [
"all",
"classic",
"quorum"
]
defp default_opts, do: %{vhost_pattern: ".*",
queue_patter... |
0663e897ae8eca5d190a23ee20074bc88ce55f9d | 3,669 | [
223577736,
16072585
] | [
"test",
"phoenix",
"ecto"
] | defmodule Phoenix.Channel.ChannelTest do
use ExUnit.Case, async: true
@pubsub __MODULE__.PubSub
import Phoenix.Channel
setup_all do
start_supervised! {Phoenix.PubSub, name: @pubsub, pool_size: 1}
:ok
end
test "broadcasts from self" do
Phoenix.PubSub.subscribe(@pubsub, "sometopic")
socket... |
06643df98c45e19090202c48d37d2f8679528e4c | 5,614 | [
135832997
] | [
"liveview"
] | defmodule Data.Article.Blog.BernerStrasse do
use Article.Default
def title(),
do: "Berner Straße / Fasanenweg / Berner Brücke (Bezirksroute Wandsbek W3)"
def summary(),
do:
"Bis auf eine Ausnahme durchgängige Radfahrstreifen. 2,0m Breite im nördlichen Teil, 1,85m im südlichen."
def start(), do:... |
06646247e6036df7404161429aaef0f7f4529ef3 | 2,035 | [
188916173
] | [
"test",
"ecto"
] | defmodule Cockpit.SessionsTest do
use Cockpit.DataCase
alias Cockpit.Sessions
describe "sessions" do
alias Cockpit.Sessions.Session
@valid_attrs %{sid: "some sid"}
@update_attrs %{sid: "some updated sid"}
@invalid_attrs %{sid: nil}
def session_fixture(attrs \\ %{}) do
{:ok, session} ... |
0664811bcc3d23e1df2eefe725d6129a616d3028 | 3,090 | [
901726179
] | [
"liveview"
] | defmodule RaffleyWeb.RaffleLive.Index do
use RaffleyWeb, :live_view
alias Raffley.Raffles
alias Raffley.Charities
import RaffleyWeb.CustomComponents
def mount(_params, _session, socket) do
socket =
assign(socket, :charity_options, Charities.charity_names_and_slugs())
# IO.inspect(socket.assign... |
0664cb9b8406d8856e41b74faf5ec10d09b2b841 | 7,222 | [
492823415
] | [
"genserver"
] | defmodule Oceanconnect.Notifications.EmailNotificationStore do
use GenServer
require Logger
alias OceanconnectWeb.Mailer
alias Oceanconnect.{Notifications, Auctions, Auctions.AuctionEvent}
alias Oceanconnect.Auctions.{Auction, TermAuction}
alias Oceanconnect.Notifications.{
Command,
DelayedNotific... |
06653fa0ff4ddef19438cfcd473608c997b4cce7 | 1,568 | [
160471092
] | [] | defmodule Bugs do
import Bitwise
def load!(filename \\ "input.txt") do
[
b00, b10, b20, b30, b40,
b01, b11, b21, b31, b41,
b02, b12, b22, b32, b42,
b03, b13, b23, b33, b43,
b04, b14, b24, b34, b44,
] = File.stream!(filename)
|> Enum.map(&String.trim/1)
|> Enum.join("")... |
066541b5f0341e8ac04b048b7ac8ca80b49a9b97 | 2,250 | [
498675807
] | [
"test"
] | defmodule Yardi.Gateway.ExportPaymentCase do
use AppCount.Case
alias AppCount.Support.HTTPClient
@moduletag :yardi_gateway_export_payment
@payment_success File.read!(
Path.expand(
"../../resources/Yardi/export_payment_success.xml",
__DIR__
... |
0665545869351efe063d5645b99a06c0e63bd333 | 1,552 | [
198671935
] | [
"macro",
"documented",
"phoenix"
] | defmodule HorizonWeb 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 HorizonWeb, :controller
use HorizonWeb, :view
The definitions below will be executed for every view,
controller, ... |
0665f190ad7480ce87fcbf47fad56546b1e4b890 | 8,020 | [
249215830
] | [
"typespec",
"documented"
] | defmodule MoneyButton do
@moduledoc """
Documentation for `MoneyButton`.
"""
alias MoneyButton.AuthScope
alias MoneyButton.AccessToken
alias MoneyButton.Payment
alias MoneyButton.Identity
alias MoneyButton.Profile
alias MoneyButton.Balance
@url "https://www.moneybutton.com"
@doc """
Authentic... |
066620c5060562e599ea5427624abeef5e421e85 | 1,936 | [
780461734
] | [] | defmodule Lazy do
def get_longest_term(filename) do
File.read!(filename)
|> String.split("\n")
|> Enum.filter(fn line -> line != "" end)
|> Enum.map(fn line -> String.split(line, ":") end)
|> Enum.map(fn [term, _] -> term end)
|> Enum.map(fn term -> {String.length(term), term} end)
|> Enum... |
0666809d4023696bcf032e3d2477aaf271a3b2a8 | 1,784 | [
573503525
] | [
"documented"
] | defmodule Advent2024.Days.Day05 do
@moduledoc """
Solution for Day 05 of Advent of Code 2024.
"""
require Logger
alias Advent2024.Utils
def get_input(type \\ :sample) do
[rules | updates] =
Utils.get_raw_file(Utils.get_input(type, __MODULE__))
|> String.split("\n\n")
rule_map =
... |
066704d6bb79bf26277b77eaa515c33cd3fd3731 | 6,870 | [
151991678
] | [] | %{
"certifi": {:hex, :certifi, "2.0.0", "a0c0e475107135f76b8c1d5bc7efb33cd3815cb3cf3dea7aefdd174dabead064", [:rebar3], [], "hexpm"},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], []},
"cowboy": {:hex, :cowboy, "1.1.2", "61ac29ea970389a88eca5... |
06670ce6f4459a84b00523bb5819c9b327a12a15 | 1,618 | [
718177587
] | [] | # benchmark the time it takes to open connections to a local neo4j server.
# Misc...
#
# What I want:
#
# - I want to measure the time it takes to open a connection and run
# a simple query
# - I want to demonstrate how saving and reusing a connection (where
# applicable) takes less time compared with a similar cod... |
06676e3b6ed8a808d75946b6ed8eadbd37c84d94 | 3,820 | [
367278931
] | [
"documented"
] | defmodule Google.Ads.Googleads.V20.Services.MutateCustomerRequest do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :customer_id, 1, type: :string, json_name: "customerId", deprecated: false
field :operation, 4,
type: Google.Ads.Googleads.V20.Services.CustomerOp... |
0667b5789f9b6a05f5d1c7a059d3d251137c3eb7 | 1,507 | [
186651946
] | [
"ecto"
] | defmodule Logripper.CloudfrontLog do
use Ecto.Schema
schema "cloudfront_log_entries" do
field :timestamp, :naive_datetime # date + time
field :edge_location, :string # x-edge-location
field :bytes, :integer # sc-bytes
field :client_ip, :string # c-ip
field... |
0667bc7bda70db539c43bd744c2cfe5a5ffcd298 | 2,739 | [
434058815
] | [] | defmodule MatrixPath do
def read_matrix(file_path) do
file_path
|> File.read!()
|> String.split("\n", trim: true)
|> Enum.map(&String.split(&1, "", trim: true))
|> Enum.map(&Enum.map(&1, fn x -> String.to_integer(x) end))
end
# Main function to find the shortest path sum from the top-left to ... |
0667c29fa2711392c95891623fab9b59e9551a89 | 3,662 | [
173733519,
491965071
] | [
"liveview",
"test"
] | defmodule SequencerinterfaceWeb.SequencerLiveTest do
use SequencerinterfaceWeb.ConnCase
import Phoenix.LiveViewTest
import Sequencerinterface.SequencersFixtures
@create_attrs %{color: 42, padid: 42, scale: 42, velocity: 42}
@update_attrs %{color: 43, padid: 43, scale: 43, velocity: 43}
@invalid_attrs %{co... |
06688ad8cedd65dffdc2211ba3d2798e75f0ec67 | 1,789 | [
406732766
] | [
"documented",
"ecto"
] | defmodule PersonInfo.Directory do
@moduledoc """
The Directory context.
"""
import Ecto.Query, warn: false
alias PersonInfo.Repo
alias PersonInfo.Directory.Person
@doc """
Returns the list of persons.
## Examples
iex> list_persons()
[%Person{}, ...]
"""
def list_persons do
Re... |
0668ae4eeaa1ad79dd5a00699cf644d158eab8f3 | 2,080 | [
969999971
] | [
"documented"
] | defmodule DeeperHub.Core.Data.Migrations.BxMarketMetaLocations do
@moduledoc """
Migration para criar e remover a tabela bx_market_meta_locations.
"""
alias DeeperHub.Core.Data.Repo
alias DeeperHub.Core.Logger
require DeeperHub.Core.Logger
@doc """
Cria a tabela de bx_market_meta_locations.
"""
de... |
0668e46c21b7168dc423756b6109aeb674362ed0 | 4,491 | [
951138154
] | [
"ecto"
] | defmodule Slax.Chat do
alias Slax.Accounts.User
alias Slax.Chat.{Message, Reply, Room, RoomMembership}
alias Slax.Repo
import Ecto.Changeset
import Ecto.Query
@pubsub Slax.PubSub
def change_room(room, attrs \\ %{}) do
Room.changeset(room, attrs)
end
def get_room!(id) do
Repo.get!(Room, id)... |
066a83f2320de71150431c762bce5cbc81c7ccd6 | 5,697 | [
145740860
] | [
"genserver"
] | defmodule IslandsEngine.Game do
use GenServer, start: {__MODULE__, :start_link, []}, restart: :transient
alias IslandsEngine.{Board, Coordinate, Guesses, Island, Rules}
@players [:player1, :player2]
@timeout 60 * 60 * 24 * 1000
def init(name) do
send(self(), {:set_state, name})
{:ok, fresh_state(name... |
066a95c16c3290aa1bced85364864546eddfd8d7 | 1,683 | [
747148349
] | [
"documented"
] | defmodule Tendermint.Types.ConsensusParams do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
field :block, 1, type: Tendermint.Types.BlockParams
field :evidence, 2, type: Tendermint.Types.EvidenceParams
field :validator, 3, type: Tendermint.Types.ValidatorParams
field :... |
066a96e4df70028b0f5e184fd52cf4c4c5eb7978 | 3,070 | [
670103538,
713860590,
718072585,
710549260,
718071371,
712404127,
711958001,
750475301,
755849138
] | [] | defmodule Phoenix.LiveDashboard.MixProject do
use Mix.Project
@version "0.8.2"
def project do
[
app: :phoenix_live_dashboard,
version: @version,
elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
package: package(),
name: "LiveDashboard",
... |
066abcc75b039949fb1c9541802b868ccceae065 | 3,678 | [
942811655,
920024200
] | [
"test"
] | defmodule Rbac.Workers.RefreshProjectAccessTest do
use Rbac.RepoCase, async: false
alias Rbac.Worker.RefresProjectAccess, as: Worker
alias Support.Factories.RbacRefreshProjectAccessRequest, as: Request
import Ecto.Query, only: [where: 3]
import Mock
@org_id Ecto.UUID.generate()
@user_id Ecto.UUID.genera... |
066b0b6277eb54e67378d91d369493bdb02a647e | 4,539 | [
318945858
] | [] | defmodule Pleroma.Web.ApiSpec.Admin.StatusOperation do
alias OpenApiSpex.Operation
alias OpenApiSpex.Schema
alias Pleroma.Web.ApiSpec.Schemas.Account
alias Pleroma.Web.ApiSpec.Schemas.ApiError
alias Pleroma.Web.ApiSpec.Schemas.FlakeID
alias Pleroma.Web.ApiSpec.Schemas.Status
alias Pleroma.Web.ApiSpec.Sche... |
066b832d5c554420c39ad4cc08fb717bf6243562 | 6,247 | [
155316657
] | [
"typespec",
"documented"
] | defmodule DiscordBot.Gateway.Connection do
@moduledoc """
Represents a single websocket connection to Discord.
"""
use DiscordBot.GunServer
require Logger
alias DiscordBot.Broker
alias DiscordBot.Model.{
Activity,
Dispatch,
GatewayVoiceStateUpdate,
Payload,
StatusUpdate
}
@gate... |
066bce54e7dd4371602183f30bbea148ef2fdc04 | 5,045 | [
225483206
] | [] | defmodule Advent2020.Day19 do
import Helpers.Shared, only: [log: 1]
def part1(input) do
log("Running 2020-19-P1-InputList")
# [rule_strings, message_list] = input
# messages = String.split(message_list, "\n")
# rules_map = parse_rule_strings(rule_strings)
# rule_regex = compile_rule... |
066c1b5637314519f5dc617e43aa300ac624fe1a | 1,517 | [
73872238
] | [] | use Mix.Releases.Config,
# This sets the default release built by `mix release`
default_release: :default,
# This sets the default environment used by `mix release`
default_environment: :dev
# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/co... |
066c80ae3977868ff0e0b5e15846d89bd798b7e2 | 1,744 | [
824109793
] | [
"test",
"phoenix"
] | defmodule EpisodicalWeb.ConfigControllerTest do
use EpisodicalWeb.ConnCase
import Episodical.ModelFixtures
describe "index" do
test "lists all available config entries", %{conn: conn} do
conn = get(conn, ~p"/config")
assert html_response(conn, 200) =~ "Configuration Options"
end
end
des... |
066ca889f5f6a301e1a0c53ab66077065e4068db | 1,868 | [
386875010
] | [
"macro",
"documented",
"phoenix"
] | defmodule NudgeWeb 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 NudgeWeb, :controller
use NudgeWeb, :view
The definitions below will be executed for every view,
controller, etc, s... |
066d3453d7a3f5de158292e9dab8d260ee73885e | 2,015 | [
475667936
] | [] | # This file is responsible for configuring your application
# and its dependencies with the aid of the Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
# General application configuration
import Config
config :mushaf,
ecto_repos: [Mushaf.Repo]
# Config... |
066d3a880dce1db7e04b5c49245d0a52018c24c2 | 4,818 | [
76212653
] | [] | defmodule T1058.Router do
alias Ueberauth.Strategy.CAS
use Trot.Router
require Logger
@session Plug.Session.init(
store: :cookie,
key: "_app",
encryption_salt: "09821psdfsdfosdfjspis0okm",
signing_salt: "09821posasyuiyuI11jspisdas"
)
get "/" do
conn = conn
|> Map.put(:... |
066d6f2c3718e2f66e94803246c0a60002497194 | 3,274 | [
697848022
] | [
"test",
"phoenix"
] | defmodule AuditorActivityWeb.ChecklistControllerTest do
use AuditorActivityWeb.ConnCase
alias AuditorActivity.Generic
alias AuditorActivity.Generic.Checklist
@create_attrs %{
description: "some description",
name: "some name",
status: "some status",
time_to_finish: "2010-04-17T14:00:00Z"
}
... |
066d8c618311005a9aa7c7072accf8c252e2677d | 2,725 | [
180023877
] | [
"typespec",
"documented",
"ecto"
] | defmodule Leprechaun.HiScore do
@moduledoc """
Stores the HighScore for the user and all of the information about its game.
"""
use Ecto.Schema
import Ecto.Query, only: [from: 2]
import Ecto.Changeset
alias Leprechaun.{Game, HiScore, Repo}
@top_num 99
@typedoc """
The position a player achieved ... |
066f8409ab24514e57105d7a9b35adcfd3bfdaae | 2,868 | [
822149439
] | [
"typespec",
"documented"
] | defmodule OpenAPIClient.Plugs.FunctionCallDecoder do
@moduledoc """
A plug for decoding the function call.
"""
@behaviour Plug
@impl Plug
@spec init(opts :: Plug.opts()) :: Plug.opts()
def init(opts), do: opts
@impl Plug
@spec call(Plug.Conn.t(), Plug.opts()) :: Plug.Conn.t()
def call(conn, _opts... |
066f916665d509e0f3dbdbd46d68ed5a788a5ae9 | 9,809 | [
256005654
] | [
"typespec",
"macro",
"documented"
] | defmodule Carol.Episode do
@moduledoc "Carol Episode Utilities"
defstruct id: "", execute: [], event: "", at: :none, shift: [], valid: :unchecked, defaults: []
@type t :: %__MODULE__{
id: String.t(),
execute: :on | :off | list(),
event: String.t(),
shift: Timex.shift_opti... |
0670ab7b6afe82448cbf2dd01ad25a311ba672f8 | 2,011 | [
383340007
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Compute.V1.Model.HttpQueryParameterMatch do
@moduledoc """
HttpRouteRuleMatch criteria for a request's query parameter.
## Attributes
* `exactMatch` (*type:* `String.t`, *default:* `nil`) - The queryParameterMatch matches if the value of the parameter exactly matches the contents of exac... |
0670aea9cea6d6df17d107ef2faaff3698f44af9 | 1,592 | [
869664514
] | [
"macro",
"documented",
"phoenix"
] | defmodule BackendProjectWeb do
@moduledoc """
The entrypoint for defining your web interface, such
as controllers, components, channels, and so on.
This can be used in your application as:
use BackendProjectWeb, :controller
use BackendProjectWeb, :html
The definitions below will be executed for... |
0670b1b1b9ff44f35e982a8196814be7543319b1 | 5,421 | [
514235141
] | [] | alias Acl.Accessibility.Always, as: AlwaysAccessible
alias Acl.GraphSpec.Constraint.Resource, as: ResourceConstraint
alias Acl.GraphSpec.Constraint.ResourceFormat, as: ResourceFormatConstraint
alias Acl.Accessibility.ByQuery, as: AccessByQuery
alias Acl.GraphSpec, as: GraphSpec
alias Acl.GroupSpec, as: GroupSpec
alias ... |
06711f3cabcc483584834108d2ee3029bee4369c | 2,321 | [
264321031
] | [
"genserver",
"liveview"
] | defmodule UtilityWeb.SinkLive do
use UtilityWeb, :live_view
alias UtilityWeb.HTTPSink
alias Phoenix.LiveView.JS
@impl Phoenix.LiveView
def mount(_params, _session, socket) do
{:ok,
socket
|> assign(:page_title, "HTTP Sink")
|> assign(:id, nil)
|> assign(:requests, []), temporary_assig... |
06716a9a11b16bdbe2453c96b10bb2e643e04b23 | 2,546 | [
603534770
] | [
"test"
] | defmodule Kompost.Kompo.Postgres.Controller.DatabaseControllerE2eTest do
use ExUnit.Case, async: true
alias Kompost.Test.GlobalResourceHelper
alias Kompost.Test.Kompo.Postgres.ResourceHelper
@namespace "postgres-database-controller-e2e"
setup_all do
timeout =
"TEST_WAIT_TIMEOUT"
|> System.g... |
0671cf1966b21bc5c6b6e2aeac08d9a1357e1fee | 7,092 | [
756340681
] | [
"liveview",
"ecto"
] | defmodule DAUWeb.SearchLive.Detail do
alias DAU.UserMessage.Analytics
alias DAU.UserMessage.Analytics.Event
alias DAU.MediaMatch.Blake2B
alias DAU.UserMessage
alias DAU.UserMessage.Templates.Factory
alias DAU.UserMessage.Templates.Template
alias DAU.Feed.AssessmentReport
alias DAU.Feed.Common
alias DA... |
0672192764db81cd76ce7d4743a5b473777cece6 | 1,648 | [
958231508
] | [
"ecto"
] | defmodule Elixir.Conduit.QAD.Table.Abscc_det do
use Ecto.Schema
import Ecto.Changeset
schema "qad_abscc_det" do
field :abscc_abs_id, :string
field :abscc_abs_shipfrom, :string
field :abscc_order, :string
field :abscc_ord_line, :integer
field :abscc_container, :string
field :abscc_qty... |
06727c474f12cf2b0bf450ba2832f14e68991344 | 5,162 | [
832666883,
917091028
] | [
"typespec",
"test",
"documented"
] | defmodule ElixirAvro.E2ETest do
use ExUnit.Case
defmodule AvroraClient do
use Avrora.Client,
schemas_path: Path.join(__DIR__, "e2e/avro_schemas")
end
setup_all do
{:ok, _pid} = AvroraClient.start_link()
schemas_path = Path.join(__DIR__, "e2e/avro_schemas")
target_path = Path.join(__DIR_... |
0672b5239a6d3aafe421b50b01f10596f26951a8 | 3,602 | [
728266936
] | [
"typespec"
] | defmodule Grid do
defstruct xmax: 0, ymax: 0, map: %{}, beams: %{}
def new(), do: %__MODULE__{}
def energized(grid) do
grid.beams |> map_size()
end
def render(grid) do
for y <- 0..grid.ymax do
for x <- 0..grid.xmax do
case Map.get(grid.beams, {x, y}) do
nil -> "."
... |
06738c17b34cac28990662169a3a82aecc032058 | 3,627 | [
716909461
] | [
"phoenix",
"documented"
] | defmodule FirestarterWeb.TaskController do
use FirestarterWeb, :controller
alias Firestarter.Tasks
alias Firestarter.Tasks.Task
action_fallback FirestarterWeb.FallbackController
@doc """
Lists all tasks.
## Parameters
- conn: The connection struct
- _params: A map of parameters (unused in thi... |
0673d53d454356658773867f40211b7174e50d0d | 1,973 | [
810146441
] | [
"documented"
] | defmodule ChinaAdminDivisions.Gen.Lv4xg.M6325 do
@moduledoc false
def name("632525203000"), do: "塔秀乡"
def name("632525202000"), do: "茫拉乡"
def name("632525200000"), do: "沙沟乡"
def name("632525102000"), do: "森多镇"
def name("632525101000"), do: "过马营镇"
def name("632525100000"), do: "茫曲镇"
def name("6325242030... |
067442ab5dff4794c9da45003c82cee7dd7e2a5f | 1,638 | [
965650791
] | [
"ecto"
] | defmodule Example.Repo.Migrations.Customers do
use Ecto.Migration
def change do
create table(:customer) do
add :first_name, :string
add :last_name, :string
add :email, :string
add :birthday_day, :integer
add :birthday_month, :integer
add :brand_code, :string
add :marke... |
06744f24fdf3570928b05e3fc7b5eb6837910e1c | 2,352 | [
437002084
] | [
"documented"
] | defmodule FleatureWeb.Components do
@moduledoc """
Including some styles that should always be available
p-0 p-px p-0.5 p-1 p-1.5 p-2 p-2.5 p-3 p-3.5 p-4 p-5 p-6 p-7 p-8 p-9 p-10 p-11 p-12 p-14 p-16 p-20 p-24 p-28 p-32 p-36 p-40 p-44 p-48 p-52 p-56 p-60 p-64 p-72 p-80 p-96
w-0 w-px w-0.5 w-1 w-1.5 w-2 w-2.5 w-3... |
0674c09f00234f13a40fa3cbf808ea335a273c03 | 4,629 | [
498829059
] | [
"test",
"phoenix"
] | defmodule ZoutWeb.ProjectControllerTest do
use ZoutWeb.ConnCase
describe "index" do
test "lists all undeleted projects", %{conn: conn} do
project1 = insert(:project)
project2 = insert(:project)
project3 = insert(:project, deleted: true)
conn = get(conn, ~p"/projects")
assert html_... |
0674c2a9b31010ae64ce9d894ab618affea2b5c2 | 3,471 | [
673538680
] | [
"liveview",
"test"
] | defmodule AusbildungsnachweisdigitalWeb.ReportLiveTest do
use AusbildungsnachweisdigitalWeb.ConnCase
import Phoenix.LiveViewTest
import Ausbildungsnachweisdigital.ReportsFixtures
@create_attrs %{activity: "some activity", duration: 42}
@update_attrs %{activity: "some updated activity", duration: 43}
@inva... |
0674ff4a81591d71bf13bb51cd50c94234b21d62 | 3,457 | [
84204626
] | [
"test"
] | defmodule AfterGlow.QuestionControllerTest do
use AfterGlow.ConnCase
alias AfterGlow.Question
alias AfterGlow.Repo
@valid_attrs %{human_sql: %{}, last_updated: %{day: 17, hour: 14, min: 0, month: 4, sec: 0, year: 2010}, sql: "some content", title: "some content", update_interval: 42}
@invalid_attrs %{}
s... |
06760c947c69871d4157401de99ab826096234e0 | 1,987 | [
121685196
] | [
"supervisor"
] | defmodule ModernWeb do
use Application
# See http://elixir-lang.org/docs/stable/elixir/Application.html
# for more information on OTP Applications
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
# Start the endpoint when the application starts
supervisor(ModernW... |
067610433a2ba5faf7e8c186b0da72ca1db5419e | 4,085 | [
204690854
] | [
"test",
"phoenix"
] | defmodule Reaper.DataSlurper.HttpTest do
use ExUnit.Case
use Placebo
alias Reaper.DataSlurper
@dataset_id "12345-23729"
describe "slurp" do
setup do
bypass = Bypass.open()
filename = @dataset_id
on_exit(fn ->
if File.exists?(filename) do
File.rm(filename)
end... |
067650d74a9e0e606803dc8c72d88b508fd28fe2 | 1,792 | [
312215746
] | [
"liveview",
"test"
] | defmodule BifrostWeb.PageLiveTest do
use BifrostWeb.ConnCase
import Phoenix.LiveViewTest
setup %{auth_conn: conn} do
description = "Some Description"
inserted_aesir = %Asguard.Aesir{
description: description,
encrypted: "encrypted",
encryption_algo: :plaintext,
uuid: "cdfdaf44-e... |
067665386f17a43df628c8fff30a85de81097cba | 2,839 | [
398242673
] | [] | %{
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
"db_connection": {:hex, :db_connection, "2.4.0", "d04b1b73795dae60cead94189f1b8a51cc9e1f911c234cc23074017c43c031... |
0676882cb5085d2c738eb01f29310bc0ff6fad08 | 3,335 | [
317445960
] | [] | defmodule Day16 do
def part1 do
{rules, _my_ticket, nearby_tickets} = parse("input/day16.txt")
invalid_tickets_error_rate(nearby_tickets, rules)
end
@fields_count 20
def part2 do
{rules, my_ticket, nearby_tickets} = parse("input/day16.txt")
valid_tickets = Enum.filter(nearby_tickets, fn ticket ... |
06770cc0d7cd3aa1283fbe105909165352e85099 | 1,815 | [
744281225,
116826798,
313251367
] | [
"test"
] | defmodule EWallet.Bouncer.AccountTargetTest do
use EWallet.DBCase, async: true
import EWalletDB.Factory
alias EWallet.Bouncer.{AccountTarget, DispatchConfig}
alias EWalletDB.{Account, AccountUser, Membership}
alias ActivityLogger.System
alias Utils.Helpers.UUID
describe "get_owner_uuids/1" do
test "r... |
06774049ee49abad7368cb8aa10e9ddfb8879624 | 2,898 | [
621937661
] | [
"documented"
] | # Since functions of optional dependencies can't be found by dialyzer, it can't
# find the SPARQL.Client functions. We're ignoring these warnings (via .dialyzer_ignore).
# See https://elixirforum.com/t/confusing-behavior-of-optional-deps-in-mix-exs/17719/4
if Code.ensure_loaded?(SPARQL.Client) do
defmodule RTC.SPARQ... |
0677d4651b1026d73fef5862f18a19abffdd76b6 | 4,394 | [
797331361
] | [
"genserver",
"documented",
"phoenix"
] | defmodule NervesHub.Deployments.Orchestrator do
@moduledoc """
Orchestration process to handle passing out updates to devices
When a deployment is updated, the orchestraor will tell every
device local to its node that there is a new update. This will
hook will allow the orchestrator to start slowly handing o... |
0677fdb6975396848340ef15fcf1e453820ae403 | 2,273 | [
434367551
] | [] | defmodule Grid do
def from_2d_list(list) do
Enum.map(list, fn row ->
Enum.map(row, fn grid_number ->
{false, grid_number}
end)
end)
end
def mark(grid, number) do
Enum.map(grid, fn row ->
Enum.map(row, fn
{true, _n} = cell -> cell
{false, ^number} -> {true, nu... |
06786bcbaffe5ffa91f88c6b0c1cd367f840b9e2 | 2,050 | [
104723706
] | [
"phoenix",
"documented"
] | defmodule MasteryBackendWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :mastery_backend
socket "/socket", MasteryBackendWeb.UserSocket
def known_route(conn) do
List.first(conn.path_info) in ["api", "css", "js"]
end
def path_info(destination) do
destination
|> String.split("/")
|> Enum.drop(... |
06787143ede90965e3566fa16418e691ca3ea91b | 3,459 | [
193992072
] | [] | use Mix.Config
# For production, don't forget to configure the url host
# to something meaningful, Phoenix uses this information
# when generating URLs.
#
# Note we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the `mix phx.digest` task,
# ... |
0678c4af5f054cd4269c3cd6952e64d10974c9e2 | 2,255 | [
747049088
] | [
"macro",
"test",
"documented",
"phoenix"
] | defmodule AssociationElixirWeb.ConnCase do
@moduledoc """
This module defines the test case to be used by
tests that require setting up a connection.
Such tests rely on `Phoenix.ConnTest` and also
import other functionality to make it easier
to build common data structures and query the data layer.
Fina... |
06792a5def71c44fd1863fa63e08ddb5f16ead91 | 2,318 | [
999541765
] | [
"genserver"
] | defmodule ScamSnare.Queues.ConnectionManager do
use GenServer
alias AMQP.{Basic, Connection, Channel, Exchange, Queue}
@connection Application.compile_env!(:scam_snare, ScamSnare.Queues)[:connection]
@queue Application.compile_env!(:scam_snare, ScamSnare.Queues)[:queue]
@exchange Application.compile_env!(:sc... |
06794c59c62e161f5c5584ce1c3032197d189de2 | 1,935 | [
739262096,
223255738,
1234714,
742840268,
139261729
] | [
"documented"
] | defmodule Mix.Tasks.Clean do
use Mix.Task
@shortdoc "Deletes generated application files"
@recursive true
@moduledoc """
Deletes generated application files.
This command deletes all build artifacts for the current project.
Dependencies' sources and build files are cleaned only if the
`--deps` option... |
067957d5c894e9d7a5455ef9bf5cdb5b9c180e86 | 2,510 | [
708209739
] | [
"typespec",
"supervisor",
"documented"
] | defmodule Nostrum.Cache.ChannelCache.ETS do
@moduledoc """
An ETS-based cache for channels outside of guilds.
The supervisor defined by this module will set up the ETS table associated
with it.
If you need to get the table reference for the table used by this module,
please use the `table/0` function.
... |
06795d8f546d8a06ec6230adf4c1860e5a376cfc | 1,551 | [
714807717
] | [
"liveview",
"phoenix"
] | defmodule MtgFriendsWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :mtg_friends
# The session will be stored in the cookie and signed,
# this means its contents can be read but not tampered with.
# Set :encryption_salt if you would also like to encrypt it.
@session_options [
store: :cookie,
key: "_mt... |
067a83e7817387868c29eed78b051eaa25ffce09 | 8,455 | [
120443725
] | [
"ecto"
] | defmodule Changelog.Episode do
use Changelog.Data, default_sort: :published_at
alias Changelog.{EpisodeHost, EpisodeGuest, EpisodeTopic, EpisodeStat,
EpisodeSponsor, Files, Podcast, Regexp, Transcripts}
alias ChangelogWeb.{EpisodeView, TimeView}
schema "episodes" do
field :slug, :string... |
067ac7a61c9fdcca3b0c61554186c2535a051c6a | 6,426 | [
231970041
] | [
"documented",
"ecto"
] | defmodule Ogahunt.Accounts do
@moduledoc """
Main accounts module used to interact with user's info
"""
import Ecto.Query
alias __MODULE__
alias Ogahunt.Repo
alias Ogahunt.Accounts.User
alias Ogahunt.Accounts.Role
alias Ogahunt.Accounts.Team
alias Ogahunt.Accounts.TeamUser
alias Ogahunt.Accounts... |
067b43ad3bd8fab36ea64e9c096241f82cfe5f51 | 4,791 | [
301707295
] | [
"phoenix",
"ecto"
] | defmodule ProjectR0719212Web.ProfileController do
use ProjectR0719212Web, :controller
alias ProjectR0719212.ApiKeyContext
alias ProjectR0719212.ApiKeyContext.ApiKey
alias ProjectR0719212.UserContext
alias ProjectR0719212.UserContext.User
alias ProjectR0719212Web.Guardian
de... |
067b8d050746fbc2581d414e1abdfce40ee96b64 | 5,323 | [
166341541
] | [
"typespec",
"phoenix"
] | defmodule LynxListWeb.Auth do
import Plug.Conn
alias LynxList.Accounts
alias LynxListWeb.Auth.AuthProvider
@host Application.get_env(:lynx_list, LynxListWeb.Endpoint)
|> Keyword.fetch!(:url)
|> Keyword.fetch!(:host)
@cookie_domain ".#{@host}"
@payload_key "token_payload"
@payload_option... |
067bd0894d4dd4a52e232775409c29d1b53fe4fe | 3,047 | [
241193872
] | [
"phoenix"
] | defmodule MusicManagerWeb.SpotifySessionController do
use MusicManagerWeb, :controller
alias MusicManager.Spotify
import MusicManagerWeb.Plugs.Auth, only: [authenticate_user: 2]
plug :authenticate_user
def new(conn, _) do
render(conn, "new.html")
end
def create(conn, _) do
random_string = Ecto.... |
067c4b6a58f0e729d9b9f2b0d0286ddf71e6f539 | 10,018 | [
114300753
] | [] | %{"argon2_elixir": {:hex, :argon2_elixir, "1.2.14", "0fc4bfbc1b7e459954987d3d2f3836befd72d63f3a355e3978f5005dd6e80816", [], [{:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"},
"aws": {:hex, :aws, "0.5.0", "e3916abd9d1fb4c182cbeac8a964ddeb32de9b20d441b66fba838ade06a4a278", [:mix]... |
067c8963421ed734141b3d6a678df8a12852f575 | 2,974 | [
510932877
] | [
"test",
"phoenix"
] | defmodule ConsumeWeb.FeedControllerTest do
use ConsumeWeb.ConnCase
import Consume.FetcherFixtures
@create_attrs %{
fetch_after: ~U[2022-09-11 21:50:00Z],
fetch_interval_seconds: 42,
fetcher: :rss2_0,
name: "some name",
uri: "https://nope.nope",
enabled: false
}
@update_attrs %{
f... |
067cd4aa95d5fadac39bd353e46895b1a11497a5 | 1,559 | [
464087120
] | [
"documented"
] | defmodule DigiCoin.Postback do
@moduledoc """
Postback messages handler when user send reply via buttons
"""
alias DigiCoin.Clients.CoinGecko
alias DigiCoin.Template
def handle_postback(%{"payload" => "coin_search_by_id"}, event) do
results = CoinGecko.search("bitcoin")
coins = process_coins(res... |
067cd5305f3bdd4fa77473fa72e8370e91d23734 | 2,908 | [
113959161
] | [] | %{"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"},
"certifi": {:hex, :certifi, "2.0.0", "a0c0e475107135f76b8c1d5bc7efb33cd3815cb3cf3dea7aefdd174dabead064", [:rebar3], [], "hexpm"},
"credo": {:hex, :credo, "0.8.10", "261862bb7363247762e1063713bb... |
067cdef2c62fc1cbfad13252704fa13ea06e93d2 | 4,391 | [
664716838
] | [
"typespec",
"documented"
] | defmodule SnappyEx do
@moduledoc """
Encoder/decoder implementation for the [Snappy framing format](https://github.com/google/snappy/blob/main/framing_format.txt)
"""
import Bitwise
@bit_mask_32 2 ** 32 - 1
@chunk_size_limit 65_540
@stream_identifier "sNaPpY"
@id_compressed_data 0x00
@id_uncompre... |
067cea23db2ef5f43ec6f653d9ea04492eaf1755 | 4,622 | [
421395134
] | [
"typespec",
"macro",
"documented"
] | defmodule SgfParsing do
# Used to make recursive parsers lazy
defmacro lazy(parser) do
quote do
fn string -> unquote(parser).(string) end
end
end
defmodule Sgf do
defstruct properties: %{}, children: []
end
@type sgf :: %Sgf{properties: map, children: [sgf]}
@doc """
Parse a string i... |
067d4286a5e40d4820bf3c724774f369dee70558 | 1,738 | [
486308176
] | [
"phoenix"
] | defmodule HomeAutomationWeb.Router do
use HomeAutomationWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, {HomeAutomationWeb.LayoutView, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
end
pipe... |
067d520e3108c9cb07d0384055e78267c01477ae | 2,076 | [
190037085
] | [
"typespec",
"documented"
] | defmodule SignalWire do
@moduledoc """
Interacts with the SignalWire API to send SMS messages.
"""
require Logger
@spec send_message(recipients :: String.t() | list(String.t()), message :: String.t()) ::
{:ok, HTTPoison.Response.t() | HTTPoison.AsyncResponse.t()}
| {:error, HTTPoison.Erro... |
067e0aef9b08fc651719824bd69ef9cb9b2ce85b | 3,243 | [
194711397
] | [] | use Mix.Config
# Repository specific configuration
system = :nerves_system_rpi3
platform = "rpi3"
arch = "arm"
app_part_devparth = "/dev/mmcblk0p3"
network_interface = System.get_env("NERVES_NETWORK_INTERFACE") || "eth0"
# Environment specific configuration
# Nerves Project test farm configuration
# NERVES_TEST_S... |
067ee19725d870e5639269a838374a0e75d0e97d | 4,941 | [
398198092
] | [
"test",
"phoenix",
"ecto"
] | defmodule CodewarWeb.Admin.SessionControllerTest do
use CodewarWeb.ConnCase, async: true
alias Codewar.Competition.Competitions
describe "new/2" do
test "renders form", %{conn: conn} do
conn = get(conn, Routes.session_path(conn, :new))
assert html_response(conn, 200) =~ "New Session"
end
... |
067f0b62d3cd4ee64627d9d95ef15ca7b19159a5 | 1,800 | [
367278931
] | [
"documented"
] | defmodule Google.Cloud.Aiplatform.V1.PostStartupScriptConfig.PostStartupScriptBehavior do
@moduledoc false
use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED, 0
field :RUN_ONCE, 1
field :RUN_EVERY_START, 2
field :DOWNLOAD_AND_RUN_... |
067fb2bcf216d104c8de95f5a269899e6a2fed7a | 3,066 | [
726345435
] | [] | defmodule AdventOfCode.Day16.P2 do
def parse(input) do
input
|> String.split("\n", trim: true)
|> Enum.map(&String.split(&1, "", trim: true))
end
def traverse(map, _, energized \\ %{})
def traverse(_, nil, energized), do: energized
def traverse(map, {x, y, direction}, energized) do
key = get... |
068055014d23673a4bb5e1bb5371d3022dacc3f1 | 3,633 | [
739854834
] | [
"liveview"
] | defmodule PainWeb.Components.Schedule do
use Surface.LiveComponent
import Pain.Schedule
prop service_keys, :list, default: []
prop employee_keys, :list, default: []
prop schedule, :event, required: true
data possible, :map, default: %{}
data day, :string
data block, :string, default: nil
data proces... |
06805e40c547ac783577c75b2a2d89511160fb8d | 19,031 | [
298874067
] | [] | %{
"artificery": {:hex, :artificery, "0.4.3", "0bc4260f988dcb9dda4b23f9fc3c6c8b99a6220a331534fdf5bf2fd0d4333b02", [:mix], [], "hexpm", "12e95333a30e20884e937abdbefa3e7f5e05609c2ba8cf37b33f000b9ffc0504"},
"assent": {:hex, :assent, "0.1.28", "bd98e61a44d5e5a64c435299b02f9b3f890521930b9428f9c60461d8d3d04148", [:mix], ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.