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 |
|---|---|---|---|---|
0c1cb475cc88882ad35d38d4e0b54df70bd5400b | 2,125 | [
562704411
] | [] | # 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:
#
# DemoApp.Repo.insert!(%DemoApp.SomeSchema{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will... |
0c1d36609527f12cb6603c76732fd50a2b8e37a8 | 1,913 | [
98185781
] | [
"ecto"
] | defmodule Codebattle.Repo.Migrations.AddMoreBots3 do
use Ecto.Migration
def change do
names = ~w(
AdaAlgorithm
AgentSmith
AlanTuring
AnakinCodeWalker
AndreyThunder
ArchimedesAI
Architron
AristotleAlgol
BernersLeeBasic
BernoulliBrain
BludniySyn
C3POCode
CharlesDarwin
ChewbaccaCoder
ClaudeShannon
CloneTrooper
Co... |
0c1d45cfc538c74f37ae7d9cee8d8b21f8c50858 | 2,767 | [
478727122
] | [
"supervisor",
"documented"
] | defmodule Nexus.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
alias InfluxEx.Client
@impl true
def start(_type, _args) do
# Before starting anything lets make sure we are able to talk to
# to the Influ... |
0c1dcd87c75256a17ca791d73557a1daaf2efb0b | 6,831 | [
506695065
] | [
"phoenix"
] | defmodule PawpubblecloneWeb.Router do
use PawpubblecloneWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, {PawpubblecloneWeb.LayoutView, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
plug Pawp... |
0c1e2e54efbc4253eaf1cf0e880292c5c733ade1 | 9,167 | [
488000438
] | [] | %{
"blitz_credo_checks": {:hex, :blitz_credo_checks, "0.1.8", "6f4e27d1db5d0fffd6e47fa36c972fa5efca411b5bb9fc84c65b59adca39dd83", [:mix], [{:credo, "~> 1.4", [hex: :credo, repo: "hexpm", optional: false]}], "hexpm", "34d4b29a8a5a83ae1d759b0819635f55160f628a9c7a77c5be9507e29360ab3b"},
"bunt": {:hex, :bunt, "0.2.1", ... |
0c1e4b00a0f3c4dc6f06c2cd15c0eac744188906 | 15,270 | [
109451499
] | [
"genserver"
] | defmodule Server do
use GenServer
#The GenServer is started using this function
def start_link(nodeMap, actorHopsMap, numDigits) do
GenServer.start_link(__MODULE__, [nodeMap, actorHopsMap, numDigits], name: :genMain )
end
def handle_cast({:updateNodeMap,key,value},[nodeMap, actorHopsMap, numDigits]) ... |
0c1e8e10bee0beec0ccc3b3e2622968ba3cf5d9a | 3,767 | [
226519687
] | [
"genserver"
] | defmodule Cloner.CoindataRetriever do
use GenServer, restart: :transient
# https://poloniex.com/public?command=returnTradeHistory¤cyPair=USDC_TRX&start=1575113140&end=1575717950
@url_prefix 'https://poloniex.com/public?command=returnTradeHistory¤cyPair='
def start_link(args = {coinpair, _total_tim... |
0c1e94b79248aa1c2a6ad3c7a4f969b0379ac8f8 | 1,509 | [
433727283
] | [] | defmodule Aoc2021.Day13 do
def part1(input) do
{dots, [first_fold | _]} = parse(input)
dots
|> fold(first_fold)
|> length()
end
def part2(input) do
{dots, folds} = parse(input)
folds
|> Enum.reduce(dots, &fold(&2, &1))
|> print()
end
defp fold(dots, {axis, value} = _fold_li... |
0c1eb63b343db9d3b53aa74cfe8203c6eb3afd0a | 6,967 | [
161703639,
183601498,
159884345
] | [
"typespec",
"documented"
] | defmodule Pigeon.APNS.JWTConfig do
@moduledoc """
Configuration for APNS Workers using JWT.
"""
defstruct name: nil,
reconnect: true,
uri: nil,
port: 443,
ping_period: 600_000,
key: nil,
keyfile: nil,
key_identifier: nil,
... |
0c1f80dc44b6c8418a6ecd27b6084cdb90a10f1a | 2,356 | [
669349996
] | [
"test"
] | defmodule VampWeb.Projects.LatencyChannelTest do
use VampWeb.ChannelCase, async: true
describe "join" do
test "join succeeds when the user and song match the channel" do
user = Vamp.AccountsFixtures.user_fixture()
song = Vamp.ProjectsFixtures.song_fixture(%{created_by_id: user.id})
assert {:... |
0c1f8fd48f6c93c64d262f2237c22bea45774eb8 | 2,020 | [
129441349
] | [
"documented"
] | defmodule Fib do
def fib(scheduler) do
IO.puts "started fib task #{inspect self()}"
send scheduler, { :ready, self() }
receive do
{ :fib, n, client } ->
IO.puts "receive #{n} from #{inspect client}"
send client, { :anser, n, fib_calc(n), self() }
IO.puts "send-><#{inspect ... |
0c201028d88087e9d1279a0f1ce82895d8156934 | 7,335 | [
274214639
] | [
"typespec",
"test",
"documented"
] | defmodule TypeCheck.Credo.Checks.Readability.SpecsTest do
use Credo.Test.Case
@described_check TypeCheck.Credo.Check.Readability.Specs
describe "normal @spec attributes" do
test "it should NOT report functions with specs" do
"""
defmodule CredoTypespecTest do
@spec foo(integer, integer) ... |
0c205eb7326b3631ed57a5ffc528f20c63929e88 | 11,525 | [
358515542
] | [] | %{
"bcrypt_elixir": {:hex, :bcrypt_elixir, "2.3.0", "6cb662d5c1b0a8858801cf20997bd006e7016aa8c52959c9ef80e0f34fb60b7a", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"},
"bunt": {:hex, :b... |
0c20730def9f431d0ff1055b32726297166f8e31 | 1,994 | [
138673568
] | [] | %{
"amqp": {:hex, :amqp, "1.1.1", "e902a8e112c9c476995440c4beac867f054dc531de208adc01aa411dd07754a2", [:mix], [{:amqp_client, "~> 3.7.11", [hex: :amqp_client, repo: "hexpm", optional: false]}, {:goldrush, "~> 0.1.0", [hex: :goldrush, repo: "hexpm", optional: false]}, {:jsx, "~> 2.9", [hex: :jsx, repo: "hexpm", option... |
0c21dbc7d864b927351617576e5a2b61105cb6d4 | 1,829 | [
920597054
] | [] | # 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 :react_demo,
generators: [timestamp_type: :u... |
0c2225103200b1931f4ac9f41fe1287a01eaa662 | 2,353 | [
727323029
] | [
"documented"
] | defmodule MM23.Day4 do
@doc """
Part 1
## Examples
iex> MM23.Day4.part1()
26346
"""
def part1 do
# """
# Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53
# Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
# Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1
# Card 4: 41 92 73 ... |
0c225dea7a463b3432be1ee7baf69a2683ad1b4f | 3,004 | [
423345662
] | [
"documented"
] | defmodule EventStore.Storage do
@moduledoc false
alias EventStore.Storage.{
Appender,
CreateStream,
DeleteStream,
QueryStreamInfo,
Reader,
Snapshot,
Subscription
}
@doc """
Create a new event stream with the given unique identifier.
"""
defdelegate create_stream(conn, stream_... |
0c22780dc418fcd14858ab607e86bd40da723c20 | 5,100 | [
899413907
] | [
"documented"
] | defmodule Feed.Services.Toolkit do
import Ecto.Query
@doc "Count unique values in table column"
def count_uniq_in(table, column) do
table
|> Enum.uniq_by(& &1[column])
|> Enum.count()
end
@doc "Get time from values greater then 24 hours"
def time_from_seconds_after_midnight(time_str) do
[h... |
0c22857c8151ce1385a6092095731d0909a8716a | 1,560 | [
186295105
] | [] | defmodule Chalmersfood.MixProject do
use Mix.Project
def project do
[
app: :chalmersfood,
version: "0.1.0",
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: alia... |
0c22a9fef32a6e345f82bb97b7985fcbc57c5c39 | 2,456 | [
671610283
] | [
"documented",
"ecto"
] | defmodule OffBroadwayPostgres.Migration do
# Migration approach largely copied from https://github.com/sorentwo/oban
use Ecto.Migration
@default_prefix "public"
@initial_version 1
@current_version 1
@doc false
def initial_version, do: @initial_version
@doc false
def current_version, do: @current_ve... |
0c230349099090eed73ad3ac7469684252ae08fa | 2,997 | [
573285530
] | [] | defmodule Aoc.Y2022.Day7 do
use Aoc.Day
answers do
part_1 1_844_187
end
input do
handle_input fn input ->
input
|> String.split("\n")
|> parse_commands()
end
end
solutions do
part_1 fn input ->
input
|> follow_instructions()
|> Map.get("/")
|> all... |
0c23a1c01b86964893cf1eaa5a7e2548cc9051ba | 7,539 | [
945929939
] | [
"genserver",
"documented"
] | # defmodule MailSage.Unsubscribe.Agent do
# @moduledoc """
# AI-powered agent for handling complex email unsubscribe flows.
# Uses browser automation and GPT for intelligent form filling and navigation.
# """
# # TODO: This is a work in progress - it's not being used, and it has not been tested!
# use Gen... |
0c23e69fabc7bc009ae1c1b0f4bcb80b1bc07831 | 1,653 | [
120704555
] | [] | # 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:
#
# PhoenixAndElm.Repo.insert!(%PhoenixAndElm.SomeSchema{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) ... |
0c240417f54229fc92f66bc1c9a934d28bb2b4b5 | 5,385 | [
225265319
] | [] | defmodule Thirteen do
def computer(list) do
Process.delete(:curr_output)
nums = String.split(list, ",") |> Enum.map(&String.to_integer/1)
positions = nums |> Enum.with_index() |> Enum.reduce(%{rb: 0}, fn {num, p}, acc ->
Map.put(acc, p, num)
end)
processor(positions, 0)
end
def proces... |
0c2427fdb23bd859d3132c36f49770e2011497bb | 2,007 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Domains.V1alpha2.Model.GoogleDomainsDns do
@moduledoc """
Deprecated: For more information, see [Cloud Domains feature deprecation](https://cloud.google.com/domains/docs/deprecations/feature-deprecations). Configuration for using the free DNS zone provided by Google Domains as a `Registration`'s... |
0c2441346bcd7b7dfd8b927b16bb4ed7f0a18860 | 16,881 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Books.V1.Api.Myconfig do
@moduledoc """
API calls for all endpoints tagged `Myconfig`.
"""
alias GoogleApi.Books.V1.Connection
alias GoogleApi.Gax.{Request, Response}
@library_version Mix.Project.config() |> Keyword.get(:version, "")
@doc """
Gets the current settings for the user... |
0c244eb31f993998001bbd41142ca21677b7d3d7 | 1,872 | [
190941039
] | [
"test"
] | defmodule SledTestWithCodec do
use ExUnit.Case
doctest Sled
setup do
path = Path.join(__DIR__, "test_codec.sled")
{:ok, db} = Sled.open(path, codec: Sled.Codec.Term)
on_exit(fn ->
File.rm_rf(path)
:ok
end)
{:ok, %{db: db}}
end
test "should set/get string key", %{db: db} do... |
0c248a804a050530acf50cade5051936ad8b6210 | 15,673 | [
165115442
] | [
"typespec",
"documented",
"ecto"
] | defmodule Logflare.Logs.SearchOperations do
@moduledoc false
alias Logflare.BqRepo
alias Logflare.DateTimeUtils
alias Logflare.Google.BigQuery.{GenUtils}
alias Logflare.Google.BigQuery.GCPConfig
alias Logflare.Logs.Search.Utils
alias Logflare.Lql
alias Logflare.EctoQueryBQ
alias Logflare.SourceSchemas... |
0c24904f9d3f195f5a976694ffa2bb95fec522ba | 1,651 | [
802823581
] | [
"liveview",
"phoenix"
] | defmodule Jalka2024Web.Endpoint do
use Phoenix.Endpoint, otp_app: :jalka2024
# 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: "_jalka... |
0c24e287386a8930935707975dc77fb6cc683262 | 2,300 | [
68313489
] | [
"test"
] | defmodule OopTest do
use OOP.Spec, async: true
doctest OOP
oop_test "get students in a non existant grade" do
school = School.new
assert [] == school ~> students_by_grade(5)
end
oop_test "add student" do
school = School.new
school ~>> add_student("Aimee", 2)
assert ["Aimee"] == school ~... |
0c256d4da40bbaf4cc9d486daccada7bf6b2fac1 | 1,528 | [
317791912
] | [] | defmodule Aoc2020.Day12Task2 do
def read(file) do
file
|> File.stream!([], :line)
|> Enum.map(&String.trim/1)
|> Enum.map(&String.split_at(&1, 1))
|> Enum.map(fn {code, value} -> {code, elem(Integer.parse(value), 0)} end)
end
def rotate(_, waypoint, 0), do: waypoint
def rotate("R", {wy, wx}... |
0c25ad65eb4caa5bbb5dd5df1c0242e98af9e623 | 4,184 | [
921246913
] | [
"genserver",
"typespec"
] | # https://raw.githubusercontent.com/jostlowe/ttk4145_elixir_template/refs/heads/master/lib/driver.ex
defmodule Driver do
use GenServer
require Logger
@call_timeout 1000
@button_map %{:hall_up => 0, :hall_down => 1, :cab => 2}
@state_map %{:on => 1, :off => 0}
@direction_map %{:up => 1, :down => 255, :stop =... |
0c25b51e099cb9036fcc4bfa964a3abb8ac66ffc | 3,098 | [
645576110
] | [
"test",
"phoenix"
] | defmodule VoteAppWeb.QuestionControllerTest do
use VoteAppWeb.ConnCase
import VoteApp.VoteFixtures
@create_attrs %{answer1: "some answer1", answer1_count: 42, answer2: "some answer2", answer2_count: 42, answer3: "some answer3", answer3_count: 42, answer4: "some answer4", answer4_count: 42, body: "some body", st... |
0c260b563daa2cd23af9c8346a6a694e691c048a | 2,088 | [
563322590
] | [
"test",
"documented"
] | defmodule GroupherServer.Test.CMS.BlogMeta do
@moduledoc false
use GroupherServer.TestTools
alias Helper.ORM
alias GroupherServer.CMS
alias CMS.Model.{Embeds, Author, Blog}
@default_article_meta Embeds.ArticleMeta.default_meta()
setup do
{:ok, user} = db_insert(:user)
# {:ok, blog} = db_insert... |
0c26d9dc38ab73627ac4964d0d4acd785395598f | 2,196 | [
83212062
] | [] | %{"certifi": {:hex, :certifi, "2.0.0", "a0c0e475107135f76b8c1d5bc7efb33cd3815cb3cf3dea7aefdd174dabead064", [:rebar3], [], "hexpm"},
"dialyxir": {:hex, :dialyxir, "0.5.1", "b331b091720fd93e878137add264bac4f644e1ddae07a70bf7062c7862c4b952", [], [], "hexpm"},
"dialyze": {:hex, :dialyze, "0.1.4", "28fdf0167d5975b14f79a... |
0c271a529bbf1640a7c103f5ea2d4e064b40771f | 12,548 | [
239822890,
419435907,
459291087
] | [
"test"
] | defmodule Oli.Authoring.Editing.ObjectiveEditorTest do
use Oli.DataCase
alias Oli.Authoring.Editing.{ActivityEditor, ObjectiveEditor, PageEditor}
alias Oli.Publishing.AuthoringResolver
alias Oli.Resources.Revision
describe "objective editing" do
setup do
map =
Seeder.base_project_with_reso... |
0c27351df5970a92adc926410edfe6b213a649c4 | 8,332 | [
115698401
] | [
"typespec",
"supervisor",
"documented"
] | defmodule Weddell do
@moduledoc """
Documentation for Weddell.
"""
use Application
alias GRPC.RPCError
alias Weddell.{Message, Client, Client.Publisher, SubscriptionDetails}
@typedoc "An RPC error"
@type error :: {:error, RPCError.t()}
@doc """
Start Weddell and connect to the Pub/Sub server.
"... |
0c27834597da5e1c0d1f77815278e6d614458114 | 5,585 | [
47219232
] | [
"test"
] | Code.require_file "../fixtures/views.exs", __DIR__
defmodule Phoenix.ViewTest do
use ExUnit.Case, async: true
doctest Phoenix.View
import Phoenix.View
## local render
test "converts assigns to maps even on local calls" do
assert MyApp.UserView.render("edit.html", title: "Test") == "EDIT - Test"
end
... |
0c27a661ff25fee18f212fd20758715ce7d93df0 | 2,176 | [
549631608
] | [
"documented"
] | defmodule ElixirObservability.EntryPoint.ApiRest do
@moduledoc """
Access point to the rest exposed services
"""
#alias ElixirObservability.Utils.DataTypeUtils
alias ElixirObservability.EntryPoint.ErrorHandler
alias ElixirObservability.Domain.UseCase.HelloUseCase
require Logger
use Plug.Router
use T... |
0c27cde4b89e970f4646120fcd9cf729bc06844f | 2,176 | [
890768503
] | [] | # 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 :study_sync,
ecto_repos: [StudySync.Repo],
... |
0c27ef2f68b5cc12522bf2ad9b6ebc693a20c7c7 | 8,557 | [
567369526
] | [
"phoenix"
] | defmodule BlockScoutWeb.API.V2.AddressController do
use BlockScoutWeb, :controller
import BlockScoutWeb.Chain,
only: [
next_page_params: 3,
paging_options: 1,
split_list_by_page: 1,
current_filter: 1
]
alias BlockScoutWeb.API.V2.{AddressView, BlockView, TransactionView}
alias E... |
0c28374ee683919a2e5952531572fecc5dead1bc | 2,143 | [
187568177
] | [] | %{
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"},
"db_connection": {:hex, :db_connection, "2.1.1", "a51e8a2ee54ef2ae6ec41a668c85787ed40cb8944928c191280fe34c15b76ae5", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "he... |
0c2886df409f2d41e0652b230b373e3f6e92119a | 7,173 | [
48781853
] | [
"documented"
] | defmodule UwOsu.Data.Group do
require Logger
import Ecto.Query, only: [from: 2]
alias UwOsu.Osu
alias UwOsu.Models.{Group, User, UserGroup, Token}
alias UwOsu.Repo
@max_group_size Application.get_env(:uw_osu, :max_group_size)
@max_groups Application.get_env(:uw_osu, :max_groups)
defmodule Error do
... |
0c289b4e37263542898bf0d3109d297e49168b22 | 2,337 | [
886999572
] | [] | defmodule BookingsPipeline do
use Broadway
def start_link(args) do
rabbitmq_config = [
queue: "bookings_queue",
declare: [durable: true],
on_failure: :reject_and_requeue
]
opts = [
name: __MODULE__,
producer: [
module: {BroadwayRabbitMQ.Producer, rabbitmq_config}
... |
0c289e783b06e41acedef92876a6e1a873c9e16b | 3,270 | [
98185781
] | [
"test",
"phoenix"
] | defmodule Codebattle.DockerExecution.JSTest do
use Codebattle.IntegrationCase
alias Codebattle.CodeCheck.Result.V2
alias Codebattle.Game
alias CodebattleWeb.GameChannel
alias CodebattleWeb.UserSocket
alias Phoenix.Socket.Broadcast
setup do
user1 = insert(:user)
user2 = insert(:user)
task = i... |
0c28f5beb56dfeff5b385d19e14c2fda19c094ff | 1,521 | [
100054164
] | [] | defmodule CoherenceSocial.Mixfile do
use Mix.Project
@version "0.0.1"
def project do
[app: :coherence_social,
version: @version,
elixir: "~> 1.3",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
start_permanent: Mix.env == :prod,
build_e... |
0c2922a2feac4d50f90e5d36229db1a04d87e2d6 | 4,375 | [
564777585
] | [] | defmodule RabbitMQ.CLI.Plugins.Commands.EnableCommand do
alias RabbitMQ.CLI.Plugins.Helpers, as: PluginHelpers
alias RabbitMQ.CLI.Core.{DocGuide, Validators}
import RabbitMQ.CLI.Core.{CodePath, Paths}
@behaviour RabbitMQ.CLI.CommandBehaviour
def formatter(), do: RabbitMQ.CLI.Formatters.Plugins
def merge_... |
0c29554486a16c362031984fac83298884217aa7 | 2,972 | [
404670532
] | [
"typespec",
"phoenix",
"ecto",
"documented"
] | defmodule TwitterWeb.PostController do
use TwitterWeb, :controller
alias Twitter.Twits
alias Twitter.Twits.Post
# all these are for signed in users
# all require current_user to be the author
plug :authenticate_user
@doc """
show all posts made by the logged in user, aka "my posts"
"""
@spec index(... |
0c2a89eeb1e55b389225c15239a4f25a0db980ee | 2,132 | [
953547194
] | [] | defmodule PhoenixNextjs.MixProject do
use Mix.Project
def project do
[
app: :phoenix_nextjs,
version: "0.1.0",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
releases: [
phoenix_nextjs: [
... |
0c2b24f4ff4dc0e3cfb111381d61aee68b9830e5 | 4,109 | [
942811655,
920024200
] | [
"test"
] | defmodule Rbac.Refresh.WorkerTest do
use Rbac.RepoCase, async: false
alias __MODULE__.{ProjectAPIStub, RepositoryAPIStub}
setup do
{:ok, project_api} = ProjectAPIStub.start_link()
{:ok, repo_api} = RepositoryAPIStub.start_link()
{:ok, worker} = Rbac.Refresh.Worker.start_link()
on_exit(fn ->
... |
0c2b349ea5c396e42ffcdf529529d972c7db3149 | 23,177 | [
140685530
] | [] | defmodule XMediaLib.Zrtp do
require Logger
alias XMediaLib.CRC32C
alias XMediaLib.ZrtpSchema.{
Hello,
Commit,
DHPart1,
DHPart2,
Confirm1,
Confirm2,
Error,
GoClear,
Ping,
PingAck,
SASRelay,
Signature
}
@zrtp_marker 0x1000
# <<"ZRTP">>, <<90,82,84,80>>
@zrt... |
0c2bb28a6ebe5c5b697dbff4c92414f82295f56d | 3,272 | [
766451609
] | [
"liveview"
] | defmodule ExtickWeb.UserSelect do
use ExtickWeb, :live_component
alias Extick.Accounts
attr :name, :any
attr :label, :string, default: nil
attr :value, :any
attr :field, Phoenix.HTML.FormField,
doc: "a form field struct retrieved from the form, for example: @form[:email]"
attr :errors, :list, defa... |
0c2be938b27140c0de8bcf83ab05fb97498406d2 | 1,641 | [
600990834
] | [
"ecto"
] | defmodule Habitsheet.Notes do
use Ecto.Schema
import Ecto.Changeset
embedded_schema do
field :format, Ecto.Enum, values: [:md], default: :md
field :content, :string
end
def changeset(%__MODULE__{} = notes, attrs \\ %{}) do
notes
|> cast(attrs, [:format, :content])
|> validate_required([:... |
0c2bf16cc4d2aacfaa11b8b2bcbde8d211ce7495 | 2,053 | [
696246408
] | [] | defmodule CloudflareAccessEx.MixProject do
use Mix.Project
@source_url "https://github.com/primait/cloudflare_access_ex"
@version "0.1.5"
def project do
[
app: :cloudflare_access_ex,
description: "An elixir library to verify Cloudflare Access application tokens",
version: @version,
... |
0c2bf7ac6e9cb3651e73228a724ea35e783fa30e | 6,668 | [
682769066
] | [
"test",
"ecto"
] | defmodule Humbug.RoomsTest do
use Humbug.DataCase
alias Humbug.Discussions
alias Humbug.Users
describe "rooms" do
alias Humbug.Discussions.Room
import Humbug.DiscussionsFixtures
import Humbug.UsersFixtures
@invalid_attrs %{name: nil}
test "list_rooms/0 returns all rooms" do
room =... |
0c2d10e7f7dfd1b01fb9bbf5d380e2e285b65fe9 | 1,616 | [
579410506
] | [
"genserver",
"liveview"
] | defmodule LivePlaygroundWeb.CompsLive.SlideoverBasic do
use LivePlaygroundWeb, :live_view
def mount(_params, _session, socket) do
{:ok, assign(socket, :slideover, nil)}
end
def render(assigns) do
~H"""
<!-- start hiding from live code -->
<.header class="mb-6">
Slideover Basics
<:s... |
0c2d8cb08b9d84e88247e4a5644c80a50222836a | 4,125 | [
854313489
] | [] | defmodule MagusLive.Agents.Storm.AnswerQuestion do
alias Expo.Message
alias LangChain.PromptTemplate
alias LangChain.Message
alias Magus.AgentChain
alias MagusLive.Agents.StormState
@json_schema_path "agent_schema/storm/answer_question.json"
@base_prompt_template ~S|
You are an expert who can use inform... |
0c2d9fbd916a99edcf10ff10fe4ed4192deaca01 | 2,185 | [
317786353
] | [] | defmodule Proctoring.Chat do
import Ecto.Query, warn: false
alias Proctoring.Repo
alias Proctoring.Accounts.User
alias Proctoring.Chat.Message
def get_user_messages(%User{} = user) do
query = from m in Message,
where: m.to_user_id == ^user.id or m.is_system == true,
order_by: m.inserted_... |
0c2da365c871e9ce697b47899a969ab2fe552397 | 1,711 | [
559744925,
18573162,
610034669,
884344453,
443129197,
694781452,
521625231,
574493719,
510809929,
612444079
] | [
"typespec",
"documented"
] | defmodule Faker.Blockchain.Ethereum do
@moduledoc """
Functions for generate ethereum addresses.
"""
@type address :: <<_::336>>
@type signature :: <<_::1056>>
@doc """
Return ethereum address
## Examples
iex> Faker.Blockchain.Ethereum.address()
"0xd6d98b88c866f496dbd4de7ba48d0f5229fa7bf... |
0c2dda20a694dd9a3bc1b7441cbff7f0a05341c1 | 2,783 | [
273085190,
406732766,
425222664,
286403536,
294000469,
407445450,
290969763,
404104258,
273096993,
256354544,
272192752,
257246799,
299711271,
280469788,
281229752,
333225527,
528199088,
267936422,
297389399,
217930962,
264829031
] | [
"documented",
"ecto"
] | defmodule Mix.Tasks.Ecto.Migrations do
use Mix.Task
import Mix.Ecto
import Mix.EctoSQL
@shortdoc "Displays the repository migration status"
@aliases [
r: :repo
]
@switches [
repo: [:keep, :string],
no_compile: :boolean,
no_deps_check: :boolean,
migrations_path: :keep
]
@moduled... |
0c2de0a71836c571d02a884bd00db8557f4bfe52 | 1,647 | [
207396127
] | [
"test",
"documented"
] | defmodule ExonerateTest.Tutorial.TypeSpecificTest do
use ExUnit.Case, async: true
@moduledoc """
basic tests from:
https://json-schema.org/understanding-json-schema/reference/type.html
Literally conforms to all the tests presented in this document.
"""
@moduletag :tutorial
defmodule Type do
@mo... |
0c2e27803197890d91a0fe759a4b5c4de478c04a | 4,457 | [
716896254
] | [] | defmodule Template.Illuria.Quests do
alias Template.Illuria.Units
alias Warlords.Core.Gameboard.Artifact
def cash_prizes do
[
fn(_) -> {:gold, 1216} end,
fn(_) -> {:gold, 1838} end,
fn(_) -> {:gold, 2595} end,
fn(_) -> {:gold, 864} end,
]
end
def quest_rewards do
[
... |
0c2e40a1f56c1a00dc6ba7b9ccb1301a34a60bf1 | 2,413 | [
814281648
] | [
"liveview",
"documented",
"test"
] | defmodule GameAppWeb.GetTextLiveTest.Index do
@moduledoc """
Tests for the `GameAppWeb.GetTextLiveIndexTest.Index` module.
"""
use GameAppWeb.ConnCase
alias GameApp.Stubs
import Phoenix.LiveViewTest
@moduletag :get_text
@moduletag :live_view
@url "/get-text"
describe "Index" do
setup do
... |
0c2e75be200354705fdb482ab54ed323411772fa | 2,772 | [
250568707
] | [
"typespec",
"documented"
] | defmodule MinioServer.Config do
@moduledoc """
Handles server and client versions and their local locations.
"""
alias MinioServer.CpuInfo
@doc "A list of all the available architectures downloadable."
@spec available_architectures :: [MinioServer.architecture()]
def available_architectures do
[
... |
0c2e8e7333f5054a893386a2fd294626d03a3aba | 2,711 | [
28840825
] | [
"documented"
] | defmodule Noaa.TableFormatter do
@moduledoc """
Is formatting the results of the fetched data and the metadata into a table.
"""
def print(rows, header) do
columns = extract_columns(rows, header)
widths = max_column_widths(columns, header)
formatter = formatter_string(widths, " | ")
print_... |
0c2f2816d2b0d144e94b892a5ee9fc41152bfb32 | 1,892 | [
246359957
] | [
"liveview",
"macro",
"documented",
"phoenix"
] | defmodule NflRushingBackendWeb 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 NflRushingBackendWeb, :controller
use NflRushingBackendWeb, :view
The definitions below will be executed ... |
0c2f74ab58a5796a696d6e42adbd06dbdbfc8274 | 2,391 | [
937373742
] | [] | # 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 :polish_me, :scopes,
user: [
default: tr... |
0c2fde2606df224eac073ba918302d2931c6aa7d | 10,399 | [
434898411
] | [
"phoenix"
] | defmodule TrentoWeb.Router do
use TrentoWeb, :router
use Pow.Phoenix.Router
use PowAssent.Phoenix.Router
# From newest to oldest
@available_api_versions ["v2", "v1"]
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, {TrentoWeb.La... |
0c303376694cd9b5207fdc041363b55603693ece | 3,050 | [
715303936
] | [
"genserver"
] | defmodule Cronyx.Worker do
alias Cronyx.Db.CronyxJobs
alias Cronyx.Db.CronyxJobRuns
use GenServer
def start_link(_) do
GenServer.start_link(__MODULE__, :ok)
end
def init(:ok) do
{:ok, %{}}
end
def execute_job(_pid, job) do
case job.__struct__ do
Cronyx.PersistedJob ->
execu... |
0c305795f01851f4c624eaab50343d43e9597f98 | 7,376 | [
52239326
] | [
"test"
] | defmodule EXRequest.ParamsCheckerTests do
use ExUnit.Case
test "it gets all params in a url" do
url = "users/{name}/repo/{id}/{also}"
params = EXRequest.ParamsChecker.url_params(url)
assert params == ["name", "id", "also"]
end
test "it checks that the params passed match the url" do
url = "use... |
0c3085feb051b9636f9306e2482ab87b3c5b964a | 1,712 | [
129970354
] | [
"test"
] | defmodule VirtualMachine.CodeTest do
use ExUnit.Case
import VirtualMachine.Code
describe "parse" do
test "transforms bytecode into instructions and data" do
assert parse([]) == {}
assert parse([19, ?A, 19, ?A]) == {:out, ?A}
assert parse([0]) == {:halt}
assert parse([1, ?A, ?B]) == {... |
0c30c88ffb719c18945a2d291dd54460e699aee5 | 1,851 | [
101198453
] | [
"phoenix",
"ecto"
] | defmodule WweloTestWeb.WrestlerController do
use WweloTestWeb, :controller
alias WweloTest.Stats
alias WweloTest.Stats.Wrestler
def index(conn, _params) do
wrestlers = Stats.list_wrestlers()
render(conn, "index.html", wrestlers: wrestlers)
end
def new(conn, _params) do
changeset = Stats.chang... |
0c3137e86c1208b36b2ef42c9e39d52fafd138c2 | 2,073 | [
1019465249,
566770189,
204287879
] | [
"documented"
] | defmodule Waffle.Ecto.Type do
@moduledoc """
Provides implementation for custom Ecto.Type behaviour.
"""
require Logger
def type, do: :string
@filename_with_timestamp ~r{^(.*)\?(\d+)$}
def cast(definition, %{file_name: file, updated_at: updated_at}) do
cast(definition, %{"file_name" => file, "upda... |
0c314aad0416b27f75fed81c7e8bf3f6d9243b6f | 1,704 | [
62371590
] | [] | defmodule Recurrence do
def compute(options) do
starts = Keyword.fetch!(options, :starts)
until = Keyword.get(options, :until)
every = Keyword.fetch!(options, :every)
interval = Keyword.fetch!(options, :interval)
compute_from = Keyword.fetch!(options, :from)
compute_to = Keyword.fetch!(op... |
0c3185a1832e7c8c2d2e9e2edf34f1c9b15074a9 | 2,483 | [
556521090
] | [
"liveview",
"macro",
"documented",
"phoenix"
] | defmodule AptosWalletWeb 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 AptosWalletWeb, :controller
use AptosWalletWeb, :view
The definitions below will be executed for every view,
... |
0c32733bc48ad501de8d266ac043c81e97f78233 | 3,437 | [
297878000
] | [
"genserver"
] | defmodule MjpegExample do
use GenServer
import Mogrify
require Logger
@keepalive_interval 1000
@keepalive_update_seconds 5
def start_link(opts \\ []) do
GenServer.start_link(__MODULE__, nil, opts ++ [name: __MODULE__])
end
@impl GenServer
def init(_) do
Process.send_after(self(), :update, 1... |
0c33bca9b5ee91bf86c2414755fcf69ceb74d131 | 1,981 | [
468334390
] | [] | defmodule Money do
@banknotes [100, 50, 20, 10, 5, 2]
@coins [100, 50, 25, 10, 5, 1]
def get_amount_of_banknotes(amount) do
do_get_amount_of_banknotes(trunc(amount), @banknotes, %{})
end
defp do_get_amount_of_banknotes(_, banknotes, accumulator) when length(banknotes) == 0,
do: accumulator
defp d... |
0c3419acc32d771a42efc4b1788a59c261bddade | 1,547 | [
723082978
] | [
"liveview",
"phoenix"
] | defmodule BloodhoundWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :bloodhound
# 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: "_blo... |
0c34c5c83b3063b025c0a1926d4fe1bae6a413af | 4,106 | [
185143887
] | [] | %{
"bcrypt_elixir": {:hex, :bcrypt_elixir, "2.0.3", "64e0792d5b5064391927bf3b8e436994cafd18ca2d2b76dea5c76e0adcf66b7c", [:make, :mix], [{:comeonin, "~> 5.1", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"},
"comeonin": {:hex... |
0c34dbd74dd77dba41d2cff2aba93996bdf975cf | 1,914 | [
177862070
] | [
"documented",
"ecto"
] | defmodule CateringApp.Menus do
@moduledoc """
The Menus context.
"""
import Ecto.Query, warn: false
alias CateringApp.Repo
alias CateringApp.Menus.Menu
@doc """
Returns the list of menus.
## Examples
iex> list_menus()
[%Menu{}, ...]
"""
def list_menus do
Repo.all(Menu)
|>... |
0c34f4d3c5adc18816a8ef3b666e090e2200d6a8 | 2,983 | [
150550854
] | [
"ecto"
] | defmodule Jx3App.Model.RoleLog do
use Ecto.Schema
import Ecto.Changeset
alias Jx3App.Model.{Role, DateRangeType}
schema "role_logs" do
belongs_to :role, Role, type: :string, references: :global_id, foreign_key: :global_id
field :role_id, :id, default: 0
field :name, :string, default: ""
field :... |
0c3532b9b28b7a378de2c6b729523c1822f8e7af | 10,349 | [
918408238
] | [
"liveview",
"documented",
"ecto"
] | defmodule RednewsWeb.HeadlinesLive.FormComponent do
use RednewsWeb, :live_component
alias Rednews.Posts
alias Rednews.Accounts
alias RednewsWeb.Helpers
@impl true
def render(assigns) do
~H"""
<div class="max-w-4xl mx-auto px-4 py-8">
<div class="bg-white dark:bg-gray-800/90 backdrop-blur-sm ... |
0c358dcc850bc0f275a84c7acc6184e5d771f0c4 | 1,724 | [
189254402
] | [] | %{
"cowlib": {:hex, :cowlib, "2.6.0", "8aa629f81a0fc189f261dc98a42243fa842625feea3c7ec56c48f4ccdb55490f", [:rebar3], [], "hexpm"},
"earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.20.2", "1bd0dfb0304bade58be... |
0c359a7f83f6d68f164a68995a1872f62e8f0925 | 6,359 | [
466233588
] | [
"typespec",
"documented"
] | defmodule Ppc.Plan do
@moduledoc """
Manage product plans.
## Reference
- [Plan docs](https://developer.paypal.com/api/subscriptions/v1/#plans_list)
"""
alias Ppc.{Client, Common}
@path "/v1/billing/plans"
@doc """
Get list of plans.
## Accepted options
- :params with accepted values
- :... |
0c359d1df89677c9e5381ab8ba1f1511265f3f2a | 1,614 | [
998425771
] | [
"liveview",
"phoenix"
] | defmodule LiveStocksWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :live_stocks
# 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: "_li... |
0c35c08f301fd284b696fbcd497429a194bfe8c1 | 1,862 | [
786751531
] | [
"liveview",
"phoenix"
] | defmodule SyncappWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :syncapp
# 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: "_syncapp_k... |
0c3651a1d76675299ad8024970b01a984273d00b | 8,811 | [
482895774,
436317855
] | [
"typespec",
"documented",
"ecto"
] | defmodule Siwapp.Commons do
@moduledoc """
The Commons context. It handles Series and Taxes.
"""
import Ecto.Query, warn: false
alias Siwapp.Commons.Series
alias Siwapp.Commons.Tax
alias Siwapp.Repo
### SERIES ###
@doc """
Returns the list of series.
## Examples
iex> list_series()
... |
0c36e809ae8c4c013a230a521a062fb05b3982ee | 2,568 | [
228445335
] | [
"documented"
] | defmodule TruffleHog do
alias TruffleHog.{SparseVector, WordBag}
@moduledoc """
Provides a method to search for matches within a list of documents using TF-IDF.
There are two main use cases: finding which documents are the most similar within
the list; finding which document is the most related to a search ... |
0c373eccbbfbea25c1f394894866b11024b5b0ed | 1,637 | [
975974340
] | [
"supervisor",
"documented"
] | defmodule BundestagAnnotate.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
@impl true
def start(_type, _args) do
children = [
BundestagAnnotateWeb.Telemetry,
BundestagAnnotate.Repo,
{Ecto.Mig... |
0c375a6e61e0a887b33b2ab47df67de52438f5bf | 3,751 | [
98358981
] | [
"test",
"phoenix"
] | defmodule Codebattle.CodeCheck.JS.IntegrationTest do
use Codebattle.IntegrationCase
alias CodebattleWeb.GameChannel
alias Codebattle.GameProcess.{Server, Player}
alias CodebattleWeb.UserSocket
setup do
timeout = Application.fetch_env!(:codebattle, :code_check_timeout)
user1 = insert(:user)
user... |
0c37805b9699489c6da503859fb26375a10df4f1 | 3,109 | [
238075442
] | [
"documented"
] | defmodule Liquex.Tag.IncrementTag do
@moduledoc """
## increment
Creates and outputs a new number variable with initial value 0. On subsequent
calls, it increases its value by one and outputs the new value.
### Input
{% increment my_counter %}
{% increment my_counter %}
{% increment my_c... |
0c383e0c2ebba9d7f489b3bce89ee85025e38b3c | 1,939 | [
857452836
] | [
"test",
"ecto"
] | defmodule LorcanBetAsync.OrdersTest do
use LorcanBetAsync.DataCase
alias LorcanBetAsync.Orders
describe "orders" do
alias LorcanBetAsync.Orders.Order
import LorcanBetAsync.OrdersFixtures
@invalid_attrs %{status: nil, quantity: nil}
test "list_orders/0 returns all orders" do
order = orde... |
0c386cd4f344c490c62863b3088e1e599ad73223 | 2,345 | [
343536185,
376554048
] | [
"test"
] | defmodule Mimicry.OpenAPI.ExampleTest do
use ExUnit.Case
use Mimicry.OpenAPISpecificationCase
alias Mimicry.OpenAPI.{Example, Response}
@examples %{
"foobar" => %{
"summary" => "Some words on foobar",
"value" => %{"foo" => "bar"}
},
"bazbaz_reference_combined" => %{
"$ref" => "si... |
0c3959b75a852bbded021d71b85a208e020b1aed | 1,797 | [
553846681
] | [
"documented"
] | defmodule Motm.DiscordFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `Motm.Discord` context.
"""
@doc """
Generate a unique discord_user discord_id.
"""
def unique_discord_user_discord_id, do: "some discord_id#{System.unique_integer([:positive])}"
@doc """
... |
0c39b9b446de99c23322f35a9f78ad8394ba2302 | 3,825 | [
471830005
] | [
"documented"
] | if PrometheusTelemetry.Utils.app_loaded?(:absinthe) do
defmodule PrometheusTelemetry.Metrics.GraphQL.QueryName do
@moduledoc false
alias Absinthe.Blueprint
alias Absinthe.Language.{ListType, NamedType, NonNullType}
@regex_capture_operation ~r/(?<type>query|mutation|subscription|)(\s*(?<name>\w+)\(.*... |
0c39cc32eaba55052072ab262fef38ca0eda05da | 2,329 | [
92660269
] | [
"phoenix"
] | # This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config
# General application configuration
config :hello_phoenix,
ecto_repos: [HelloPhoeni... |
0c3a31d2e31f4128d0dfe4b5b1690318c6795b1b | 2,909 | [
80499866
] | [] | %{"amqp": {:hex, :amqp, "0.1.5", "f38e30abfce06fd2213f5e24744a2923f9d3c30f1687db19952be547457e0e7b", [:mix], [{:amqp_client, "3.5.6", [hex: :amqp_client, optional: false]}]},
"amqp_client": {:hex, :amqp_client, "3.6.7-pre.1", "5d689656443cf652a0114806e7e2f5c63ceac4d768382ffa08570a246f0e8eaf", [:make, :rebar3], [{:rab... |
0c3af4bb674ac521e5cd3ba21e1042dc1f5583b3 | 4,157 | [
398763454
] | [
"test",
"ecto"
] | defmodule SwcBackend.ArticlesTest do
use SwcBackend.DataCase
alias SwcBackend.Articles
describe "posts" do
alias SwcBackend.Articles.Post
@valid_attrs %{picture: "some picture", text: "some text", video: "some video"}
@update_attrs %{picture: "some updated picture", text: "some updated text", video... |
0c3afbc085eb13b0c259b4878fd6df156fd7a8f2 | 1,732 | [
609341991
] | [
"test"
] | defmodule Members.MemberMagicLinkTest do
use ExUnit.Case
alias Akiles.MemberMagicLink
alias Akiles.Member
test "create, edit, reveal and delete" do
input_user_data = %{name: "Markus"}
link_edit = %{
metadata: %{
key1: "value1",
key2: "value2"
}
}
{:ok, created_user... |
0c3b2f78dbc1825e066c6c087a13f58f6ad9fc0f | 1,502 | [
151649574
] | [
"phoenix"
] | defmodule CollabReactorWeb.Router do
use CollabReactorWeb, :router
pipeline :api do
plug :accepts, ["json"]
plug Guardian.Plug.VerifyHeader, realm: "Bearer"
plug Guardian.Plug.LoadResource
end
scope "/api", CollabReactorWeb do
pipe_through :api
get "/test", GroupController, :test
get ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.