hexsha stringlengths 40 40 | size int64 2 991k | ext stringclasses 2
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 208 | max_stars_repo_name stringlengths 6 106 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 33.5k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 208 | max_issues_repo_name stringlengths 6 106 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 16.3k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 208 | max_forks_repo_name stringlengths 6 106 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 6.91k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 991k | avg_line_length float64 1 36k | max_line_length int64 1 977k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
85930b654b38e28db5027e766fb92f388e4d4f14 | 76 | exs | Elixir | test/test_helper.exs | benhayehudi/phoenix_sms_nexmo | df75b17745185a9932b85eedd70d36d19db0c366 | [
"MIT"
] | 2 | 2019-02-26T17:33:21.000Z | 2019-04-06T21:04:32.000Z | test/test_helper.exs | benhayehudi/phoenix_sms_nexmo | df75b17745185a9932b85eedd70d36d19db0c366 | [
"MIT"
] | null | null | null | test/test_helper.exs | benhayehudi/phoenix_sms_nexmo | df75b17745185a9932b85eedd70d36d19db0c366 | [
"MIT"
] | null | null | null | ExUnit.start()
Ecto.Adapters.SQL.Sandbox.mode(SmsWithPhoenix.Repo, :manual)
| 25.333333 | 60 | 0.802632 |
85935decb8f13633f19057b25e77d07a8036cae6 | 2,162 | exs | Elixir | test/joi/type/list_test.exs | scottming/joi | 1c7546bb0473fa53325533c7ab4aec402bfba0d1 | [
"MIT"
] | 25 | 2020-12-03T08:14:51.000Z | 2021-09-01T15:34:30.000Z | test/joi/type/list_test.exs | scottming/joi | 1c7546bb0473fa53325533c7ab4aec402bfba0d1 | [
"MIT"
] | 5 | 2021-02-13T12:56:56.000Z | 2021-07-30T01:27:51.000Z | test/joi/type/list_test.exs | scottming/joi | 1c7546bb0473fa53325533c7ab4aec402bfba0d1 | [
"MIT"
] | 2 | 2021-03-15T00:37:13.000Z | 2021-07-26T15:21:55.000Z | defmodule Joi.Type.ListTest do
use ExUnit.Case, async: true
import Joi.Type.List
@field :field
describe "validate field" do
test "success: when sub type is :any" do
data_list = [%{@field => [1]}, %{@field => ["1"]}, %{@field => []}]
for d <- data_list do
assert {:ok, d} == validate_fi... | 31.333333 | 120 | 0.515726 |
85937a77fe95e00b465b28ce131555cfddc0babf | 1,975 | ex | Elixir | lib/web/controllers/mail_controller.ex | shanesveller/ex_venture | 68507da11442a9e0423073fcd305e9021f649ca1 | [
"MIT"
] | null | null | null | lib/web/controllers/mail_controller.ex | shanesveller/ex_venture | 68507da11442a9e0423073fcd305e9021f649ca1 | [
"MIT"
] | null | null | null | lib/web/controllers/mail_controller.ex | shanesveller/ex_venture | 68507da11442a9e0423073fcd305e9021f649ca1 | [
"MIT"
] | null | null | null | defmodule Web.MailController do
use Web, :controller
alias Web.Mail
plug(Web.Plug.PublicEnsureUser)
plug(Web.Plug.FetchPage when action in [:index])
plug(:load_mail when action in [:show])
plug(:ensure_your_mail! when action in [:show])
def index(conn, _params) do
%{user: user, page: page, per: pe... | 23.235294 | 80 | 0.577722 |
859398ce188922321aa1414930ecab520cd36e5c | 1,067 | ex | Elixir | clients/compute/lib/google_api/compute/v1/model/projects_list_xpn_hosts_request.ex | GoNZooo/elixir-google-api | cf3ad7392921177f68091f3d9001f1b01b92f1cc | [
"Apache-2.0"
] | null | null | null | clients/compute/lib/google_api/compute/v1/model/projects_list_xpn_hosts_request.ex | GoNZooo/elixir-google-api | cf3ad7392921177f68091f3d9001f1b01b92f1cc | [
"Apache-2.0"
] | null | null | null | clients/compute/lib/google_api/compute/v1/model/projects_list_xpn_hosts_request.ex | GoNZooo/elixir-google-api | cf3ad7392921177f68091f3d9001f1b01b92f1cc | [
"Apache-2.0"
] | 1 | 2018-07-28T20:50:50.000Z | 2018-07-28T20:50:50.000Z | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 28.837838 | 86 | 0.752577 |
8593cd0c8c7d172cdbff5fab67f47b24f2257d83 | 59 | exs | Elixir | config/dev.exs | maxneuvians/maple | 9785945c9fce814d7bd63e0c055cc7e71765e322 | [
"MIT"
] | 24 | 2017-10-03T17:22:35.000Z | 2021-06-09T20:19:43.000Z | config/dev.exs | maxneuvians/maple | 9785945c9fce814d7bd63e0c055cc7e71765e322 | [
"MIT"
] | 2 | 2017-11-20T04:17:26.000Z | 2018-12-12T23:39:07.000Z | config/dev.exs | maxneuvians/maple | 9785945c9fce814d7bd63e0c055cc7e71765e322 | [
"MIT"
] | 4 | 2017-10-29T17:03:08.000Z | 2018-08-30T20:57:24.000Z | use Mix.Config
config :maple,
build_type_structs: false
| 11.8 | 27 | 0.779661 |
8593d1c9cfb7d40b42c0ba76de787959582c8aea | 7,885 | ex | Elixir | lib/release_tasks/reinit.ex | Yamilquery/kaufmann_ex | 5158ae8f524f8780647766ff35db88ebd761da29 | [
"MIT"
] | null | null | null | lib/release_tasks/reinit.ex | Yamilquery/kaufmann_ex | 5158ae8f524f8780647766ff35db88ebd761da29 | [
"MIT"
] | null | null | null | lib/release_tasks/reinit.ex | Yamilquery/kaufmann_ex | 5158ae8f524f8780647766ff35db88ebd761da29 | [
"MIT"
] | null | null | null | defmodule KaufmannEx.ReleaseTasks.ReInit do
@moduledoc """
A Release Task that can be used by implementing services to reinit their internal state
Do not depend on the `target_offset` argument as an absolute. Events offsets are committed in batches, the final batch may include more than the final event.
Cavea... | 28.060498 | 159 | 0.676094 |
8593e8c1c6fb069753c78a39d8a0feaa9fc76838 | 318 | ex | Elixir | lib/credo/cli/command/suggest/output/json.ex | jlgeering/credo | b952190ed758c262aa0d9bbee01227f9b1f0c63b | [
"MIT"
] | null | null | null | lib/credo/cli/command/suggest/output/json.ex | jlgeering/credo | b952190ed758c262aa0d9bbee01227f9b1f0c63b | [
"MIT"
] | null | null | null | lib/credo/cli/command/suggest/output/json.ex | jlgeering/credo | b952190ed758c262aa0d9bbee01227f9b1f0c63b | [
"MIT"
] | null | null | null | defmodule Credo.CLI.Command.Suggest.Output.Json do
alias Credo.CLI.Output.Formatter.JSON
alias Credo.Execution
def print_before_info(_source_files, _exec), do: nil
def print_after_info(_source_files, exec, _time_load, _time_run) do
exec
|> Execution.get_issues()
|> JSON.print_issues()
end
end
| 24.461538 | 69 | 0.751572 |
85940e877912390bbaacba3f4be58bd22467658e | 1,170 | ex | Elixir | apps/thundermoon/lib/thundermoon/counter/digit.ex | grrrisu/thundermoon-mvp | 17939d51c7b07216dfd63ba1b2ba53d56f94a48d | [
"MIT"
] | 10 | 2019-08-02T06:41:23.000Z | 2022-03-09T16:12:30.000Z | apps/thundermoon/lib/thundermoon/counter/digit.ex | grrrisu/thundermoon-mvp | 17939d51c7b07216dfd63ba1b2ba53d56f94a48d | [
"MIT"
] | 319 | 2019-06-11T20:16:26.000Z | 2022-03-09T16:24:22.000Z | apps/thundermoon/lib/thundermoon/counter/digit.ex | grrrisu/thundermoon-mvp | 17939d51c7b07216dfd63ba1b2ba53d56f94a48d | [
"MIT"
] | 4 | 2019-08-15T19:52:07.000Z | 2021-12-02T14:52:54.000Z | defmodule Thundermoon.Digit do
# agent is temporary as it will be restarted by the counter
use Agent, restart: :temporary
alias ThundermoonWeb.PubSub
def start(counter, key, value \\ 0) do
Agent.start(fn ->
broadcast(key, value)
%{counter: counter, key: key, value: value}
end)
end
def... | 20.172414 | 75 | 0.617949 |
8594611768a15cb0f8378eb57e67b512680be536 | 510 | ex | Elixir | lib/rasa_api/model/domain_config.ex | whitedr/rasa-api-elixir | 3ff932ee4cb4d04f0dd5ea66ec4b8f83195a003a | [
"Apache-2.0"
] | null | null | null | lib/rasa_api/model/domain_config.ex | whitedr/rasa-api-elixir | 3ff932ee4cb4d04f0dd5ea66ec4b8f83195a003a | [
"Apache-2.0"
] | null | null | null | lib/rasa_api/model/domain_config.ex | whitedr/rasa-api-elixir | 3ff932ee4cb4d04f0dd5ea66ec4b8f83195a003a | [
"Apache-2.0"
] | null | null | null | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.
defmodule RasaApi.Model.DomainConfig do
@moduledoc """
Addional option
"""
@derive [Poison.Encoder]
defstruct [
:store_entities_as_slots
]
@... | 19.615385 | 91 | 0.715686 |
85949326ef58cae81c0b16bfe6407bac1062461a | 1,355 | ex | Elixir | lib/cforum_web/controllers/blog/tag_controller.ex | jrieger/cforum_ex | 61f6ce84708cb55bd0feedf69853dae64146a7a0 | [
"MIT"
] | 16 | 2019-04-04T06:33:33.000Z | 2021-08-16T19:34:31.000Z | lib/cforum_web/controllers/blog/tag_controller.ex | jrieger/cforum_ex | 61f6ce84708cb55bd0feedf69853dae64146a7a0 | [
"MIT"
] | 294 | 2019-02-10T11:10:27.000Z | 2022-03-30T04:52:53.000Z | lib/cforum_web/controllers/blog/tag_controller.ex | jrieger/cforum_ex | 61f6ce84708cb55bd0feedf69853dae64146a7a0 | [
"MIT"
] | 10 | 2019-02-10T10:39:24.000Z | 2021-07-06T11:46:05.000Z | defmodule CforumWeb.Blog.TagController do
use CforumWeb, :controller
alias Cforum.Threads.Thread
alias Cforum.Messages.Message
alias Cforum.MessagesTags
alias Cforum.Tags
alias Cforum.Abilities
alias CforumWeb.Paginator
def index(conn, _) do
tags = Tags.list_tags([conn.assigns[:current_forum]])
... | 28.829787 | 115 | 0.665683 |
8594b422cb7b9ce4a5da29c5850725ddf0f373bf | 1,545 | ex | Elixir | elixir/lib/homework_web/schemas/users_schema.ex | Billzabob/divvy-homework | 1be2b35d6436dbb3ff1536ed232b2bc61730081d | [
"MIT"
] | null | null | null | elixir/lib/homework_web/schemas/users_schema.ex | Billzabob/divvy-homework | 1be2b35d6436dbb3ff1536ed232b2bc61730081d | [
"MIT"
] | null | null | null | elixir/lib/homework_web/schemas/users_schema.ex | Billzabob/divvy-homework | 1be2b35d6436dbb3ff1536ed232b2bc61730081d | [
"MIT"
] | null | null | null | defmodule HomeworkWeb.Schemas.UsersSchema do
@moduledoc """
Defines the graphql schema for user.
"""
use Absinthe.Schema.Notation
alias HomeworkWeb.Resolvers.UsersResolver
object :user do
field(:id, non_null(:id))
field(:dob, :string)
field(:first_name, :string)
field(:last_name, :string)
... | 23.769231 | 44 | 0.648544 |
85957aa7ac07e8b937a6a40891785653fb902807 | 255 | exs | Elixir | test/log_test.exs | timgestson/expaxos | e0376ca86734aa3d2de3377b364e7ace31819e0f | [
"Apache-2.0"
] | 8 | 2015-08-10T16:06:40.000Z | 2020-10-28T19:34:54.000Z | test/log_test.exs | timgestson/expaxos | e0376ca86734aa3d2de3377b364e7ace31819e0f | [
"Apache-2.0"
] | null | null | null | test/log_test.exs | timgestson/expaxos | e0376ca86734aa3d2de3377b364e7ace31819e0f | [
"Apache-2.0"
] | null | null | null | Code.require_file "test_helper.exs", __DIR__
defmodule Paxos.Proposer.Test do
use ExUnit.Case
alias Paxos.Logger, as: Log
alias Paxos.Logger.State, as: State
alias Paxos.Logger.Entry, as: Entry
test "assert true" do
assert true
end
end
| 18.214286 | 44 | 0.733333 |
8595884bfd6d5e1fe9b79edb05ee8052d0379153 | 2,129 | ex | Elixir | clients/compute/lib/google_api/compute/v1/model/vpn_gateway_list_warning.ex | kyleVsteger/elixir-google-api | 3a0dd498af066a4361b5b0fd66ffc04a57539488 | [
"Apache-2.0"
] | null | null | null | clients/compute/lib/google_api/compute/v1/model/vpn_gateway_list_warning.ex | kyleVsteger/elixir-google-api | 3a0dd498af066a4361b5b0fd66ffc04a57539488 | [
"Apache-2.0"
] | null | null | null | clients/compute/lib/google_api/compute/v1/model/vpn_gateway_list_warning.ex | kyleVsteger/elixir-google-api | 3a0dd498af066a4361b5b0fd66ffc04a57539488 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 39.425926 | 194 | 0.718178 |
85958cdfdd78780673f2f4bb791a7282aff5f396 | 2,309 | exs | Elixir | apps/hefty/priv/repo/migrations/20190503115124_create_pairs.exs | Cinderella-Man/crypto-streamer | b1e990d375f7143c5149930be991249f0d9c3ee3 | [
"MIT"
] | 49 | 2019-10-28T22:27:28.000Z | 2021-10-11T06:40:29.000Z | apps/hefty/priv/repo/migrations/20190503115124_create_pairs.exs | Cinderella-Man/crypto-streamer | b1e990d375f7143c5149930be991249f0d9c3ee3 | [
"MIT"
] | 9 | 2019-08-30T13:15:36.000Z | 2019-10-10T21:25:14.000Z | apps/hefty/priv/repo/migrations/20190503115124_create_pairs.exs | Cinderella-Man/crypto-streamer | b1e990d375f7143c5149930be991249f0d9c3ee3 | [
"MIT"
] | 7 | 2019-10-31T06:19:26.000Z | 2021-09-30T04:20:58.000Z | defmodule Hefty.Repo.Migrations.CreatePairs do
use Ecto.Migration
# Exchange info (list of pairs)
# https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#exchange-information
#
# %{
# "baseAsset" => "STRAT",
# "baseAssetPrecision" => 8,
# "filters" => [
# %{
... | 29.227848 | 110 | 0.5301 |
8595b18f0c24af35147d500ee3e442ea4fde57ea | 1,571 | ex | Elixir | fisherman_server/lib/fisherman_server_web/views/error_helpers.ex | henrysdev/Fisherman | 57bc51730cedb84a47807e2d617061f2cfe54ffd | [
"MIT"
] | 1 | 2020-05-14T06:07:21.000Z | 2020-05-14T06:07:21.000Z | fisherman_server/lib/fisherman_server_web/views/error_helpers.ex | henrysdev/Fisherman | 57bc51730cedb84a47807e2d617061f2cfe54ffd | [
"MIT"
] | 19 | 2020-05-04T17:29:44.000Z | 2020-07-05T18:15:10.000Z | fisherman_server/lib/fisherman_server_web/views/error_helpers.ex | henrysdev/Fisherman | 57bc51730cedb84a47807e2d617061f2cfe54ffd | [
"MIT"
] | null | null | null | defmodule FishermanServerWeb.ErrorHelpers do
@moduledoc """
Conveniences for translating and building error messages.
"""
use Phoenix.HTML
@doc """
Generates tag for inlined form input errors.
"""
def error_tag(form, field) do
Enum.map(Keyword.get_values(form.errors, field), fn error ->
cont... | 32.729167 | 84 | 0.670274 |
8595f33996992d59abb487ce865b98484626dbc4 | 1,620 | ex | Elixir | test/support/conn_case.ex | MatthiasApsel/cforum_ex | 52c621a583182d82692b74694b0b2792ac23b8ff | [
"MIT"
] | null | null | null | test/support/conn_case.ex | MatthiasApsel/cforum_ex | 52c621a583182d82692b74694b0b2792ac23b8ff | [
"MIT"
] | null | null | null | test/support/conn_case.ex | MatthiasApsel/cforum_ex | 52c621a583182d82692b74694b0b2792ac23b8ff | [
"MIT"
] | null | null | null | defmodule CforumWeb.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 and query models.
Finally, if the test case interacts with the d... | 27.457627 | 75 | 0.688889 |
8595f5aed35359ff7f6bfea64022d6216c0f420e | 37,825 | ex | Elixir | clients/android_enterprise/lib/google_api/android_enterprise/v1/api/enterprises.ex | matehat/elixir-google-api | c1b2523c2c4cdc9e6ca4653ac078c94796b393c3 | [
"Apache-2.0"
] | 1 | 2018-12-03T23:43:10.000Z | 2018-12-03T23:43:10.000Z | clients/android_enterprise/lib/google_api/android_enterprise/v1/api/enterprises.ex | matehat/elixir-google-api | c1b2523c2c4cdc9e6ca4653ac078c94796b393c3 | [
"Apache-2.0"
] | null | null | null | clients/android_enterprise/lib/google_api/android_enterprise/v1/api/enterprises.ex | matehat/elixir-google-api | c1b2523c2c4cdc9e6ca4653ac078c94796b393c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 45.572289 | 494 | 0.647931 |
859616e8892c5a0e36579402d99a6ee51b716edb | 87 | ex | Elixir | lib/instagram_clone_web/views/user_registration_view.ex | elixirprogrammer/InstagramClonePETAL | 5710f89de32a95b0416a960a46d081e7ad4833ab | [
"MIT"
] | 69 | 2021-04-11T21:57:26.000Z | 2022-03-30T01:09:40.000Z | lib/instagram_clone_web/views/user_registration_view.ex | hminy572/InstagramClonePETAL | 577cdad0e17399e47ef9d3f8e789bd07e33012b9 | [
"MIT"
] | 1 | 2021-04-16T17:38:11.000Z | 2021-04-16T17:38:11.000Z | lib/instagram_clone_web/views/user_registration_view.ex | hminy572/InstagramClonePETAL | 577cdad0e17399e47ef9d3f8e789bd07e33012b9 | [
"MIT"
] | 4 | 2021-04-16T10:45:18.000Z | 2021-07-23T15:08:08.000Z | defmodule InstagramCloneWeb.UserRegistrationView do
use InstagramCloneWeb, :view
end
| 21.75 | 51 | 0.862069 |
85962a69445ff4f2a0f6d475c613fbd494c1c791 | 3,467 | ex | Elixir | lib/chat_api/reporting.ex | m1ome/papercups | 8c9bf5569dc23d7bce3fcc3a8909bf6d05be8985 | [
"MIT"
] | null | null | null | lib/chat_api/reporting.ex | m1ome/papercups | 8c9bf5569dc23d7bce3fcc3a8909bf6d05be8985 | [
"MIT"
] | null | null | null | lib/chat_api/reporting.ex | m1ome/papercups | 8c9bf5569dc23d7bce3fcc3a8909bf6d05be8985 | [
"MIT"
] | null | null | null | defmodule ChatApi.Reporting do
@moduledoc """
The Reporting context.
"""
import Ecto.Query, warn: false
alias ChatApi.{Repo, Conversations.Conversation, Messages.Message, Users.User}
def count_messages_by_date(account_id, filters \\ %{}) do
Message
|> where(account_id: ^account_id)
|> where(^f... | 31.234234 | 90 | 0.643784 |
859660e5773de8639327c12bd1951bc41473121e | 1,404 | ex | Elixir | lib/new_relic/sampler/ets.ex | alejandrodnm/elixir_agent | b2264d8f54244d136950cadd02f2533967a8e7cb | [
"Apache-2.0"
] | null | null | null | lib/new_relic/sampler/ets.ex | alejandrodnm/elixir_agent | b2264d8f54244d136950cadd02f2533967a8e7cb | [
"Apache-2.0"
] | 1 | 2019-02-08T01:08:31.000Z | 2019-02-20T00:24:51.000Z | lib/new_relic/sampler/ets.ex | alejandrodnm/elixir_agent | b2264d8f54244d136950cadd02f2533967a8e7cb | [
"Apache-2.0"
] | null | null | null | defmodule NewRelic.Sampler.Ets do
use GenServer
@kb 1024
@word_size :erlang.system_info(:wordsize)
# Takes samples of the state of ETS tables
@moduledoc false
def start_link do
GenServer.start_link(__MODULE__, :ok, name: __MODULE__)
end
def init(:ok) do
NewRelic.sample_process()
if NewR... | 25.071429 | 91 | 0.671652 |
859680842aac09356ad73448470becbc946c324a | 1,555 | ex | Elixir | clients/datastore/lib/google_api/datastore/v1/model/allocate_ids_response.ex | GoNZooo/elixir-google-api | cf3ad7392921177f68091f3d9001f1b01b92f1cc | [
"Apache-2.0"
] | null | null | null | clients/datastore/lib/google_api/datastore/v1/model/allocate_ids_response.ex | GoNZooo/elixir-google-api | cf3ad7392921177f68091f3d9001f1b01b92f1cc | [
"Apache-2.0"
] | null | null | null | clients/datastore/lib/google_api/datastore/v1/model/allocate_ids_response.ex | GoNZooo/elixir-google-api | cf3ad7392921177f68091f3d9001f1b01b92f1cc | [
"Apache-2.0"
] | 1 | 2018-07-28T20:50:50.000Z | 2018-07-28T20:50:50.000Z | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 32.395833 | 157 | 0.754341 |
8596f81b77e79ba0989dc4f9a9775c47dc57b032 | 2,623 | ex | Elixir | clients/display_video/lib/google_api/display_video/v1/model/content_instream_position_assigned_targeting_option_details.ex | mcrumm/elixir-google-api | 544f22797cec52b3a23dfb6e39117f0018448610 | [
"Apache-2.0"
] | null | null | null | clients/display_video/lib/google_api/display_video/v1/model/content_instream_position_assigned_targeting_option_details.ex | mcrumm/elixir-google-api | 544f22797cec52b3a23dfb6e39117f0018448610 | [
"Apache-2.0"
] | null | null | null | clients/display_video/lib/google_api/display_video/v1/model/content_instream_position_assigned_targeting_option_details.ex | mcrumm/elixir-google-api | 544f22797cec52b3a23dfb6e39117f0018448610 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 45.224138 | 498 | 0.764773 |
8597189c1320097f9bf7bd28ba54bd301d02806d | 1,756 | exs | Elixir | mix.exs | slaily/discuss | 6f0eacd0f2c03d197f2cf9b6c27a03752c90e969 | [
"MIT"
] | null | null | null | mix.exs | slaily/discuss | 6f0eacd0f2c03d197f2cf9b6c27a03752c90e969 | [
"MIT"
] | null | null | null | mix.exs | slaily/discuss | 6f0eacd0f2c03d197f2cf9b6c27a03752c90e969 | [
"MIT"
] | null | null | null | defmodule Discuss.Mixfile do
use Mix.Project
def project do
[app: :discuss,
version: "0.0.1",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
aliase... | 30.807018 | 89 | 0.599089 |
8597234f95f317cd3be03c0c35c093cf0a076c3a | 1,434 | ex | Elixir | clients/storage/lib/google_api/storage/v1/model/bucket_billing.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2021-10-01T09:20:41.000Z | 2021-10-01T09:20:41.000Z | clients/storage/lib/google_api/storage/v1/model/bucket_billing.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2020-08-18T00:11:23.000Z | 2020-08-18T00:44:16.000Z | clients/storage/lib/google_api/storage/v1/model/bucket_billing.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 30.510638 | 124 | 0.735704 |
85973be7cf9839a7ca873069c226f759cd1bccfb | 101 | ex | Elixir | apps/dredd_web/web/views/helpers/view_helper.ex | TheAustinSeven/Dredd | 2a5429bb3212c97689181017cdd0d3283dbddafd | [
"BSD-3-Clause"
] | null | null | null | apps/dredd_web/web/views/helpers/view_helper.ex | TheAustinSeven/Dredd | 2a5429bb3212c97689181017cdd0d3283dbddafd | [
"BSD-3-Clause"
] | null | null | null | apps/dredd_web/web/views/helpers/view_helper.ex | TheAustinSeven/Dredd | 2a5429bb3212c97689181017cdd0d3283dbddafd | [
"BSD-3-Clause"
] | null | null | null | defmodule DreddWeb.ViewHelper do
def current_user(conn) do
conn.assigns.current_user
end
end
| 16.833333 | 32 | 0.782178 |
85977d880f501ffe18f09d298369aef526639ade | 1,060 | ex | Elixir | lib/nostrum/struct/event/speaking_update.ex | phereford/nostrum | 3d273671f51d839eedac4d6e52ba9cf70720ac01 | [
"MIT"
] | 637 | 2017-03-07T11:25:35.000Z | 2022-03-31T13:37:51.000Z | lib/nostrum/struct/event/speaking_update.ex | phereford/nostrum | 3d273671f51d839eedac4d6e52ba9cf70720ac01 | [
"MIT"
] | 372 | 2017-03-07T20:42:03.000Z | 2022-03-30T22:46:46.000Z | lib/nostrum/struct/event/speaking_update.ex | phereford/nostrum | 3d273671f51d839eedac4d6e52ba9cf70720ac01 | [
"MIT"
] | 149 | 2017-03-07T12:11:58.000Z | 2022-03-19T22:11:51.000Z | defmodule Nostrum.Struct.Event.SpeakingUpdate do
@moduledoc """
Struct representing a Nostrum-generated Speaking Update event
Nostrum will generate this event when the bot starts or stops playing audio.
"""
defstruct [
:channel_id,
:guild_id,
:speaking,
:timed_out
]
alias Nostrum.Struct... | 22.083333 | 78 | 0.658491 |
859783b12cb9d7d73900b1d7f48d0bc326533b65 | 122 | exs | Elixir | early-chapters/times.exs | nespera/progr-elixir-1.6 | d8b5751d5106ce81e440e2ad0a28abb0d00b18a2 | [
"Apache-2.0"
] | null | null | null | early-chapters/times.exs | nespera/progr-elixir-1.6 | d8b5751d5106ce81e440e2ad0a28abb0d00b18a2 | [
"Apache-2.0"
] | null | null | null | early-chapters/times.exs | nespera/progr-elixir-1.6 | d8b5751d5106ce81e440e2ad0a28abb0d00b18a2 | [
"Apache-2.0"
] | null | null | null | defmodule Times do
def double(n), do: n * 2
def triple(n), do: n * 3
def quadruple(n), do: n |> double |> double
end | 24.4 | 45 | 0.614754 |
859783dde4d69a410c1c51b9818d103b9a9323b4 | 577 | exs | Elixir | apps/ewallet/priv/repo/seeders/initial_account.exs | turbo-play/ewallet | b7fee3eed62ac716f46246132c2ead1045f2e4f3 | [
"Apache-2.0"
] | 2 | 2019-07-13T05:49:03.000Z | 2021-08-19T23:58:23.000Z | apps/ewallet/priv/repo/seeders/initial_account.exs | turbo-play/ewallet | b7fee3eed62ac716f46246132c2ead1045f2e4f3 | [
"Apache-2.0"
] | null | null | null | apps/ewallet/priv/repo/seeders/initial_account.exs | turbo-play/ewallet | b7fee3eed62ac716f46246132c2ead1045f2e4f3 | [
"Apache-2.0"
] | 3 | 2018-05-08T17:15:42.000Z | 2021-11-10T04:08:33.000Z | # This is the seeding script for the master account.
alias EWallet.{CLI, Seeder}
alias EWalletDB.Account
data = %{
name: "master_account",
description: "Master Account",
parent_id: nil
}
with nil <- Account.get_master_account(),
{:ok, _account} <- Account.insert(data)
do
nil
else
%Account{} ... | 23.08 | 58 | 0.668977 |
8597a8433012a93eb20bf2a7c2098db690d5f992 | 1,874 | ex | Elixir | clients/content/lib/google_api/content/v2/model/inventory_pickup.ex | kaaboaye/elixir-google-api | 1896784c4342151fd25becd089a5beb323eff567 | [
"Apache-2.0"
] | null | null | null | clients/content/lib/google_api/content/v2/model/inventory_pickup.ex | kaaboaye/elixir-google-api | 1896784c4342151fd25becd089a5beb323eff567 | [
"Apache-2.0"
] | null | null | null | clients/content/lib/google_api/content/v2/model/inventory_pickup.ex | kaaboaye/elixir-google-api | 1896784c4342151fd25becd089a5beb323eff567 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 37.48 | 307 | 0.737994 |
8597c32c6c9d628d3ea5144bb84195b4484b84f9 | 1,114 | exs | Elixir | exercises/practice/crypto-square/test/crypto_square_test.exs | devtayls/elixir | 67824de8209ff1b6ed2f736deedfb5bd815130ca | [
"MIT"
] | 343 | 2017-06-22T16:28:28.000Z | 2022-03-25T21:33:32.000Z | exercises/practice/crypto-square/test/crypto_square_test.exs | devtayls/elixir | 67824de8209ff1b6ed2f736deedfb5bd815130ca | [
"MIT"
] | 583 | 2017-06-19T10:48:40.000Z | 2022-03-28T21:43:12.000Z | exercises/practice/crypto-square/test/crypto_square_test.exs | devtayls/elixir | 67824de8209ff1b6ed2f736deedfb5bd815130ca | [
"MIT"
] | 228 | 2017-07-05T07:09:32.000Z | 2022-03-27T08:59:08.000Z | defmodule CryptoSquareTest do
use ExUnit.Case
# @tag :pending
test "empty plaintext results in an empty ciphertext" do
assert CryptoSquare.encode("") == ""
end
@tag :pending
test "lowercase" do
assert CryptoSquare.encode("A") == "a"
end
@tag :pending
test "remove spaces" do
assert Crypt... | 27.170732 | 89 | 0.684919 |
8597c826984a906b989d69adbf64dd98502c125d | 875 | exs | Elixir | test/grizzly/zwave/commands/association_group_name_report_test.exs | jellybob/grizzly | 290bee04cb16acbb9dc996925f5c501697b7ac94 | [
"Apache-2.0"
] | null | null | null | test/grizzly/zwave/commands/association_group_name_report_test.exs | jellybob/grizzly | 290bee04cb16acbb9dc996925f5c501697b7ac94 | [
"Apache-2.0"
] | null | null | null | test/grizzly/zwave/commands/association_group_name_report_test.exs | jellybob/grizzly | 290bee04cb16acbb9dc996925f5c501697b7ac94 | [
"Apache-2.0"
] | null | null | null | defmodule Grizzly.ZWave.Commands.AssociationNameReportTest do
use ExUnit.Case, async: true
alias Grizzly.ZWave.Commands.AssociationGroupNameReport
test "creates the command and validates params" do
params = [group_id: 2, name: "some_name"]
{:ok, _command} = AssociationGroupNameReport.new(params)
end
... | 35 | 79 | 0.729143 |
8597cd6f2a5b6d56de798bd3c2812de5c64e92e1 | 449 | exs | Elixir | test/models/admin_test.exs | Calvyn82/grades | 4f8f43283cf9380dc48a4bc999dd46c66a1ad7ee | [
"MIT"
] | null | null | null | test/models/admin_test.exs | Calvyn82/grades | 4f8f43283cf9380dc48a4bc999dd46c66a1ad7ee | [
"MIT"
] | null | null | null | test/models/admin_test.exs | Calvyn82/grades | 4f8f43283cf9380dc48a4bc999dd46c66a1ad7ee | [
"MIT"
] | null | null | null | defmodule Grades.AdminTest do
use Grades.ModelCase
alias Grades.Admin
@valid_attrs %{crypted_password: "some content", email: "some content"}
@invalid_attrs %{}
test "changeset with valid attributes" do
changeset = Admin.changeset(%Admin{}, @valid_attrs)
assert changeset.valid?
end
test "chang... | 23.631579 | 73 | 0.726058 |
8597ce8473043c812c9a55f0af969b3326d1f58c | 3,757 | ex | Elixir | clients/dataflow/lib/google_api/dataflow/v1b3/model/source.ex | leandrocp/elixir-google-api | a86e46907f396d40aeff8668c3bd81662f44c71e | [
"Apache-2.0"
] | null | null | null | clients/dataflow/lib/google_api/dataflow/v1b3/model/source.ex | leandrocp/elixir-google-api | a86e46907f396d40aeff8668c3bd81662f44c71e | [
"Apache-2.0"
] | null | null | null | clients/dataflow/lib/google_api/dataflow/v1b3/model/source.ex | leandrocp/elixir-google-api | a86e46907f396d40aeff8668c3bd81662f44c71e | [
"Apache-2.0"
] | 1 | 2020-11-10T16:58:27.000Z | 2020-11-10T16:58:27.000Z | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 62.616667 | 838 | 0.754591 |
85984349f598100f77c7150e0fd140fd15631c27 | 5,602 | exs | Elixir | lib/elixir/test/elixir/integer_test.exs | diogovk/elixir | 7b8213affaad38b50afaa3dfc3a43717f35ba4e7 | [
"Apache-2.0"
] | null | null | null | lib/elixir/test/elixir/integer_test.exs | diogovk/elixir | 7b8213affaad38b50afaa3dfc3a43717f35ba4e7 | [
"Apache-2.0"
] | null | null | null | lib/elixir/test/elixir/integer_test.exs | diogovk/elixir | 7b8213affaad38b50afaa3dfc3a43717f35ba4e7 | [
"Apache-2.0"
] | null | null | null | Code.require_file "test_helper.exs", __DIR__
defmodule IntegerTest do
use ExUnit.Case, async: true
doctest Integer
require Integer
def test_is_odd_in_guards(number) when Integer.is_odd(number),
do: number
def test_is_odd_in_guards(_number),
do: false
def test_is_even_in_guards(number) when Inte... | 30.281081 | 87 | 0.601392 |
85987d70da86a31baa7df8c46460916a75163ebf | 427 | ex | Elixir | backend/lib/kjer_si/rooms/category.ex | danesjenovdan/kjer.si | 185410ede2d42892e4d91c000099283254c5dc7a | [
"Unlicense"
] | 2 | 2019-11-02T21:28:34.000Z | 2019-11-28T18:01:08.000Z | backend/lib/kjer_si/rooms/category.ex | danesjenovdan/kjer.si | 185410ede2d42892e4d91c000099283254c5dc7a | [
"Unlicense"
] | 17 | 2019-11-29T16:23:38.000Z | 2022-02-14T05:11:41.000Z | backend/lib/kjer_si/rooms/category.ex | danesjenovdan/kjer.si | 185410ede2d42892e4d91c000099283254c5dc7a | [
"Unlicense"
] | null | null | null | defmodule KjerSi.Rooms.Category do
use Ecto.Schema
import Ecto.Changeset
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "categories" do
field :name, :string
timestamps(type: :utc_datetime_usec)
end
@doc false
def changeset(category, attrs) do
catego... | 20.333333 | 52 | 0.693208 |
85989a69f80a0bf89652394fb2e1c4dd6dfad1f1 | 698 | ex | Elixir | lib/ach_debit.ex | Packlane/braintree-elixir | 018ed351c64cdac577bf4acb93f73c1adddf70da | [
"MIT"
] | null | null | null | lib/ach_debit.ex | Packlane/braintree-elixir | 018ed351c64cdac577bf4acb93f73c1adddf70da | [
"MIT"
] | null | null | null | lib/ach_debit.ex | Packlane/braintree-elixir | 018ed351c64cdac577bf4acb93f73c1adddf70da | [
"MIT"
] | null | null | null | defmodule Braintree.ACHDebit do
@moduledoc """
Struct for handling an ACH payment response from Braintree
"""
use Braintree.Construction
@type t :: %__MODULE__{
account_holder_name: String.t(),
account_type: String.t(),
bank_name: String.t(),
customer_id: String.t(),
... | 24.928571 | 60 | 0.553009 |
8598be943624cd8b47a23c3058c16bdf9247ee28 | 1,047 | exs | Elixir | config/config.exs | devrafaelantunes/tic_tac_toe_liveview | 9055aff27b45e5d34898bb57018c5a90ea6a8c9e | [
"MIT"
] | null | null | null | config/config.exs | devrafaelantunes/tic_tac_toe_liveview | 9055aff27b45e5d34898bb57018c5a90ea6a8c9e | [
"MIT"
] | 1 | 2021-05-22T02:09:13.000Z | 2021-05-22T02:09:13.000Z | config/config.exs | devrafaelantunes/tic_tac_toe_liveview | 9055aff27b45e5d34898bb57018c5a90ea6a8c9e | [
"MIT"
] | null | null | null | # 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 :tic_tac_toe,
ecto_repos: [TicTacToe.Repo]
... | 32.71875 | 87 | 0.772684 |
8598c078b98f6197b63a41582cdc692861cedfbf | 620 | ex | Elixir | elixir/series/lib/string_series.ex | quatauta/exercism | 8c8a477a83719cbe57630c6a2884d40cc1808149 | [
"MIT"
] | 1 | 2022-01-23T20:34:27.000Z | 2022-01-23T20:34:27.000Z | elixir/series/lib/string_series.ex | quatauta/exercism | 8c8a477a83719cbe57630c6a2884d40cc1808149 | [
"MIT"
] | null | null | null | elixir/series/lib/string_series.ex | quatauta/exercism | 8c8a477a83719cbe57630c6a2884d40cc1808149 | [
"MIT"
] | null | null | null | defmodule StringSeries do
@moduledoc """
Given a string `s` and a positive integer `size`, return all substrings
of that size. If `size` is greater than the length of `s`, or less than 1,
return an empty list.
"""
@spec slices(s :: String.t(), size :: integer) :: list(String.t())
def slices("", _), do: []... | 26.956522 | 76 | 0.590323 |
8598df1f63e1bc73a2fa97042cd35d133be92f98 | 1,127 | exs | Elixir | experiments/elixir_middleman_server/config/config.exs | cjschneider2/Novluno | b1cbc13d1a0c83e81abf01ba1e2f257ad7a5a025 | [
"Unlicense"
] | 12 | 2017-07-05T03:05:56.000Z | 2021-04-30T23:17:36.000Z | experiments/elixir_middleman_server/config/config.exs | cjschneider2/Novluno | b1cbc13d1a0c83e81abf01ba1e2f257ad7a5a025 | [
"Unlicense"
] | 4 | 2017-06-29T05:41:45.000Z | 2021-03-17T00:23:55.000Z | experiments/elixir_middleman_server/config/config.exs | cjschneider2/Novluno | b1cbc13d1a0c83e81abf01ba1e2f257ad7a5a025 | [
"Unlicense"
] | 5 | 2019-02-07T04:15:37.000Z | 2021-03-10T03:16:29.000Z | # This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config
# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
# file won't be loaded nor affect the paren... | 36.354839 | 73 | 0.75244 |
8598f16f9af5d51769fbcee7ca0d162aa9b2d009 | 896 | ex | Elixir | lib/kirby/types/document_string.ex | prefeitura-municipal-campos/kirby | 290835751a28cd7e39be2e721de243e495273be7 | [
"BSD-3-Clause"
] | null | null | null | lib/kirby/types/document_string.ex | prefeitura-municipal-campos/kirby | 290835751a28cd7e39be2e721de243e495273be7 | [
"BSD-3-Clause"
] | null | null | null | lib/kirby/types/document_string.ex | prefeitura-municipal-campos/kirby | 290835751a28cd7e39be2e721de243e495273be7 | [
"BSD-3-Clause"
] | null | null | null | defmodule Kirby.Types.DocumentString do
@moduledoc """
Provides a document String Type
"""
import Kirby.Parser, only: [remove_whitespaces: 1, is_letter?: 1]
@behaviour Ecto.Type
def type, do: :string
def cast(bin) when is_binary(bin), do: {:ok, parse_string(bin)}
def cast(other), do: Ecto.Type.cast(... | 21.853659 | 67 | 0.635045 |
8599269b46a6f68032c790b74e09fdc4cf7dc759 | 1,060 | exs | Elixir | test/unit/file/finder_test.exs | patrykwozinski/churn | 5a5ad6442da8ae0dc46064d4f80e5404c397d90d | [
"MIT"
] | 78 | 2021-05-18T09:55:12.000Z | 2022-03-02T22:11:53.000Z | test/unit/file/finder_test.exs | patrykwozinski/churn | 5a5ad6442da8ae0dc46064d4f80e5404c397d90d | [
"MIT"
] | 14 | 2021-05-12T23:00:43.000Z | 2022-03-02T08:16:01.000Z | test/unit/file/finder_test.exs | patrykwozinski/churn | 5a5ad6442da8ae0dc46064d4f80e5404c397d90d | [
"MIT"
] | 2 | 2021-05-20T14:54:08.000Z | 2021-06-08T18:01:40.000Z | defmodule Churn.File.FinderTest do
use ExUnit.Case, async: true
alias Churn.File
alias Churn.File.Finder
test "it finds files with specific extension" do
# [Given] parameters for root directory and .md extension
path = fixtures_root_path()
extensions = ["md"]
ignores = []
# [When] seeking... | 25.853659 | 70 | 0.663208 |
859926da27ea5c0a805fc278536d459a6704be4e | 2,622 | ex | Elixir | deps/nimble_parsec/lib/nimble_parsec/printer.ex | BandanaPandey/nary_tree | fb1eeb69e38e43c9f9ffb54297cef52dff5c928d | [
"MIT"
] | 13 | 2018-09-19T21:03:29.000Z | 2022-01-27T04:06:32.000Z | deps/nimble_parsec/lib/nimble_parsec/printer.ex | BandanaPandey/nary_tree | fb1eeb69e38e43c9f9ffb54297cef52dff5c928d | [
"MIT"
] | 1 | 2020-05-26T04:16:57.000Z | 2020-05-26T04:16:57.000Z | deps/nimble_parsec/lib/nimble_parsec/printer.ex | BandanaPandey/nary_tree | fb1eeb69e38e43c9f9ffb54297cef52dff5c928d | [
"MIT"
] | 3 | 2020-05-21T04:32:08.000Z | 2021-07-28T05:14:01.000Z | defmodule NimbleParsec.Printer do
@moduledoc """
Functions for printing parser combinator code.
"""
@doc """
Prints parser combinator code.
Receives the same options as `NimbleParsec.defparsec/3`.
"""
@spec defparsec(atom(), NimbleParsec.t(), keyword()) :: iodata
def defparsec(name, combinator, opts... | 25.456311 | 110 | 0.629291 |
85992c1ae1c707029ee19995d022f5d078cb7076 | 1,087 | ex | Elixir | web/router.ex | ench0/ex_elasr | a97e182d13bc5de56c370b687771a485e51fc6ea | [
"MIT"
] | null | null | null | web/router.ex | ench0/ex_elasr | a97e182d13bc5de56c370b687771a485e51fc6ea | [
"MIT"
] | null | null | null | web/router.ex | ench0/ex_elasr | a97e182d13bc5de56c370b687771a485e51fc6ea | [
"MIT"
] | null | null | null | defmodule Elasr.Router do
use Elasr.Web, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
end
pipeline :api do
plug :accepts, ["json"]
end
scope "/", Elasr do
pipe_through :br... | 25.27907 | 63 | 0.676173 |
85993a85a7dc4d2d51aad2ae1a7195bc1b4c50c2 | 417 | exs | Elixir | test/screens_web/views/error_view_test.exs | mbta/screens | 4b586970f8844b19543bb2ffd4b032a89f6fa40a | [
"MIT"
] | 3 | 2021-07-27T14:11:00.000Z | 2022-01-03T14:16:43.000Z | test/screens_web/views/error_view_test.exs | mbta/screens | 4b586970f8844b19543bb2ffd4b032a89f6fa40a | [
"MIT"
] | 444 | 2021-03-10T20:57:17.000Z | 2022-03-31T16:00:35.000Z | test/screens_web/views/error_view_test.exs | mbta/screens | 4b586970f8844b19543bb2ffd4b032a89f6fa40a | [
"MIT"
] | null | null | null | defmodule ScreensWeb.ErrorViewTest do
use ScreensWeb.ConnCase, async: true
# Bring render/3 and render_to_string/3 for testing custom views
import Phoenix.View
test "renders 404.html" do
assert render_to_string(ScreensWeb.ErrorView, "404.html", []) == "Not Found"
end
test "renders 500.html" do
as... | 27.8 | 92 | 0.733813 |
85994210c9d654e522368e47ec2877da164ee155 | 966 | ex | Elixir | clients/dfa_reporting/lib/google_api/dfa_reporting/v28/request_builder.ex | matehat/elixir-google-api | c1b2523c2c4cdc9e6ca4653ac078c94796b393c3 | [
"Apache-2.0"
] | 1 | 2018-12-03T23:43:10.000Z | 2018-12-03T23:43:10.000Z | clients/dfa_reporting/lib/google_api/dfa_reporting/v28/request_builder.ex | matehat/elixir-google-api | c1b2523c2c4cdc9e6ca4653ac078c94796b393c3 | [
"Apache-2.0"
] | null | null | null | clients/dfa_reporting/lib/google_api/dfa_reporting/v28/request_builder.ex | matehat/elixir-google-api | c1b2523c2c4cdc9e6ca4653ac078c94796b393c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 37.153846 | 77 | 0.76501 |
85994bcaa208f7e70ef8d334f727086c4cd8b3f8 | 1,685 | ex | Elixir | lib/farside/router.ex | rottenstonks/farside | 3654fee2b36a2e770a056bd36f9884cba4a453de | [
"MIT"
] | null | null | null | lib/farside/router.ex | rottenstonks/farside | 3654fee2b36a2e770a056bd36f9884cba4a453de | [
"MIT"
] | null | null | null | lib/farside/router.ex | rottenstonks/farside | 3654fee2b36a2e770a056bd36f9884cba4a453de | [
"MIT"
] | null | null | null | defmodule Farside.Router do
@index Application.fetch_env!(:farside, :index)
@route Application.fetch_env!(:farside, :route)
use Plug.Router
plug(Farside.Throttle)
plug(:match)
plug(:dispatch)
def get_query_params(conn) do
cond do
String.length(conn.query_string) > 0 ->
"?#{conn.query_... | 20.301205 | 58 | 0.578042 |
85998100b354fe6e76a2bfd796231f2a624a12bc | 1,898 | ex | Elixir | clients/tool_results/lib/google_api/tool_results/v1beta3/model/primary_step.ex | medikent/elixir-google-api | 98a83d4f7bfaeac15b67b04548711bb7e49f9490 | [
"Apache-2.0"
] | null | null | null | clients/tool_results/lib/google_api/tool_results/v1beta3/model/primary_step.ex | medikent/elixir-google-api | 98a83d4f7bfaeac15b67b04548711bb7e49f9490 | [
"Apache-2.0"
] | 1 | 2020-12-18T09:25:12.000Z | 2020-12-18T09:25:12.000Z | clients/tool_results/lib/google_api/tool_results/v1beta3/model/primary_step.ex | medikent/elixir-google-api | 98a83d4f7bfaeac15b67b04548711bb7e49f9490 | [
"Apache-2.0"
] | 1 | 2020-10-04T10:12:44.000Z | 2020-10-04T10:12:44.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 37.215686 | 164 | 0.744995 |
8599a662de3b2b5ade385f797c53f06ec7e54b05 | 620 | ex | Elixir | exercises/practice/collatz-conjecture/.meta/example.ex | devtayls/elixir | 67824de8209ff1b6ed2f736deedfb5bd815130ca | [
"MIT"
] | 343 | 2017-06-22T16:28:28.000Z | 2022-03-25T21:33:32.000Z | exercises/practice/collatz-conjecture/.meta/example.ex | devtayls/elixir | 67824de8209ff1b6ed2f736deedfb5bd815130ca | [
"MIT"
] | 583 | 2017-06-19T10:48:40.000Z | 2022-03-28T21:43:12.000Z | exercises/practice/collatz-conjecture/.meta/example.ex | devtayls/elixir | 67824de8209ff1b6ed2f736deedfb5bd815130ca | [
"MIT"
] | 228 | 2017-07-05T07:09:32.000Z | 2022-03-27T08:59:08.000Z | defmodule CollatzConjecture do
@doc """
calc/1 takes an integer and returns the number of steps required to get the
number to 1 when following the rules:
- if number is odd, multiply with 3 and add 1
- if number is even, divide by 2
"""
@spec calc(input :: pos_integer()) :: non_neg_integer()
def cal... | 41.333333 | 89 | 0.679032 |
8599b9e987df316a377df26e9beed758b6a16cb4 | 1,035 | exs | Elixir | mix.exs | CasperSleep/twilixir | 6463b9c09d0025ded5cbe7ed41a570e686ba249a | [
"MIT"
] | 3 | 2018-05-18T02:33:46.000Z | 2021-01-05T06:37:41.000Z | mix.exs | CasperSleep/twilixir | 6463b9c09d0025ded5cbe7ed41a570e686ba249a | [
"MIT"
] | null | null | null | mix.exs | CasperSleep/twilixir | 6463b9c09d0025ded5cbe7ed41a570e686ba249a | [
"MIT"
] | 1 | 2018-09-25T11:45:51.000Z | 2018-09-25T11:45:51.000Z | defmodule Twilixir.Mixfile do
use Mix.Project
def project do
[app: :twilixir,
version: "1.0.0",
elixir: "~> 1.2",
description: "A Twilio client for elixir.",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
package: package(),
deps: deps()]
end
# Conf... | 23.522727 | 77 | 0.590338 |
8599bb4bae56fd5a2e90dd07e5ac1dd61104b275 | 4,564 | ex | Elixir | ex_graphs_book/apps/graph_commons/lib/graph_commons/graph.ex | NickMcG/ExGraphsBook | 89276d374dd21cc4605a4b1b5a05b177723680c2 | [
"Apache-2.0"
] | null | null | null | ex_graphs_book/apps/graph_commons/lib/graph_commons/graph.ex | NickMcG/ExGraphsBook | 89276d374dd21cc4605a4b1b5a05b177723680c2 | [
"Apache-2.0"
] | null | null | null | ex_graphs_book/apps/graph_commons/lib/graph_commons/graph.ex | NickMcG/ExGraphsBook | 89276d374dd21cc4605a4b1b5a05b177723680c2 | [
"Apache-2.0"
] | null | null | null | defmodule GraphCommons.Graph do
## ATTRIBUTES
@storage_dir GraphCommons.storage_dir()
## STRUCT
@derive {Inspect, except: [:path, :uri]}
@enforce_keys ~w[data file type]a
defstruct ~w[data file path type uri]a
## TYPES
@type graph_data :: String.t()
@type graph_file :: String.t()
@type graph_... | 25.640449 | 95 | 0.618317 |
8599fe588b2a0e754e38982521b7a52e2c9ad648 | 146 | ex | Elixir | lib/exq_ui_web/live/components/nav_bar_component.ex | snowflakes-network/ecq_ui | c6a9cef5ce10d501d2408bcd30e27f4e570d6fce | [
"Apache-2.0"
] | 125 | 2015-12-21T00:20:28.000Z | 2022-03-29T07:21:43.000Z | lib/exq_ui_web/live/components/nav_bar_component.ex | snowflakes-network/ecq_ui | c6a9cef5ce10d501d2408bcd30e27f4e570d6fce | [
"Apache-2.0"
] | 81 | 2015-12-20T06:00:43.000Z | 2022-02-05T13:53:22.000Z | lib/exq_ui_web/live/components/nav_bar_component.ex | snowflakes-network/ecq_ui | c6a9cef5ce10d501d2408bcd30e27f4e570d6fce | [
"Apache-2.0"
] | 87 | 2016-01-25T05:37:04.000Z | 2022-01-28T15:33:44.000Z | defmodule ExqUIWeb.NavBarComponent do
use ExqUIWeb, :live_component
@impl true
def update(_assigns, socket) do
{:ok, socket}
end
end
| 16.222222 | 37 | 0.726027 |
859a0a13a91cb076410d6eba836a4b4d48947eed | 1,530 | exs | Elixir | test/test_helper.exs | nathanjohnson320/exselenium | 8794296b305f3418a1c77444f2ca6ea0ec3ae4b6 | [
"MIT"
] | 9 | 2017-04-23T05:32:55.000Z | 2021-01-29T21:11:43.000Z | test/test_helper.exs | nathanjohnson320/exselenium | 8794296b305f3418a1c77444f2ca6ea0ec3ae4b6 | [
"MIT"
] | null | null | null | test/test_helper.exs | nathanjohnson320/exselenium | 8794296b305f3418a1c77444f2ca6ea0ec3ae4b6 | [
"MIT"
] | 1 | 2019-07-20T00:18:52.000Z | 2019-07-20T00:18:52.000Z | defmodule TestServer do
import Plug.Conn
def init(opts) do
opts
end
def call(conn, _) do
conn
|> put_resp_content_type("text/html")
send_resp(conn, 200, """
<html>
<head>
<title> The simplest HTML example</title>
</head>
<body>
<h1 class="nospellingerrors"... | 22.5 | 127 | 0.60915 |
859a15e26caeabac35d5e07d66697109aed03eae | 331 | exs | Elixir | config/dev.exs | zuppler/zuppler-elixir | 3bd612e92d238c8cd2f228bbef72a4352dc330be | [
"Apache-2.0"
] | null | null | null | config/dev.exs | zuppler/zuppler-elixir | 3bd612e92d238c8cd2f228bbef72a4352dc330be | [
"Apache-2.0"
] | null | null | null | config/dev.exs | zuppler/zuppler-elixir | 3bd612e92d238c8cd2f228bbef72a4352dc330be | [
"Apache-2.0"
] | null | null | null | use Mix.Config
config :zuppler_elixir, Zuppler.Endpoint,
restaurants_url: "http://restaurants.api.biznettechnologies.com"
config :zuppler_elixir, Zuppler.Endpoint,
graphql_endpoint: "/graphql"
config :zuppler_elixir, Zuppler.Endpoint,
check_address_endpoint: "/api/v5/restaurants/:restaurant_id/check_address/:a... | 30.090909 | 88 | 0.809668 |
859a5730fe280b4f19d8e31d0ce2db77db8b498e | 273 | exs | Elixir | apps/webapp/spec/spec_helper.exs | iporaitech/phoenix-webpack-react-docker | c454db0b851b9d00db868a64b96e567d4a0cc3d9 | [
"MIT"
] | 25 | 2016-08-09T15:04:37.000Z | 2021-11-15T12:20:27.000Z | apps/webapp/spec/spec_helper.exs | iporaitech/phoenix-webpack-react-docker | c454db0b851b9d00db868a64b96e567d4a0cc3d9 | [
"MIT"
] | 62 | 2016-05-23T20:16:40.000Z | 2017-04-18T18:36:29.000Z | apps/webapp/spec/spec_helper.exs | iporaitech/phoenix-webpack-react-docker | c454db0b851b9d00db868a64b96e567d4a0cc3d9 | [
"MIT"
] | 10 | 2016-08-17T15:29:21.000Z | 2017-02-28T07:58:30.000Z | Code.require_file("#{__DIR__}/phoenix_helper.exs")
ESpec.configure fn(config) ->
config.before fn(_tags) ->
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Webapp.Repo)
end
config.finally fn(_shared) ->
Ecto.Adapters.SQL.Sandbox.checkin(Webapp.Repo, [])
end
end
| 22.75 | 57 | 0.70696 |
859a5797738e952591fd3864d0013be6bc8866ef | 1,935 | exs | Elixir | test/space_ex/service/krpc_test.exs | wisq/space_ex | 56a87bdd67af093ad70e2843ff4cf963ddf7018c | [
"Apache-2.0"
] | 7 | 2018-01-30T14:09:13.000Z | 2021-01-22T22:38:32.000Z | test/space_ex/service/krpc_test.exs | wisq/space_ex | 56a87bdd67af093ad70e2843ff4cf963ddf7018c | [
"Apache-2.0"
] | null | null | null | test/space_ex/service/krpc_test.exs | wisq/space_ex | 56a87bdd67af093ad70e2843ff4cf963ddf7018c | [
"Apache-2.0"
] | 1 | 2018-01-30T14:09:17.000Z | 2018-01-30T14:09:17.000Z | defmodule SpaceEx.Service.KRPCTest do
use ExUnit.Case, async: true
alias SpaceEx.Test.MockConnection
alias SpaceEx.KRPC
alias SpaceEx.Protobufs.Argument
setup do
{:ok, MockConnection.start()}
end
# Tests:
# * no arguments
# * simple return value
test "KRPC.paused/1", state do
MockCon... | 29.769231 | 67 | 0.687855 |
859a681f77804b84bbb5bad30fcfa33e3bd0791c | 1,042 | exs | Elixir | apps/ewallet_db/test/ewallet_db/mint_test.exs | jimpeebles/ewallet | ad4a9750ec8dc5adc4c0dfe6c22f0ef760825405 | [
"Apache-2.0"
] | null | null | null | apps/ewallet_db/test/ewallet_db/mint_test.exs | jimpeebles/ewallet | ad4a9750ec8dc5adc4c0dfe6c22f0ef760825405 | [
"Apache-2.0"
] | null | null | null | apps/ewallet_db/test/ewallet_db/mint_test.exs | jimpeebles/ewallet | ad4a9750ec8dc5adc4c0dfe6c22f0ef760825405 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 OmiseGO Pte Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 32.5625 | 74 | 0.765835 |
859a6969afa4f352461662bb48b32d5167d7618c | 661 | exs | Elixir | test/day12_test.exs | azuline/aoc2019 | 78fe38d0dc6d2d2c5ca7fc6286cff1dd165c604a | [
"Apache-2.0"
] | null | null | null | test/day12_test.exs | azuline/aoc2019 | 78fe38d0dc6d2d2c5ca7fc6286cff1dd165c604a | [
"Apache-2.0"
] | null | null | null | test/day12_test.exs | azuline/aoc2019 | 78fe38d0dc6d2d2c5ca7fc6286cff1dd165c604a | [
"Apache-2.0"
] | null | null | null | defmodule Day12Test do
use ExUnit.Case, async: true
import Day12
alias Day12.{Part1, Part2, Moon}
test "part 1" do
assert 14809 == get_moons() |> Part1.run()
end
test "part 2" do
assert 282_270_365_571_288 == get_moons() |> Part2.run()
end
@test_moons [
%Moon{position: %{x: -1, y: 0, z: ... | 22.033333 | 83 | 0.596067 |
859ab464acd7ce6d0a06e7375dff975901a4c9f4 | 350 | exs | Elixir | priv/repo/migrations/20160805203929_create_skill.exs | superdev999/Phoenix-project | ab13ac9366cdd0aa9581da7faf993b11aaa5344c | [
"MIT"
] | 275 | 2015-06-23T00:20:51.000Z | 2021-08-19T16:17:37.000Z | priv/repo/migrations/20160805203929_create_skill.exs | superdev999/Phoenix-project | ab13ac9366cdd0aa9581da7faf993b11aaa5344c | [
"MIT"
] | 1,304 | 2015-06-26T02:11:54.000Z | 2019-12-12T21:08:00.000Z | priv/repo/migrations/20160805203929_create_skill.exs | superdev999/Phoenix-project | ab13ac9366cdd0aa9581da7faf993b11aaa5344c | [
"MIT"
] | 140 | 2016-01-01T18:19:47.000Z | 2020-11-22T06:24:47.000Z | defmodule CodeCorps.Repo.Migrations.CreateSkill do
use Ecto.Migration
def change do
create table(:skills) do
add :title, :string, null: false
add :description, :string
add :original_row, :integer
timestamps()
end
create index(:skills, ["lower(title)"], name: :index_skills_on_t... | 21.875 | 87 | 0.677143 |
859ae434052d6bf3677d7b8eab63a2a58d532879 | 11,726 | ex | Elixir | backend/lib/cpsim_backend/changesets.ex | azhi/cpsim | a10a3e068a8a319e66cc9cf8a6c9c97457d9bf8b | [
"MIT"
] | null | null | null | backend/lib/cpsim_backend/changesets.ex | azhi/cpsim | a10a3e068a8a319e66cc9cf8a6c9c97457d9bf8b | [
"MIT"
] | null | null | null | backend/lib/cpsim_backend/changesets.ex | azhi/cpsim | a10a3e068a8a319e66cc9cf8a6c9c97457d9bf8b | [
"MIT"
] | null | null | null | defmodule CPSIM.Backend.Changesets do
alias CPSIM.CP.{InternalConfig, OCPPConfig, Connection, Actions, Heartbeat, Commands, Status}
def cp_opts(args) do
types = %{internal_config: :map, ocpp_config: :map, modules: :map}
with {:ok, args} <-
{%{}, types}
|> Ecto.Changeset.cast(args, Ma... | 34.692308 | 95 | 0.644721 |
859b20460fbab3d7af0d40c5d904c35934b1ab5a | 2,721 | exs | Elixir | test/serum/header_parser_test.exs | nallwhy/Serum | ed9f51a83e328789ccfca18d2a0397b45ac4be0f | [
"MIT"
] | null | null | null | test/serum/header_parser_test.exs | nallwhy/Serum | ed9f51a83e328789ccfca18d2a0397b45ac4be0f | [
"MIT"
] | null | null | null | test/serum/header_parser_test.exs | nallwhy/Serum | ed9f51a83e328789ccfca18d2a0397b45ac4be0f | [
"MIT"
] | null | null | null | defmodule Serum.HeaderParserTest do
use ExUnit.Case, async: true
import Serum.HeaderParser
@options [
my_str: :string,
my_int: :integer,
my_date1: :datetime,
my_date2: :datetime,
my_strs: {:list, :string},
my_ints: {:list, :integer},
my_dates: {:list, :datetime}
]
@required [:my_... | 21.943548 | 85 | 0.54208 |
859b497f85672b3963a3b3adad6f3a53d838c2ad | 244 | ex | Elixir | implementations/elixir/ockam/ockam_services/lib/services/token_lease_manager/lease.ex | 0x00A5/ockam | 9710804e20606e70057d65c70d1af7236194aeeb | [
"Apache-2.0"
] | null | null | null | implementations/elixir/ockam/ockam_services/lib/services/token_lease_manager/lease.ex | 0x00A5/ockam | 9710804e20606e70057d65c70d1af7236194aeeb | [
"Apache-2.0"
] | null | null | null | implementations/elixir/ockam/ockam_services/lib/services/token_lease_manager/lease.ex | 0x00A5/ockam | 9710804e20606e70057d65c70d1af7236194aeeb | [
"Apache-2.0"
] | null | null | null | defmodule Ockam.Services.TokenLeaseManager.Lease do
@moduledoc false
defstruct id: "",
issued: nil,
renewable: false,
tags: [],
ttl: 0,
value: ""
@type t() :: %__MODULE__{}
end
| 20.333333 | 51 | 0.512295 |
859b4f7ec2520cb65fc7ee22616433ad94a40a18 | 2,892 | ex | Elixir | lib/exponent_server_sdk/push_notification.ex | digitalnativescreative/exponent-server-sdk-elixir | b10c569f98ff9e8b3c0114755edc69ffe781fb0f | [
"MIT"
] | null | null | null | lib/exponent_server_sdk/push_notification.ex | digitalnativescreative/exponent-server-sdk-elixir | b10c569f98ff9e8b3c0114755edc69ffe781fb0f | [
"MIT"
] | null | null | null | lib/exponent_server_sdk/push_notification.ex | digitalnativescreative/exponent-server-sdk-elixir | b10c569f98ff9e8b3c0114755edc69ffe781fb0f | [
"MIT"
] | 1 | 2021-12-16T22:18:41.000Z | 2021-12-16T22:18:41.000Z | defmodule ExponentServerSdk.PushNotification do
@moduledoc """
Provides a basic HTTP interface to allow easy communication with the Exponent Push Notification
API, by wrapping `HTTPotion`.
## Examples
Requests are made to the Exponent Push Notification API by passing in a `Map` into one
of the `Notificati... | 29.212121 | 97 | 0.682227 |
859b57788ee38d5095e14078807ca547b6c67d7d | 511 | ex | Elixir | lib/budget_app_web/views/error_view.ex | djordje/budget_app.backend | 3febe64892e700f3174b8eddbc4b96260c444308 | [
"MIT"
] | null | null | null | lib/budget_app_web/views/error_view.ex | djordje/budget_app.backend | 3febe64892e700f3174b8eddbc4b96260c444308 | [
"MIT"
] | null | null | null | lib/budget_app_web/views/error_view.ex | djordje/budget_app.backend | 3febe64892e700f3174b8eddbc4b96260c444308 | [
"MIT"
] | null | null | null | defmodule BudgetAppWeb.ErrorView do
use BudgetAppWeb, :view
def render("400.json", %{detail: detail}) do
%{errors: %{detail: detail}}
end
def render("404.json", _assigns) do
%{errors: %{detail: "Page not found"}}
end
def render("500.json", _assigns) do
%{errors: %{detail: "Internal server err... | 23.227273 | 49 | 0.671233 |
859b69e473cd47111f40726a063067110ef7fb99 | 284 | ex | Elixir | lib/grizzly/zwave/zwave_error.ex | smartrent/grizzly | 65a397ea7bfedb5518fe63a3f058a0b6af473e39 | [
"Apache-2.0"
] | 76 | 2019-09-04T16:56:58.000Z | 2022-03-29T06:54:36.000Z | lib/grizzly/zwave/zwave_error.ex | smartrent/grizzly | 65a397ea7bfedb5518fe63a3f058a0b6af473e39 | [
"Apache-2.0"
] | 124 | 2019-09-05T14:01:24.000Z | 2022-02-28T22:58:14.000Z | lib/grizzly/zwave/zwave_error.ex | smartrent/grizzly | 65a397ea7bfedb5518fe63a3f058a0b6af473e39 | [
"Apache-2.0"
] | 10 | 2019-10-23T19:25:45.000Z | 2021-11-17T13:21:20.000Z | defmodule Grizzly.ZWave.ZWaveError do
@moduledoc """
Exception for when receiving unsupported Z-Wave binary
"""
@type t :: %__MODULE__{binary: binary()}
defexception [:binary]
def message(%{binary: binary}) do
"unexpected Z-Wave binary #{inspect(binary)}"
end
end
| 21.846154 | 56 | 0.697183 |
859bba1d110ba776f41a12fdb888c7edff175275 | 14,702 | ex | Elixir | lib/protobuf/dsl.ex | arctic-grpc/protobuf | 228e1a2912af7b7f7f49ef871e43dd6b886f6675 | [
"MIT"
] | 419 | 2017-04-02T13:10:51.000Z | 2020-11-15T15:53:17.000Z | lib/protobuf/dsl.ex | arctic-grpc/protobuf | 228e1a2912af7b7f7f49ef871e43dd6b886f6675 | [
"MIT"
] | 100 | 2017-04-02T14:26:41.000Z | 2020-11-10T23:43:30.000Z | lib/protobuf/dsl.ex | arctic-grpc/protobuf | 228e1a2912af7b7f7f49ef871e43dd6b886f6675 | [
"MIT"
] | 83 | 2017-07-24T21:50:04.000Z | 2020-11-15T08:52:34.000Z | defmodule Protobuf.DSL do
@doc """
Define a field in the message module.
"""
defmacro field(name, fnum, options \\ []) do
quote do
@fields {unquote(name), unquote(fnum), unquote(options)}
end
end
@doc """
Define oneof in the message module.
"""
defmacro oneof(name, index) do
quote d... | 36.48139 | 101 | 0.667528 |
859c0be573e85803b0d4e9b23cfaa25a27c6988e | 247 | ex | Elixir | web/policies/category_policy.ex | superdev999/Phoenix-project | ab13ac9366cdd0aa9581da7faf993b11aaa5344c | [
"MIT"
] | null | null | null | web/policies/category_policy.ex | superdev999/Phoenix-project | ab13ac9366cdd0aa9581da7faf993b11aaa5344c | [
"MIT"
] | null | null | null | web/policies/category_policy.ex | superdev999/Phoenix-project | ab13ac9366cdd0aa9581da7faf993b11aaa5344c | [
"MIT"
] | null | null | null | defmodule CodeCorps.CategoryPolicy do
alias CodeCorps.User
def create?(%User{admin: true}), do: true
def create?(%User{admin: false}), do: false
def update?(%User{admin: true}), do: true
def update?(%User{admin: false}), do: false
end
| 24.7 | 45 | 0.692308 |
859c1659d601e0dcbbcfeadb2fca9762176ccd08 | 348 | exs | Elixir | priv/repo/seeds.exs | ktornwall/elixir_conf_2016_demo | 5a0adf832773714ba7743c049964623262ee7a13 | [
"MIT"
] | 27 | 2016-09-02T19:26:16.000Z | 2017-11-30T02:27:16.000Z | priv/repo/seeds.exs | katzenbar/elixir_conf_2016_demo | 5a0adf832773714ba7743c049964623262ee7a13 | [
"MIT"
] | 1 | 2016-10-23T18:24:59.000Z | 2016-10-23T18:24:59.000Z | priv/repo/seeds.exs | ktornwall/elixir_conf_2016_demo | 5a0adf832773714ba7743c049964623262ee7a13 | [
"MIT"
] | 4 | 2016-10-08T02:51:41.000Z | 2017-12-05T02:02:40.000Z | # 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:
#
# ExConf.Repo.insert!(%ExConf.SomeModel{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fa... | 29 | 61 | 0.704023 |
859c297e00171c41d2b38ffffe734004c1a5ca0f | 343 | exs | Elixir | app/priv/repo/migrations/20200408150916_split_user_name.exs | nathanjohnson320/noodl | 2e449aab15b54fc5a1dc45ebf4b79e7b64b7c967 | [
"MIT"
] | 1 | 2021-01-20T20:00:50.000Z | 2021-01-20T20:00:50.000Z | app/priv/repo/migrations/20200408150916_split_user_name.exs | nathanjohnson320/noodl | 2e449aab15b54fc5a1dc45ebf4b79e7b64b7c967 | [
"MIT"
] | null | null | null | app/priv/repo/migrations/20200408150916_split_user_name.exs | nathanjohnson320/noodl | 2e449aab15b54fc5a1dc45ebf4b79e7b64b7c967 | [
"MIT"
] | null | null | null | defmodule Noodl.Repo.Migrations.SplitUserName do
use Ecto.Migration
def up do
alter table(:users) do
remove :name
add :firstname, :string
add :lastname, :string
end
end
def down do
alter table(:users) do
remove :firstname
remove :lastname, :string
add :name, :st... | 17.15 | 48 | 0.632653 |
859c30795f51eb5a3b63e91632cb5628d056dc17 | 1,587 | ex | Elixir | clients/web_security_scanner/lib/google_api/web_security_scanner/v1alpha/model/vulnerable_parameters.ex | mocknen/elixir-google-api | dac4877b5da2694eca6a0b07b3bd0e179e5f3b70 | [
"Apache-2.0"
] | null | null | null | clients/web_security_scanner/lib/google_api/web_security_scanner/v1alpha/model/vulnerable_parameters.ex | mocknen/elixir-google-api | dac4877b5da2694eca6a0b07b3bd0e179e5f3b70 | [
"Apache-2.0"
] | null | null | null | clients/web_security_scanner/lib/google_api/web_security_scanner/v1alpha/model/vulnerable_parameters.ex | mocknen/elixir-google-api | dac4877b5da2694eca6a0b07b3bd0e179e5f3b70 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 33.0625 | 95 | 0.759924 |
859c52d9df997ec02133d2c4638e20df81da708d | 599 | ex | Elixir | testData/org/elixir_lang/parser_definition/matched_dot_call_operation_parsing_test_case/DecimalWholeNumber.ex | keyno63/intellij-elixir | 4033e319992c53ddd42a683ee7123a97b5e34f02 | [
"Apache-2.0"
] | 1,668 | 2015-01-03T05:54:27.000Z | 2022-03-25T08:01:20.000Z | testData/org/elixir_lang/parser_definition/matched_dot_call_operation_parsing_test_case/DecimalWholeNumber.ex | keyno63/intellij-elixir | 4033e319992c53ddd42a683ee7123a97b5e34f02 | [
"Apache-2.0"
] | 2,018 | 2015-01-01T22:43:39.000Z | 2022-03-31T20:13:08.000Z | testData/org/elixir_lang/parser_definition/matched_dot_call_operation_parsing_test_case/DecimalWholeNumber.ex | keyno63/intellij-elixir | 4033e319992c53ddd42a683ee7123a97b5e34f02 | [
"Apache-2.0"
] | 145 | 2015-01-15T11:37:16.000Z | 2021-12-22T05:51:02.000Z | 1.()
1.(function positional, key: value)
1.(key_one: value_one, key_two: value_two)
1.(
&one,
one <- two,
one when two,
one | two,
one = two,
one or two,
one || two,
one and two,
one && two,
one != two,
one < two,
one |> two,
one in two,
one ++ two,
one..two,
one + two,
one ^^^ two,
... | 10.508772 | 42 | 0.497496 |
859c5d5ed290677478a000f7365d83bf9018f84c | 604 | exs | Elixir | test/bank_web/views/error_view_test.exs | oPauloChaves/elixir-checking-account-api | 1fb5d241b40ecbaf11bb4fcbdb5ccabafd635acd | [
"MIT"
] | 3 | 2017-10-16T14:35:46.000Z | 2017-12-13T22:35:43.000Z | test/bank_web/views/error_view_test.exs | oPauloChaves/elixir-checking-account-api | 1fb5d241b40ecbaf11bb4fcbdb5ccabafd635acd | [
"MIT"
] | null | null | null | test/bank_web/views/error_view_test.exs | oPauloChaves/elixir-checking-account-api | 1fb5d241b40ecbaf11bb4fcbdb5ccabafd635acd | [
"MIT"
] | null | null | null | defmodule BankWeb.ErrorViewTest do
use BankWeb.ConnCase, async: true
# Bring render/3 and render_to_string/3 for testing custom views
import Phoenix.View
test "renders 404.json" do
assert render(BankWeb.ErrorView, "404.json", []) ==
%{errors: %{detail: "Page not found"}}
end
test "render 5... | 27.454545 | 66 | 0.645695 |
859ca4d179c0a9f7548376889436f9d62fc502c9 | 9,825 | exs | Elixir | test/guardian/permissions/bitwise_test.exs | gestsol/guardian | ee173c7ff0343d77cf10c559bd11ac2c88804ad8 | [
"MIT"
] | null | null | null | test/guardian/permissions/bitwise_test.exs | gestsol/guardian | ee173c7ff0343d77cf10c559bd11ac2c88804ad8 | [
"MIT"
] | null | null | null | test/guardian/permissions/bitwise_test.exs | gestsol/guardian | ee173c7ff0343d77cf10c559bd11ac2c88804ad8 | [
"MIT"
] | null | null | null | defmodule Guardian.Permissions.BitwiseTest do
use ExUnit.Case, async: true
import Plug.Test
alias Guardian.Plug, as: GPlug
alias GPlug.Pipeline
alias Guardian.Permissions.Bitwise, as: GBits
defmodule Impl do
use Guardian,
otp_app: :guardian,
permissions: %{
user: [:read, :write],
... | 29.328358 | 90 | 0.588702 |
859cb4b53e5be6e22e9952568c79c2ec8bf5af96 | 73 | exs | Elixir | final-projects/shop_website/test/test_helper.exs | anitabenites/elixir-and-phoenix-mentoring-sessions | 0fa283a8d4a8884edd54c8e16d788e2ca65e4592 | [
"MIT"
] | 3 | 2019-07-31T20:06:34.000Z | 2021-11-16T11:19:45.000Z | final-projects/shop_website/test/test_helper.exs | anitabenites/elixir-and-phoenix-mentoring-sessions | 0fa283a8d4a8884edd54c8e16d788e2ca65e4592 | [
"MIT"
] | null | null | null | final-projects/shop_website/test/test_helper.exs | anitabenites/elixir-and-phoenix-mentoring-sessions | 0fa283a8d4a8884edd54c8e16d788e2ca65e4592 | [
"MIT"
] | 1 | 2019-07-31T16:46:14.000Z | 2019-07-31T16:46:14.000Z | ExUnit.start()
Ecto.Adapters.SQL.Sandbox.mode(ShopWebsite.Repo, :manual)
| 24.333333 | 57 | 0.794521 |
859cf2f1d30c7a8f1ce4a5bc82703856c4afcc1e | 100 | ex | Elixir | lib/sibt/repo.ex | amacgregor/sibt | 9819a9de4735612ee59de00f71ca1a6dfa275860 | [
"MIT"
] | null | null | null | lib/sibt/repo.ex | amacgregor/sibt | 9819a9de4735612ee59de00f71ca1a6dfa275860 | [
"MIT"
] | 2 | 2020-07-18T02:22:22.000Z | 2021-03-09T15:46:44.000Z | lib/sibt/repo.ex | amacgregor/shouldibuildthat | 572b0ba95f93f6ea0dc7b250baaa1bc90efd521b | [
"MIT"
] | null | null | null | defmodule Sibt.Repo do
use Ecto.Repo,
otp_app: :sibt,
adapter: Ecto.Adapters.Postgres
end
| 16.666667 | 35 | 0.71 |
859cfc199c6a14cfeb824234ae9270299cce398b | 554 | exs | Elixir | mix.exs | jesseshieh/towel | 4778ffb566f28ae077c073c9e0b78c06251406ab | [
"MIT"
] | null | null | null | mix.exs | jesseshieh/towel | 4778ffb566f28ae077c073c9e0b78c06251406ab | [
"MIT"
] | null | null | null | mix.exs | jesseshieh/towel | 4778ffb566f28ae077c073c9e0b78c06251406ab | [
"MIT"
] | null | null | null | defmodule Towel.Mixfile do
use Mix.Project
def project do
[app: :towel,
description: "A delightfully simple monad library that's written for Elixir.",
version: "0.2.1",
elixir: "~> 1.0",
package: package(),
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
... | 19.103448 | 83 | 0.595668 |
859d19b890509d2308c47713082e5439ea46b3ed | 1,473 | exs | Elixir | test/bitcoin/protocol/types/network_address_test.exs | coinscript/bitcoinsv-elixir | 2dda03c81edc5662743ed2922abb5b1910d9c09a | [
"Apache-2.0"
] | 2 | 2019-08-12T04:53:57.000Z | 2019-09-03T03:47:33.000Z | test/bitcoin/protocol/types/network_address_test.exs | coinscript/bitcoinsv-elixir | 2dda03c81edc5662743ed2922abb5b1910d9c09a | [
"Apache-2.0"
] | null | null | null | test/bitcoin/protocol/types/network_address_test.exs | coinscript/bitcoinsv-elixir | 2dda03c81edc5662743ed2922abb5b1910d9c09a | [
"Apache-2.0"
] | null | null | null | defmodule BitcoinTest.Protocol.Types.NetworkAddressTest do
use ExUnit.Case
alias Bitcoin.Protocol.Types.NetworkAddress
test "IPv4 Addresses w/o Time (for Version Message)" do
# - 1 (NODE_NETWORK service - see version message)
binary =
Base.decode16!(
# - IPv4: 10.0.0.1, IPv6: ::ffff:10.0.0... | 28.882353 | 76 | 0.602851 |
859d7dcddf7870f014e57cbc68add73bbf4178cb | 4,527 | exs | Elixir | test/credo/check/consistency/unused_variable_names_test.exs | rands0n/credo | c787a726ac7a521e21da5a098bd966af8862beb6 | [
"MIT"
] | 1 | 2021-12-27T01:30:05.000Z | 2021-12-27T01:30:05.000Z | test/credo/check/consistency/unused_variable_names_test.exs | rands0n/credo | c787a726ac7a521e21da5a098bd966af8862beb6 | [
"MIT"
] | null | null | null | test/credo/check/consistency/unused_variable_names_test.exs | rands0n/credo | c787a726ac7a521e21da5a098bd966af8862beb6 | [
"MIT"
] | null | null | null | defmodule Credo.Check.Consistency.UnusedVariableNamesTest do
use Credo.Test.Case
@described_check Credo.Check.Consistency.UnusedVariableNames
test "it should NOT report correct behaviour" do
[
"""
defmodule Credo.SampleOne do
defmodule Foo do
def bar(_, %{foo: foo} = _, _) do
... | 22.522388 | 102 | 0.515352 |
859d89bb3ae652ee6e9d930c900d92837af54c30 | 3,377 | ex | Elixir | deps/absinthe/lib/absinthe/phase/document/validation/known_argument_names.ex | JoakimEskils/elixir-absinthe | d81e24ec7c7b1164e6d152101dd50422f192d7e9 | [
"MIT"
] | 3 | 2017-06-22T16:33:58.000Z | 2021-07-07T15:21:09.000Z | lib/absinthe/phase/document/validation/known_argument_names.ex | bruce/absinthe | 19b63d3aaa9fb75aad01ffd5e91d89e0b30d7f91 | [
"MIT"
] | null | null | null | lib/absinthe/phase/document/validation/known_argument_names.ex | bruce/absinthe | 19b63d3aaa9fb75aad01ffd5e91d89e0b30d7f91 | [
"MIT"
] | null | null | null | defmodule Absinthe.Phase.Document.Validation.KnownArgumentNames do
@moduledoc false
# Validates document to ensure that all arguments are in the schema.
#
# Note: while graphql-js doesn't add errors to unknown arguments that
# are provided to unknown fields, Absinthe does -- but when the errors
# are harve... | 31.268519 | 92 | 0.674859 |
859dd71bdd69ac6c089f3871e7f6e94aab7fe2ed | 2,287 | exs | Elixir | lib/elixir/test/elixir/map_set_test.exs | Tica2/elixir | 6cf1dcbfe4572fc75619f05e40c10fd0844083ef | [
"Apache-2.0"
] | 1 | 2019-06-11T20:22:20.000Z | 2019-06-11T20:22:20.000Z | lib/elixir/test/elixir/map_set_test.exs | Tica2/elixir | 6cf1dcbfe4572fc75619f05e40c10fd0844083ef | [
"Apache-2.0"
] | null | null | null | lib/elixir/test/elixir/map_set_test.exs | Tica2/elixir | 6cf1dcbfe4572fc75619f05e40c10fd0844083ef | [
"Apache-2.0"
] | null | null | null | Code.require_file "test_helper.exs", __DIR__
defmodule MapSetTest do
use ExUnit.Case, async: true
alias MapSet, as: S
test "put" do
assert S.equal?(S.put(S.new, 1), make([1]))
assert S.equal?(S.put(make([1, 3, 4]), 2), make(1..4))
assert S.equal?(S.put(make(5..100), 10), make(5..100))
end
test... | 28.949367 | 77 | 0.593354 |
859dea2d004d5835022033365e5443eb215d920c | 2,112 | exs | Elixir | test/ex_twilio/url_generator_test.exs | john-griffin/ex_twilio | 75c018094fbfafdd140c9a90d6306b8d952c1a75 | [
"MIT"
] | null | null | null | test/ex_twilio/url_generator_test.exs | john-griffin/ex_twilio | 75c018094fbfafdd140c9a90d6306b8d952c1a75 | [
"MIT"
] | null | null | null | test/ex_twilio/url_generator_test.exs | john-griffin/ex_twilio | 75c018094fbfafdd140c9a90d6306b8d952c1a75 | [
"MIT"
] | null | null | null | defmodule ExTwilio.UrlGeneratorTest do
use ExUnit.Case
import ExTwilio.UrlGenerator
defmodule Resource do
defstruct sid: nil, name: nil
def resource_name, do: "Resources"
def resource_collection_name, do: "resources"
def parents, do: [:account, :sip_ip_access_control_list]
def children, do: ... | 34.064516 | 208 | 0.711174 |
859e257d854942c66688304bde2164af191cc8ba | 454 | ex | Elixir | lib/excommerce_web/helpers/form_helpers.ex | roger120981/planet | a662006551d11427c08cf6cdbacd37d377bcd9c5 | [
"MIT"
] | 1 | 2019-04-01T19:14:16.000Z | 2019-04-01T19:14:16.000Z | lib/excommerce_web/helpers/form_helpers.ex | roger120981/planet | a662006551d11427c08cf6cdbacd37d377bcd9c5 | [
"MIT"
] | null | null | null | lib/excommerce_web/helpers/form_helpers.ex | roger120981/planet | a662006551d11427c08cf6cdbacd37d377bcd9c5 | [
"MIT"
] | 1 | 2019-03-24T01:50:48.000Z | 2019-03-24T01:50:48.000Z | defmodule ExcommerceWeb.FormHelpers do
import Phoenix.HTML, only: [raw: 1]
import ExcommerceWeb.ErrorHelpers
def input_class(form, field) do
if form.errors[field] do
"form-control is-invalid"
else
"form-control"
end
end
def input_errors(form, field) do
if error = form.errors[fiel... | 19.73913 | 38 | 0.629956 |
859e6489263cce958bc7e009ae244e28ede9aa2b | 2,476 | exs | Elixir | apps/artemis/test/artemis/contexts/project/delete_project_test.exs | artemis-platform/artemis_teams | 9930c3d9528e37b76f0525390e32b66eed7eadde | [
"MIT"
] | 2 | 2020-04-23T02:29:18.000Z | 2020-07-07T13:13:17.000Z | apps/artemis/test/artemis/contexts/project/delete_project_test.exs | chrislaskey/artemis_teams | 9930c3d9528e37b76f0525390e32b66eed7eadde | [
"MIT"
] | 4 | 2020-04-26T20:35:36.000Z | 2020-11-10T22:13:19.000Z | apps/artemis/test/artemis/contexts/project/delete_project_test.exs | chrislaskey/artemis_teams | 9930c3d9528e37b76f0525390e32b66eed7eadde | [
"MIT"
] | null | null | null | defmodule Artemis.DeleteProjectTest do
use Artemis.DataCase
import Artemis.Factories
alias Artemis.Comment
alias Artemis.Project
alias Artemis.DeleteProject
describe "call!" do
test "raises an exception when id not found" do
invalid_id = 50_000_000
assert_raise Artemis.Context.Error, fn ... | 25.265306 | 110 | 0.642165 |
859e7b71a7e96a6e4838cd6b64927eb56474fe51 | 1,757 | ex | Elixir | clients/play_custom_app/lib/google_api/play_custom_app/v1/model/custom_app.ex | MasashiYokota/elixir-google-api | 975dccbff395c16afcb62e7a8e411fbb58e9ab01 | [
"Apache-2.0"
] | null | null | null | clients/play_custom_app/lib/google_api/play_custom_app/v1/model/custom_app.ex | MasashiYokota/elixir-google-api | 975dccbff395c16afcb62e7a8e411fbb58e9ab01 | [
"Apache-2.0"
] | 1 | 2020-12-18T09:25:12.000Z | 2020-12-18T09:25:12.000Z | clients/play_custom_app/lib/google_api/play_custom_app/v1/model/custom_app.ex | MasashiYokota/elixir-google-api | 975dccbff395c16afcb62e7a8e411fbb58e9ab01 | [
"Apache-2.0"
] | 1 | 2020-10-04T10:12:44.000Z | 2020-10-04T10:12:44.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 33.150943 | 148 | 0.712009 |
859e87379563573fbf23a75d0b30eda4022511d5 | 284 | exs | Elixir | test/hierbautberlin_web/views/layout_view_test.exs | gildesmarais/website-1 | 7a19bd98d06a064e52fa279e226002e9c3b986f0 | [
"MIT"
] | 13 | 2021-03-06T12:16:34.000Z | 2022-03-31T09:46:35.000Z | test/hierbautberlin_web/views/layout_view_test.exs | gildesmarais/website-1 | 7a19bd98d06a064e52fa279e226002e9c3b986f0 | [
"MIT"
] | 148 | 2021-03-05T12:44:55.000Z | 2022-03-11T12:09:06.000Z | test/hierbautberlin_web/views/layout_view_test.exs | gildesmarais/website-1 | 7a19bd98d06a064e52fa279e226002e9c3b986f0 | [
"MIT"
] | 2 | 2021-06-02T14:31:21.000Z | 2022-02-14T08:36:51.000Z | defmodule HierbautberlinWeb.LayoutViewTest do
use HierbautberlinWeb.ConnCase, async: true
# When testing helpers, you may want to import Phoenix.HTML and
# use functions such as safe_to_string() to convert the helper
# result into an HTML string.
# import Phoenix.HTML
end
| 31.555556 | 65 | 0.778169 |
859e9923789e2b8395b9ffa41f2490e6a7cbaf9e | 2,590 | ex | Elixir | lib/hex/api.ex | sudix/hex | f739a57d8829ea0b0f7759c164dc9149c3340e49 | [
"Apache-2.0"
] | null | null | null | lib/hex/api.ex | sudix/hex | f739a57d8829ea0b0f7759c164dc9149c3340e49 | [
"Apache-2.0"
] | 1 | 2021-06-25T15:19:59.000Z | 2021-06-25T15:19:59.000Z | lib/hex/api.ex | sudix/hex | f739a57d8829ea0b0f7759c164dc9149c3340e49 | [
"Apache-2.0"
] | null | null | null | defmodule Hex.API do
alias Hex.HTTP
@erlang_content 'application/vnd.hex+erlang'
@tar_content 'application/octet-stream'
@tar_chunk_size 10_000
@tar_timeout 60_000
def request(method, repo, path, opts \\ []) do
HTTP.request(method, url(repo, path), headers(opts), nil)
|> handle_response()
end
... | 25.392157 | 83 | 0.630888 |
859ea0821be5089092f0c74a55f85e019dc26588 | 4,435 | ex | Elixir | clients/search_console/lib/google_api/search_console/v1/model/index_status_inspection_result.ex | MMore/elixir-google-api | 0574ec1439d9bbfe22d63965be1681b0f45a94c9 | [
"Apache-2.0"
] | null | null | null | clients/search_console/lib/google_api/search_console/v1/model/index_status_inspection_result.ex | MMore/elixir-google-api | 0574ec1439d9bbfe22d63965be1681b0f45a94c9 | [
"Apache-2.0"
] | null | null | null | clients/search_console/lib/google_api/search_console/v1/model/index_status_inspection_result.ex | MMore/elixir-google-api | 0574ec1439d9bbfe22d63965be1681b0f45a94c9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 57.597403 | 286 | 0.708906 |
859eac5c1bd4462164e7d2d679427abb5585568b | 1,770 | ex | Elixir | lib/sue/db/poll.ex | alwayswimmin/Sue | 33dfd860e7d5b6dce11e2dc202924efad6a9474c | [
"MIT"
] | 1 | 2020-06-21T01:50:12.000Z | 2020-06-21T01:50:12.000Z | lib/sue/db/poll.ex | alwayswimmin/Sue | 33dfd860e7d5b6dce11e2dc202924efad6a9474c | [
"MIT"
] | null | null | null | lib/sue/db/poll.ex | alwayswimmin/Sue | 33dfd860e7d5b6dce11e2dc202924efad6a9474c | [
"MIT"
] | null | null | null | defmodule Sue.DB.Poll do
alias Sue.DB
alias Sue.Models.{Chat, Account}
def db_tables() do
[
{
:polls,
[
type: :set,
attributes: [:key, :val]
]
}
]
end
@spec set(Chat.t(), Map.t()) :: any()
def set(chat, poll), do: DB.set({:polls, chat, poll})... | 24.929577 | 79 | 0.531073 |
859eb8648d944d0f18a3b6c262b9595be1fdbd25 | 1,535 | exs | Elixir | test/codewars/sort_the_odd_test.exs | iccowan/Elixir | cc346493c0b24796fb07ad05de5b065ff132089e | [
"MIT"
] | 131 | 2019-10-28T19:44:55.000Z | 2022-03-27T21:48:48.000Z | test/codewars/sort_the_odd_test.exs | iccowan/Elixir | cc346493c0b24796fb07ad05de5b065ff132089e | [
"MIT"
] | 52 | 2021-08-09T22:40:20.000Z | 2022-03-07T16:56:36.000Z | test/codewars/sort_the_odd_test.exs | iccowan/Elixir | cc346493c0b24796fb07ad05de5b065ff132089e | [
"MIT"
] | 50 | 2019-11-17T16:59:04.000Z | 2022-03-23T00:16:51.000Z | defmodule Algorithms.CodeWars.SortTheOddTest do
alias Algorithms.CodeWars.SortTheOdd
use ExUnit.Case
doctest Algorithms
describe "sort_the_odd/1 - example test cases" do
test "example 1" do
assert SortTheOdd.sort_the_odd([7, 1]) === [1, 7]
end
test "example 2" do
assert SortTheOdd.sor... | 26.465517 | 91 | 0.51987 |
859ebb243a9fcc6b743e79fa9a362be11b9db500 | 230 | exs | Elixir | config/config.exs | cetinajero/tentacat | 486cebe6134033f87dd3ab9106b72765baf22581 | [
"MIT"
] | null | null | null | config/config.exs | cetinajero/tentacat | 486cebe6134033f87dd3ab9106b72765baf22581 | [
"MIT"
] | null | null | null | config/config.exs | cetinajero/tentacat | 486cebe6134033f87dd3ab9106b72765baf22581 | [
"MIT"
] | null | null | null | use Mix.Config
if Mix.env() == :test do
config :exvcr,
vcr_cassette_library_dir: "test/fixture/vcr_cassettes",
filter_sensitive_data: [
[pattern: "token [^\"]+", placeholder: "token yourtokencomeshere"]
]
end
| 23 | 72 | 0.673913 |
859ee4a1099e3baebe677fdb885d446ed120840a | 692,376 | ex | Elixir | clients/health_care/lib/google_api/health_care/v1beta1/api/projects.ex | Contractbook/elixir-google-api | 342751041aaf8c2e7f76f9922cf24b9c5895802b | [
"Apache-2.0"
] | null | null | null | clients/health_care/lib/google_api/health_care/v1beta1/api/projects.ex | Contractbook/elixir-google-api | 342751041aaf8c2e7f76f9922cf24b9c5895802b | [
"Apache-2.0"
] | null | null | null | clients/health_care/lib/google_api/health_care/v1beta1/api/projects.ex | Contractbook/elixir-google-api | 342751041aaf8c2e7f76f9922cf24b9c5895802b | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 52.812815 | 3,984 | 0.636094 |
859f0da38f6210005c9946de2babc651e2e35d5e | 69 | ex | Elixir | apps/rayyan_site/lib/rayyan_site_web/views/layout_view.ex | boqolo/boqolo | ba9a2ebcf379f5056b3836756179b49163f91d72 | [
"BSD-3-Clause"
] | null | null | null | apps/rayyan_site/lib/rayyan_site_web/views/layout_view.ex | boqolo/boqolo | ba9a2ebcf379f5056b3836756179b49163f91d72 | [
"BSD-3-Clause"
] | null | null | null | apps/rayyan_site/lib/rayyan_site_web/views/layout_view.ex | boqolo/boqolo | ba9a2ebcf379f5056b3836756179b49163f91d72 | [
"BSD-3-Clause"
] | null | null | null | defmodule RayyanSiteWeb.LayoutView do
use RayyanSiteWeb, :view
end
| 17.25 | 37 | 0.826087 |
859f21fc2979d2baedd54a6cf860634f2a12f2f9 | 623 | ex | Elixir | test/support/atomex_case.ex | tcitworld/atomex | 3b1dcc2bf634945b82936bc82cf1ecbf92793e2e | [
"MIT"
] | 32 | 2018-02-08T07:36:11.000Z | 2022-01-31T03:51:01.000Z | test/support/atomex_case.ex | tcitworld/atomex | 3b1dcc2bf634945b82936bc82cf1ecbf92793e2e | [
"MIT"
] | 42 | 2019-11-24T19:18:16.000Z | 2021-08-03T04:35:41.000Z | test/support/atomex_case.ex | tcitworld/atomex | 3b1dcc2bf634945b82936bc82cf1ecbf92793e2e | [
"MIT"
] | 3 | 2018-10-18T17:34:13.000Z | 2021-11-07T20:55:26.000Z | defmodule Atomex.TestCase do
@moduledoc """
Common test utils for Atomex
"""
use ExUnit.CaseTemplate
using do
quote do
require Logger
alias Atomex
alias Atomex.{Feed, Entry}
@last_update_date ~N[2016-05-24 13:26:08.003]
def test_feed do
Feed.new(
"https:/... | 21.482759 | 97 | 0.605136 |
859f526764a58dc1e93c7bceca004ab6cd29c387 | 13,495 | ex | Elixir | lib/plug/cowboy.ex | wojtekmach/plug_cowboy | 45edb6ea83a854eaee7a9f88d8499599439f937a | [
"Apache-2.0"
] | null | null | null | lib/plug/cowboy.ex | wojtekmach/plug_cowboy | 45edb6ea83a854eaee7a9f88d8499599439f937a | [
"Apache-2.0"
] | null | null | null | lib/plug/cowboy.ex | wojtekmach/plug_cowboy | 45edb6ea83a854eaee7a9f88d8499599439f937a | [
"Apache-2.0"
] | null | null | null | defmodule Plug.Cowboy do
@moduledoc """
Adapter interface to the Cowboy2 webserver.
## Options
* `:net` - If using `:inet` (IPv4 only - the default) or `:inet6` (IPv6)
* `:ip` - the ip to bind the server to.
Must be either a tuple in the format `{a, b, c, d}` with each value in `0..255` for IPv4,... | 33.7375 | 114 | 0.666914 |
859f56e621e8a123263bac4d80a54b5ad685c229 | 765 | ex | Elixir | lib/ash/resource/transformers/validate_action_types_supported.ex | elbow-jason/ash | eb63bc9d4d24187ad07d9892088b4e55ad6258e4 | [
"MIT"
] | 1 | 2021-12-27T09:43:29.000Z | 2021-12-27T09:43:29.000Z | lib/ash/resource/transformers/validate_action_types_supported.ex | elbow-jason/ash | eb63bc9d4d24187ad07d9892088b4e55ad6258e4 | [
"MIT"
] | null | null | null | lib/ash/resource/transformers/validate_action_types_supported.ex | elbow-jason/ash | eb63bc9d4d24187ad07d9892088b4e55ad6258e4 | [
"MIT"
] | null | null | null | defmodule Ash.Resource.Transformers.ValidateActionTypesSupported do
@moduledoc """
Confirms that all action types declared on a resource are supported by its data layer
"""
use Ash.Dsl.Transformer
alias Ash.Dsl.Transformer
alias Ash.Error.Dsl.DslError
def transform(resource, dsl_state) do
dsl_state
... | 28.333333 | 105 | 0.661438 |
859f8a85202a385d5d93866b226c7dfb9bea36a9 | 5,622 | exs | Elixir | test/sanbase_web/graphql/metric/api_metric_timeseries_data_per_slug_test.exs | santiment/sanbase2 | 9ef6e2dd1e377744a6d2bba570ea6bd477a1db31 | [
"MIT"
] | 81 | 2017-11-20T01:20:22.000Z | 2022-03-05T12:04:25.000Z | test/sanbase_web/graphql/metric/api_metric_timeseries_data_per_slug_test.exs | rmoorman/sanbase2 | 226784ab43a24219e7332c49156b198d09a6dd85 | [
"MIT"
] | 359 | 2017-10-15T14:40:53.000Z | 2022-01-25T13:34:20.000Z | test/sanbase_web/graphql/metric/api_metric_timeseries_data_per_slug_test.exs | rmoorman/sanbase2 | 226784ab43a24219e7332c49156b198d09a6dd85 | [
"MIT"
] | 16 | 2017-11-19T13:57:40.000Z | 2022-02-07T08:13:02.000Z | defmodule SanbaseWeb.Graphql.ApiMetricTimeseriesDataPerSlugTest do
use SanbaseWeb.ConnCase, async: false
import Mock
import Sanbase.Factory
import SanbaseWeb.Graphql.TestHelpers
setup do
%{user: user} = insert(:subscription_pro_sanbase, user: insert(:user))
project1 = insert(:random_project, slug: "... | 30.89011 | 186 | 0.588758 |
859fa164fffabf36e9eb8cec546ec34bb9c00de6 | 2,004 | ex | Elixir | day19/lib/day19.ex | bjorng/advent-of-code-2017 | bd58a36864a4d82809253770f8a6d0c4e02cb59a | [
"Apache-2.0"
] | null | null | null | day19/lib/day19.ex | bjorng/advent-of-code-2017 | bd58a36864a4d82809253770f8a6d0c4e02cb59a | [
"Apache-2.0"
] | null | null | null | day19/lib/day19.ex | bjorng/advent-of-code-2017 | bd58a36864a4d82809253770f8a6d0c4e02cb59a | [
"Apache-2.0"
] | null | null | null | defmodule Day19 do
def part1(input) do
{pos, width, grid} = parse(input)
move(:down, pos, grid, width, [])
end
def part2(input) do
{pos, width, grid} = parse(input)
move_count(:down, pos, grid, width, 0)
end
defp move(dir, {x, y}, grid, width, seen) do
case :binary.at(grid, x + y * width... | 28.225352 | 79 | 0.510479 |
859fb2fba4246abd82b169b0c111a96d395577c3 | 8,493 | ex | Elixir | lib/falcon_plus_api/api/hostgroup.ex | sawater/falcon-plus-api | a41b1cc04cc0d71b72341e803de88d16b4bba77d | [
"Apache-2.0"
] | 2 | 2018-05-03T14:35:37.000Z | 2018-07-30T09:32:38.000Z | lib/falcon_plus_api/api/hostgroup.ex | mon-suit/falcon-plus-api | a41b1cc04cc0d71b72341e803de88d16b4bba77d | [
"Apache-2.0"
] | null | null | null | lib/falcon_plus_api/api/hostgroup.ex | mon-suit/falcon-plus-api | a41b1cc04cc0d71b72341e803de88d16b4bba77d | [
"Apache-2.0"
] | null | null | null | defmodule FalconPlusApi.Api.Hostgroup do
alias Maxwell.Conn
alias FalconPlusApi.{Util, Sig, Api}
@doc """
* [Session](#/authentication) Required
* Hosts 每次会覆盖该HostGroup内现有的Host List
* 如果使用者不是 Admin 只能对创建的hostgroup做操作
### Request
```{
"hosts": [
"testhostgroup",
"agen... | 20.867322 | 79 | 0.471565 |
859fbd6dc9eaf7e459c66d4bd0e11c674dd98a08 | 271 | exs | Elixir | apps/core/priv/prm_repo/migrations/20190221203900_update_uniq_index_registries_ukr_med.exs | ehealth-ua/ehealth.api | 4ffe26a464fe40c95fb841a4aa2e147068f65ca2 | [
"Apache-2.0"
] | 8 | 2019-06-14T11:34:49.000Z | 2021-08-05T19:14:24.000Z | apps/core/priv/prm_repo/migrations/20190221203900_update_uniq_index_registries_ukr_med.exs | edenlabllc/ehealth.api.public | 4ffe26a464fe40c95fb841a4aa2e147068f65ca2 | [
"Apache-2.0"
] | 1 | 2019-07-08T15:20:22.000Z | 2019-07-08T15:20:22.000Z | apps/core/priv/prm_repo/migrations/20190221203900_update_uniq_index_registries_ukr_med.exs | ehealth-ua/ehealth.api | 4ffe26a464fe40c95fb841a4aa2e147068f65ca2 | [
"Apache-2.0"
] | 6 | 2018-05-11T13:59:32.000Z | 2022-01-19T20:15:22.000Z | defmodule Core.PRMRepo.Migrations.CreatePRM.Registries.UkrMedRegistryIndexes do
use Ecto.Migration
def change do
drop_if_exists(unique_index(:ukr_med_registries, [:edrpou]))
create_if_not_exists(unique_index(:ukr_med_registries, [:edrpou, :type]))
end
end
| 30.111111 | 79 | 0.793358 |
859fc6ba9b458f5d4b2235449879cf9a67505958 | 1,963 | ex | Elixir | lib/Expt/Vector.ex | M47CH4N/expt | c38412dab7bb412957e2b2fdb40636f88d357c40 | [
"MIT"
] | null | null | null | lib/Expt/Vector.ex | M47CH4N/expt | c38412dab7bb412957e2b2fdb40636f88d357c40 | [
"MIT"
] | null | null | null | lib/Expt/Vector.ex | M47CH4N/expt | c38412dab7bb412957e2b2fdb40636f88d357c40 | [
"MIT"
] | null | null | null | defmodule Expt.Vector do
import Kernel, except: [+: 2, -: 2, *: 2, /: 2]
defmacro __using__(_opts) do
quote do
import Kernel, except: [+: 2, -: 2, *: 2, /: 2]
import Expt.Vector
end
end
def a + b
when is_number(a) and is_number(b) do
Kernel.+(a, b)
end
def ({x1, y1, z1} = v1) ... | 22.05618 | 58 | 0.517575 |
859fddfe80605980bd46e7b3a679af2c591ef6fa | 2,033 | ex | Elixir | clients/video_intelligence/lib/google_api/video_intelligence/v1/model/google_cloud_videointelligence_v1p1beta1__entity.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2021-10-01T09:20:41.000Z | 2021-10-01T09:20:41.000Z | clients/video_intelligence/lib/google_api/video_intelligence/v1/model/google_cloud_videointelligence_v1p1beta1__entity.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2020-08-18T00:11:23.000Z | 2020-08-18T00:44:16.000Z | clients/video_intelligence/lib/google_api/video_intelligence/v1/model/google_cloud_videointelligence_v1p1beta1__entity.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 35.051724 | 189 | 0.726513 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.