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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c83e99a73761fd8a3c86b6749bb5481248ec0cef | 462 | ex | Elixir | apps/artemis/lib/artemis/helpers/time.ex | chrislaskey/atlas_platform | 969aea95814f62d3471f93000ee5ad77edb9d1bf | [
"MIT"
] | 10 | 2019-07-05T19:59:20.000Z | 2021-05-23T07:36:11.000Z | apps/artemis/lib/artemis/helpers/time.ex | chrislaskey/atlas_platform | 969aea95814f62d3471f93000ee5ad77edb9d1bf | [
"MIT"
] | 3 | 2019-03-05T23:55:09.000Z | 2019-05-29T13:46:34.000Z | apps/artemis/lib/artemis/helpers/time.ex | chrislaskey/atlas_platform | 969aea95814f62d3471f93000ee5ad77edb9d1bf | [
"MIT"
] | 4 | 2019-07-05T20:04:08.000Z | 2021-05-13T16:28:33.000Z | defmodule Artemis.Helpers.Time do
@doc """
Return milliseconds from given time. If a time is not passed, current
timestamp is used.
"""
def get_milliseconds_to_next_minute(time \\ nil) do
start = time || Timex.now()
next_minute =
start
|> Timex.shift(minutes: 1)
|> Map.put(:second, ... | 22 | 71 | 0.625541 |
c83f1af78c866462f3ef6fed1d5663ddaecbffc6 | 6,082 | ex | Elixir | lib/esbuild.ex | krushi123/esbuild | b1fffb32a35cae166911b61b469f2a5675fee04d | [
"MIT"
] | null | null | null | lib/esbuild.ex | krushi123/esbuild | b1fffb32a35cae166911b61b469f2a5675fee04d | [
"MIT"
] | null | null | null | lib/esbuild.ex | krushi123/esbuild | b1fffb32a35cae166911b61b469f2a5675fee04d | [
"MIT"
] | null | null | null | defmodule Esbuild do
@moduledoc """
Esbuild is a installer and runner for [esbuild](https://github.com/evanw/esbuild/).
## Profiles
You can define multiple esbuild profiles. By default, there is a
profile called `:default` which you can configure its args, current
directory and environment:
config ... | 26.443478 | 94 | 0.608188 |
c83f45670584085947fbb0ef0f6f2f583bdba286 | 691 | ex | Elixir | lib/hexpm/repository/release_retirement.ex | axelson/hexpm | 3608a9aa16d321f8f7d0890528676c0821d85686 | [
"Apache-2.0"
] | 2 | 2020-03-01T18:23:33.000Z | 2021-01-15T10:15:45.000Z | lib/hexpm/repository/release_retirement.ex | axelson/hexpm | 3608a9aa16d321f8f7d0890528676c0821d85686 | [
"Apache-2.0"
] | 3 | 2020-06-30T11:24:41.000Z | 2020-08-05T15:47:34.000Z | lib/hexpm/repository/release_retirement.ex | axelson/hexpm | 3608a9aa16d321f8f7d0890528676c0821d85686 | [
"Apache-2.0"
] | null | null | null | defmodule Hexpm.Repository.ReleaseRetirement do
use Hexpm.Schema
@derive HexpmWeb.Stale
embedded_schema do
field :reason, :string
field :message, :string
end
@reasons ~w(other invalid security deprecated renamed)
def changeset(meta, params) do
cast(meta, params, ~w(reason message)a)
|> v... | 26.576923 | 56 | 0.704776 |
c83f746ea7c70cf2b9391e54dc190e6ab9489e87 | 2,719 | ex | Elixir | clients/compute/lib/google_api/compute/v1/model/region_instance_groups_list_instances.ex | nuxlli/elixir-google-api | ecb8679ac7282b7dd314c3e20c250710ec6a7870 | [
"Apache-2.0"
] | null | null | null | clients/compute/lib/google_api/compute/v1/model/region_instance_groups_list_instances.ex | nuxlli/elixir-google-api | ecb8679ac7282b7dd314c3e20c250710ec6a7870 | [
"Apache-2.0"
] | null | null | null | clients/compute/lib/google_api/compute/v1/model/region_instance_groups_list_instances.ex | nuxlli/elixir-google-api | ecb8679ac7282b7dd314c3e20c250710ec6a7870 | [
"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... | 43.15873 | 381 | 0.742185 |
c83f7508e82e6f11b9ee6025bcd34fc7a5590325 | 6,238 | ex | Elixir | lib/groupher_server_web/schema/Helper/fields.ex | mydearxym/mastani_server | f24034a4a5449200165cf4a547964a0961793eab | [
"Apache-2.0"
] | 2 | 2018-03-26T08:56:21.000Z | 2018-07-02T22:34:51.000Z | lib/groupher_server_web/schema/Helper/fields.ex | mydearxym/mastani_server | f24034a4a5449200165cf4a547964a0961793eab | [
"Apache-2.0"
] | 22 | 2018-03-21T03:40:50.000Z | 2018-07-10T06:33:10.000Z | lib/groupher_server_web/schema/Helper/fields.ex | mydearxym/mastani_server | f24034a4a5449200165cf4a547964a0961793eab | [
"Apache-2.0"
] | null | null | null | defmodule GroupherServerWeb.Schema.Helper.Fields do
@moduledoc """
general fields used in GraphQL schema definition
"""
import Helper.Utils, only: [get_config: 2, plural: 1]
import Absinthe.Resolution.Helpers, only: [dataloader: 2]
alias GroupherServer.CMS
@page_size get_config(:general, :page_size)
... | 24.178295 | 91 | 0.635781 |
c83f818a3d15c696794c05c4bdca2e0cab3e18f4 | 545 | exs | Elixir | elixir_in_action/ch05_concurrency_primitives/todo_server_runner.exs | shivam-tripathi/learningElixir | 195af962dcd239230afd7732b88e577f26fc1eff | [
"MIT"
] | null | null | null | elixir_in_action/ch05_concurrency_primitives/todo_server_runner.exs | shivam-tripathi/learningElixir | 195af962dcd239230afd7732b88e577f26fc1eff | [
"MIT"
] | null | null | null | elixir_in_action/ch05_concurrency_primitives/todo_server_runner.exs | shivam-tripathi/learningElixir | 195af962dcd239230afd7732b88e577f26fc1eff | [
"MIT"
] | null | null | null | Code.load_file("todo_server.exs", ".")
todo_server = TodoServer.start()
todo_server
|> TodoServer.add_entry(%{date: ~D[2022-05-01], title: "office"})
|> TodoServer.add_entry(%{date: ~D[2022-05-01], title: "drink water"})
|> TodoServer.add_entry(%{date: ~D[2022-05-01], title: "study"})
|> TodoServer.add_entry(%{date: ... | 38.928571 | 70 | 0.693578 |
c83fb5e17873a122ac441d966f01b227b5c525fc | 1,944 | exs | Elixir | test/changelog/policies/episode_test.exs | PsOverflow/changelog.com | 53f4ecfc39b021c6b8cfcc0fa11f29aff8038a7f | [
"MIT"
] | 1 | 2021-03-14T21:12:49.000Z | 2021-03-14T21:12:49.000Z | test/changelog/policies/episode_test.exs | type1fool/changelog.com | fbec3528cc3f5adfdc75b008bb92b17efc4f248f | [
"MIT"
] | null | null | null | test/changelog/policies/episode_test.exs | type1fool/changelog.com | fbec3528cc3f5adfdc75b008bb92b17efc4f248f | [
"MIT"
] | 1 | 2018-10-03T20:55:52.000Z | 2018-10-03T20:55:52.000Z | defmodule Changelog.Policies.EpisodeTest do
use Changelog.PolicyCase
alias Changelog.Policies
test "only admins and podcast hosts can new/create" do
refute Policies.Episode.create(@guest, %{})
refute Policies.Episode.new(@user, %{})
refute Policies.Episode.new(@editor, %{})
refute Policies.Episo... | 37.384615 | 60 | 0.666152 |
c83fc4550c9e1c9cab1c43066d7dccc4eb880b34 | 473 | ex | Elixir | lib/conduit/blog/projections/comment.ex | rudyyazdi/conduit | 8defa60962482fb81f5093ea5d58b71a160db3c4 | [
"MIT"
] | null | null | null | lib/conduit/blog/projections/comment.ex | rudyyazdi/conduit | 8defa60962482fb81f5093ea5d58b71a160db3c4 | [
"MIT"
] | 2 | 2022-01-15T02:09:30.000Z | 2022-01-22T10:18:43.000Z | lib/conduit/blog/projections/comment.ex | rudyyazdi/conduit | 8defa60962482fb81f5093ea5d58b71a160db3c4 | [
"MIT"
] | null | null | null | defmodule Conduit.Blog.Projections.Comment do
use Ecto.Schema
@primary_key {:uuid, :binary_id, autogenerate: false}
@timestamps_opts [type: :utc_datetime_usec]
schema "blog_comments" do
field(:body, :string)
field(:article_uuid, :binary_id)
field(:author_uuid, :binary_id)
field(:author_bio, ... | 24.894737 | 55 | 0.712474 |
c83fd5d5334fcf23f17f67b449a244ae3dafe762 | 720 | exs | Elixir | mix.exs | khattori/ex_msgpax | 74db817ea4b6e35b7cc0fb47b4dfaa758814e6b6 | [
"MIT"
] | 2 | 2020-02-09T22:53:13.000Z | 2020-04-18T15:11:05.000Z | mix.exs | khattori/ex_msgpax | 74db817ea4b6e35b7cc0fb47b4dfaa758814e6b6 | [
"MIT"
] | null | null | null | mix.exs | khattori/ex_msgpax | 74db817ea4b6e35b7cc0fb47b4dfaa758814e6b6 | [
"MIT"
] | null | null | null | defmodule ExMsgpax.MixProject do
use Mix.Project
def project do
[
app: :ex_msgpax,
version: "0.1.0",
elixir: "~> 1.12",
start_permanent: Mix.env() == :prod,
deps: deps(),
test_coverage: [tool: ExCoveralls]
]
end
# Run "mix help compile.app" to learn about applicatio... | 21.818182 | 87 | 0.558333 |
c840093d121c6d3f542867ef3705739f11138a9e | 1,685 | exs | Elixir | test/memorized_vocabulary_test.exs | waltercompanies/linguist | 1d75d489561fc6c67f0c1aa89801ab57742bfc19 | [
"MIT"
] | null | null | null | test/memorized_vocabulary_test.exs | waltercompanies/linguist | 1d75d489561fc6c67f0c1aa89801ab57742bfc19 | [
"MIT"
] | null | null | null | test/memorized_vocabulary_test.exs | waltercompanies/linguist | 1d75d489561fc6c67f0c1aa89801ab57742bfc19 | [
"MIT"
] | null | null | null | defmodule MemorizedVocabularyTest do
use ExUnit.Case
setup do
Linguist.MemorizedVocabulary.locale("nl", Path.join([__DIR__, "nl.yml"]))
Linguist.MemorizedVocabulary.locale("fr-FR", Path.join([__DIR__, "fr-FR.yml"]))
:ok
end
test "locales() returns locales" do
assert ["fr-FR", "nl"] == Linguist... | 31.203704 | 96 | 0.670623 |
c84012cd119ed4796abebcdb52018e2e4ba3059a | 42 | exs | Elixir | test/test_helper.exs | dpeccia/CarpinchoMQ | 7244e5dc59963a1614f8b17ed268c207a06687fe | [
"Unlicense"
] | null | null | null | test/test_helper.exs | dpeccia/CarpinchoMQ | 7244e5dc59963a1614f8b17ed268c207a06687fe | [
"Unlicense"
] | 33 | 2021-10-31T21:23:58.000Z | 2021-12-10T21:40:39.000Z | test/test_helper.exs | dpeccia/CarpinchoMQ | 7244e5dc59963a1614f8b17ed268c207a06687fe | [
"Unlicense"
] | null | null | null | :ok = LocalCluster.start()
ExUnit.start()
| 14 | 26 | 0.714286 |
c8401fc3b4ab44184b0f9e262e1e7ee841a3bc3d | 4,596 | ex | Elixir | apps/re/lib/exporters/facebook_ads/product.ex | ruby2elixir/emcasa-backend | 70d7f4f233555417941ffa6ada84cf8740c21dd2 | [
"MIT"
] | 4 | 2019-11-01T16:29:31.000Z | 2020-10-10T21:20:12.000Z | apps/re/lib/exporters/facebook_ads/product.ex | caspg/backend | 34df9dc14ab8ed75de4578fefa2e087580c7e867 | [
"MIT"
] | null | null | null | apps/re/lib/exporters/facebook_ads/product.ex | caspg/backend | 34df9dc14ab8ed75de4578fefa2e087580c7e867 | [
"MIT"
] | 5 | 2019-11-04T21:25:45.000Z | 2020-02-13T23:49:36.000Z | defmodule Re.Exporters.FacebookAds.Product do
@moduledoc """
Listing XML exporter for Facebook Dynamic Product Ads
https://developers.facebook.com/docs/marketing-api/dynamic-product-ads/product-catalog
"""
@exported_attributes ~w(id url title availability condition brand description price
listing_type stre... | 25.114754 | 88 | 0.657963 |
c840201988340118b8ebc714a860017dffca6618 | 4,609 | ex | Elixir | lib/yacto/repo.ex | pumbaacave/yacto | 6bb98a7d156ff49aa18756b6cf7ce9d1ee89bf23 | [
"Apache-2.0"
] | null | null | null | lib/yacto/repo.ex | pumbaacave/yacto | 6bb98a7d156ff49aa18756b6cf7ce9d1ee89bf23 | [
"Apache-2.0"
] | null | null | null | lib/yacto/repo.ex | pumbaacave/yacto | 6bb98a7d156ff49aa18756b6cf7ce9d1ee89bf23 | [
"Apache-2.0"
] | null | null | null | defmodule Yacto.Repo.Helper.Helper do
# this module is copied from Ecto.Repo.Queryable
@moduledoc false
require Ecto.Query
# defp field(ix, field) when is_integer(ix) and is_atom(field) do
# {{:., [], [{:&, [], [ix]}, field]}, [], []}
# end
defp assert_schema!(%{from: {_source, schema}}) when schema !... | 30.523179 | 102 | 0.615101 |
c8403339ea22c099529c721223ca0c5734793902 | 64,944 | ex | Elixir | lib/nimble_parsec.ex | sthagen/dashbitco-nimble_parsec | fd7f4ef3d286257cfd018708624cf17886494d71 | [
"Apache-2.0"
] | null | null | null | lib/nimble_parsec.ex | sthagen/dashbitco-nimble_parsec | fd7f4ef3d286257cfd018708624cf17886494d71 | [
"Apache-2.0"
] | null | null | null | lib/nimble_parsec.ex | sthagen/dashbitco-nimble_parsec | fd7f4ef3d286257cfd018708624cf17886494d71 | [
"Apache-2.0"
] | null | null | null | defmodule NimbleParsec do
@moduledoc "README.md"
|> File.read!()
|> String.split("<!-- MDOC !-->")
|> Enum.fetch!(1)
defmacrop is_combinator(combinator) do
quote do
is_list(unquote(combinator))
end
end
@doc """
Defines a parser (and a combinator) with the... | 31.480368 | 146 | 0.633977 |
c8405b3ce3ddd91ea02dd90d02d92289441e06cd | 1,991 | ex | Elixir | clients/vision/lib/google_api/vision/v1/model/google_cloud_vision_v1p3beta1_color_info.ex | MasashiYokota/elixir-google-api | 975dccbff395c16afcb62e7a8e411fbb58e9ab01 | [
"Apache-2.0"
] | null | null | null | clients/vision/lib/google_api/vision/v1/model/google_cloud_vision_v1p3beta1_color_info.ex | MasashiYokota/elixir-google-api | 975dccbff395c16afcb62e7a8e411fbb58e9ab01 | [
"Apache-2.0"
] | 1 | 2020-12-18T09:25:12.000Z | 2020-12-18T09:25:12.000Z | clients/vision/lib/google_api/vision/v1/model/google_cloud_vision_v1p3beta1_color_info.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... | 37.566038 | 141 | 0.724761 |
c8408155f6e2fe425fe0c4ac1f02f841e0bbec43 | 1,218 | exs | Elixir | test/acceptance/ntriples_star_w3c_test.exs | marcelotto/rdf-ex | 12adce69eb2dbff027cbc83aaaf912067aea1b02 | [
"MIT"
] | 53 | 2017-06-25T22:20:44.000Z | 2020-04-27T17:27:51.000Z | test/acceptance/ntriples_star_w3c_test.exs | marcelotto/rdf-ex | 12adce69eb2dbff027cbc83aaaf912067aea1b02 | [
"MIT"
] | 7 | 2017-06-25T00:29:11.000Z | 2020-03-11T00:23:47.000Z | test/acceptance/ntriples_star_w3c_test.exs | marcelotto/rdf-ex | 12adce69eb2dbff027cbc83aaaf912067aea1b02 | [
"MIT"
] | 2 | 2018-01-19T15:48:27.000Z | 2020-03-01T00:29:35.000Z | defmodule RDF.Star.NTriples.W3C.TestSuite do
@moduledoc """
The official RDF-star N-Triples Test Suite.
from <https://w3c.github.io/rdf-star/tests/nt/syntax/>
"""
use ExUnit.Case, async: false
use EarlFormatter, test_suite: :ntriples_star
alias RDF.{TestSuite, NTriples}
alias TestSuite.NS.RDFT
@pa... | 29 | 83 | 0.661741 |
c84090cc91a85b60d2a058025ba7a742725b2e43 | 519 | ex | Elixir | lib/real_world_web/views/profile_view.ex | zoosky/elixir-phoenix-realworld-example-app | 8620fb2829703051cdbd032f93be6cd941c4810e | [
"MIT"
] | 909 | 2017-11-16T08:41:08.000Z | 2022-03-31T21:59:17.000Z | lib/real_world_web/views/profile_view.ex | zoosky/elixir-phoenix-realworld-example-app | 8620fb2829703051cdbd032f93be6cd941c4810e | [
"MIT"
] | 36 | 2017-11-28T01:31:05.000Z | 2021-12-15T05:03:00.000Z | lib/real_world_web/views/profile_view.ex | zoosky/elixir-phoenix-realworld-example-app | 8620fb2829703051cdbd032f93be6cd941c4810e | [
"MIT"
] | 160 | 2017-11-16T06:00:37.000Z | 2022-01-20T13:50:42.000Z | defmodule RealWorldWeb.ProfileView do
use RealWorldWeb, :view
alias RealWorldWeb.{ProfileView, FormatHelpers}
def render("show.json", %{user: user, following: following}) do
%{profile: render_one(user, ProfileView, "profile.json", following: following)}
end
def render("profile.json", %{profile: profile,... | 30.529412 | 83 | 0.695568 |
c840ab11b64f9d2c905cc5fa8450b5a5a7e6058f | 4,131 | exs | Elixir | test/livebook_web/controllers/session_controller_test.exs | keywire/livebook | f22bf2a21d077e4127829ebe5b6477390f9ae283 | [
"Apache-2.0"
] | null | null | null | test/livebook_web/controllers/session_controller_test.exs | keywire/livebook | f22bf2a21d077e4127829ebe5b6477390f9ae283 | [
"Apache-2.0"
] | null | null | null | test/livebook_web/controllers/session_controller_test.exs | keywire/livebook | f22bf2a21d077e4127829ebe5b6477390f9ae283 | [
"Apache-2.0"
] | null | null | null | defmodule LivebookWeb.SessionControllerTest do
use LivebookWeb.ConnCase, async: true
alias Livebook.{SessionSupervisor, Session, Notebook}
describe "show_image" do
test "returns not found when the given session does not exist", %{conn: conn} do
conn = get(conn, Routes.session_path(conn, :show_image, "... | 30.828358 | 96 | 0.599129 |
c840c6aeb2d1c85b1ea51370de31124081057eb8 | 2,275 | exs | Elixir | test/atr_test.exs | ElixirTradingTools/trade-indicators | 05bc3c28c30eaa73c59858dbf1ee62525ccbbf48 | [
"MIT"
] | 12 | 2021-04-06T17:57:55.000Z | 2021-12-19T03:04:39.000Z | test/atr_test.exs | ElixirTradingTools/trade-indicators | 05bc3c28c30eaa73c59858dbf1ee62525ccbbf48 | [
"MIT"
] | null | null | null | test/atr_test.exs | ElixirTradingTools/trade-indicators | 05bc3c28c30eaa73c59858dbf1ee62525ccbbf48 | [
"MIT"
] | 2 | 2021-04-07T19:46:12.000Z | 2021-07-10T07:43:12.000Z | defmodule TradeIndicators.Tests.ATR do
use ExUnit.Case
alias TradeIndicators.Util, as: U
alias TradeIndicators.ATR
alias Enum, as: E
@msft_data TradeIndicators.Tests.Fixtures.get(:msft_m1_2020_07_27)
@tr [0.21, 0.18, 0.31, 0.15, 0.20, 0.15, 0.28, 0.20, 0.19, 0.17] ++
[0.23, 0.37, 0.21, 0.16, 0.29, ... | 35 | 76 | 0.48 |
c840e0f81c2282520ea7c46637de29150f99ed2d | 78 | ex | Elixir | lib/dustbin/scheduler.ex | saulecabrera/dustbin | 6f862d35d4584acda1e082fad278a7c23dc9598b | [
"MIT"
] | null | null | null | lib/dustbin/scheduler.ex | saulecabrera/dustbin | 6f862d35d4584acda1e082fad278a7c23dc9598b | [
"MIT"
] | 7 | 2017-02-01T00:17:57.000Z | 2017-04-17T13:40:04.000Z | lib/dustbin/scheduler.ex | saulecabrera/dustbin | 6f862d35d4584acda1e082fad278a7c23dc9598b | [
"MIT"
] | null | null | null | defmodule Dustbin.Scheduler do
use Quantum.Scheduler, otp_app: :dustbin
end
| 19.5 | 42 | 0.807692 |
c840ed2727349c678dfe9119bff370cfa07a0a24 | 446 | exs | Elixir | config/dev.exs | dustinrouillard/lanyard-redis | c1bed07df9501c5d8c2373741088b824c3b61331 | [
"MIT"
] | null | null | null | config/dev.exs | dustinrouillard/lanyard-redis | c1bed07df9501c5d8c2373741088b824c3b61331 | [
"MIT"
] | null | null | null | config/dev.exs | dustinrouillard/lanyard-redis | c1bed07df9501c5d8c2373741088b824c3b61331 | [
"MIT"
] | null | null | null | use Mix.Config
config :lanyard,
http_port: String.to_integer(System.get_env("PORT") || "4001"),
discord_spotify_activity_id: "spotify:1",
command_prefix: System.get_env("COMMAND_PREFIX") || ".",
bot_presence: System.get_env("BOT_PRESENCE") || "you <3",
bot_presence_type: String.to_integer(System.get_env("BOT... | 40.545455 | 83 | 0.7287 |
c840f45e366f686598c02b034d063579330ee6cc | 954 | ex | Elixir | test/support/channel_case.ex | srowley/ggity_demo | 172815ce7d897ef965df1d992ba50e3290f8348d | [
"MIT"
] | null | null | null | test/support/channel_case.ex | srowley/ggity_demo | 172815ce7d897ef965df1d992ba50e3290f8348d | [
"MIT"
] | null | null | null | test/support/channel_case.ex | srowley/ggity_demo | 172815ce7d897ef965df1d992ba50e3290f8348d | [
"MIT"
] | null | null | null | defmodule GGityDemoWeb.ChannelCase do
@moduledoc """
This module defines the test case to be used by
channel tests.
Such tests rely on `Phoenix.ChannelTest` and also
import other functionality to make it easier
to build common data structures and query the data layer.
Finally, if the test case interacts... | 27.257143 | 66 | 0.74109 |
c840f7355e0ce2cbda6a7b9d2527717d9f29371d | 2,277 | ex | Elixir | clients/dfa_reporting/lib/google_api/dfa_reporting/v33/model/conversions_batch_insert_request.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2021-12-20T03:40:53.000Z | 2021-12-20T03:40:53.000Z | clients/dfa_reporting/lib/google_api/dfa_reporting/v33/model/conversions_batch_insert_request.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2020-08-18T00:11:23.000Z | 2020-08-18T00:44:16.000Z | clients/dfa_reporting/lib/google_api/dfa_reporting/v33/model/conversions_batch_insert_request.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... | 42.962264 | 263 | 0.749671 |
c841057ab9d3b3a45d78e64254967ccd104cbf43 | 490 | ex | Elixir | lib/fun_retro_web/controllers/auth.ex | Harmful-Alchemist/FunRetro | 6b53c16adb2c233e5338799732a5a5c2fe10acaf | [
"MIT"
] | null | null | null | lib/fun_retro_web/controllers/auth.ex | Harmful-Alchemist/FunRetro | 6b53c16adb2c233e5338799732a5a5c2fe10acaf | [
"MIT"
] | null | null | null | lib/fun_retro_web/controllers/auth.ex | Harmful-Alchemist/FunRetro | 6b53c16adb2c233e5338799732a5a5c2fe10acaf | [
"MIT"
] | null | null | null | defmodule FunRetroWeb.Auth do
import Plug.Conn
def init(opts) do
opts
end
def call(conn, _opts) do
board_id = get_session(conn, :board_id_auth)
board = board_id && FunRetro.Retros.get_board_without_drawings!(board_id)
assign(conn, :current_board, board)
end
def login(conn, board) do
c... | 22.272727 | 77 | 0.695918 |
c8412174535194b74dc2ec3db3be79bf6d311f2a | 1,659 | ex | Elixir | lib/quadquizaminos_web/endpoint.ex | WanjikuMac/quadquizaminos | 7d480cc8517768fadced9a7ab3e5459002014c96 | [
"MIT"
] | null | null | null | lib/quadquizaminos_web/endpoint.ex | WanjikuMac/quadquizaminos | 7d480cc8517768fadced9a7ab3e5459002014c96 | [
"MIT"
] | 1 | 2021-02-09T13:19:49.000Z | 2021-02-09T13:19:49.000Z | lib/quadquizaminos_web/endpoint.ex | WanjikuMac/quadquizaminos | 7d480cc8517768fadced9a7ab3e5459002014c96 | [
"MIT"
] | 2 | 2021-01-28T06:37:04.000Z | 2021-02-09T06:47:33.000Z | defmodule QuadquizaminosWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :quadquizaminos
# 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,
ke... | 30.163636 | 97 | 0.726944 |
c8412460c6692b2c46d092e41b19711309aaa0db | 1,228 | ex | Elixir | lib/exsync/src_monitor.ex | szTheory/exsync | d4a2359e90e116426f1a90939f06f7d850a0b161 | [
"BSD-3-Clause"
] | null | null | null | lib/exsync/src_monitor.ex | szTheory/exsync | d4a2359e90e116426f1a90939f06f7d850a0b161 | [
"BSD-3-Clause"
] | null | null | null | lib/exsync/src_monitor.ex | szTheory/exsync | d4a2359e90e116426f1a90939f06f7d850a0b161 | [
"BSD-3-Clause"
] | null | null | null | require Logger
defmodule ExSync.SrcMonitor do
def start_link do
GenServer.start_link(__MODULE__, [])
end
def init([]) do
{:ok, watcher_pid} =
FileSystem.start_link(
dirs: ExSync.Config.src_dirs(),
backend: Application.get_env(:file_system, :backend)
)
FileSystem.subscrib... | 29.238095 | 101 | 0.665309 |
c841254cd041a1140184d9fb7039ef821ff427c1 | 5,328 | ex | Elixir | lib/mix/tasks/skeleton.gen.model.ex | diegonogueira/essencial | 4de662ada8f559a49d9a389c3f3d0d99ba187dad | [
"MIT"
] | 1 | 2020-04-14T15:29:55.000Z | 2020-04-14T15:29:55.000Z | lib/mix/tasks/skeleton.gen.model.ex | diegonogueira/skeleton | 6e87a74b9cae14e2c735b532568a2cc41655766a | [
"MIT"
] | null | null | null | lib/mix/tasks/skeleton.gen.model.ex | diegonogueira/skeleton | 6e87a74b9cae14e2c735b532568a2cc41655766a | [
"MIT"
] | null | null | null | defmodule Mix.Tasks.SkeletonLegacy.Gen.Model do
use Mix.Task
import Macro, only: [camelize: 1, underscore: 1]
import Mix.Generator
def run(args) do
{_opts, [lib_name, resource, plural_name | inputs], _} = OptionParser.parse(args, switches: [])
resource_list = String.split(resource, "/")
[context, ... | 30.272727 | 152 | 0.60717 |
c8415c661ad049c00c789fedc718315c702b69ea | 9,102 | ex | Elixir | lib/miss/map.ex | kianmeng/miss-elixir | 46ea760212bcec80957ff7a8951d64c4bd2fc5e2 | [
"Apache-2.0"
] | null | null | null | lib/miss/map.ex | kianmeng/miss-elixir | 46ea760212bcec80957ff7a8951d64c4bd2fc5e2 | [
"Apache-2.0"
] | null | null | null | lib/miss/map.ex | kianmeng/miss-elixir | 46ea760212bcec80957ff7a8951d64c4bd2fc5e2 | [
"Apache-2.0"
] | null | null | null | defmodule Miss.Map do
@moduledoc """
Functions to extend the Elixir `Map` module.
"""
@type keys_to_rename :: [{actual_key :: Map.key(), new_key :: Map.key()}] | map()
@type transform :: [{module(), (module() -> term()) | :skip}]
@typep map_to_list :: [{Map.key(), Map.value()}]
@doc """
Converts a `st... | 30.854237 | 104 | 0.552626 |
c8416d45a265dcefdad789618a78814251f036f0 | 3,601 | ex | Elixir | apps/admin_api/lib/admin_api/v1/controllers/transaction_calculation_controller.ex | AndonMitev/EWallet | 898cde38933d6f134734528b3e594eedf5fa50f3 | [
"Apache-2.0"
] | 322 | 2018-02-28T07:38:44.000Z | 2020-05-27T23:09:55.000Z | apps/admin_api/lib/admin_api/v1/controllers/transaction_calculation_controller.ex | AndonMitev/EWallet | 898cde38933d6f134734528b3e594eedf5fa50f3 | [
"Apache-2.0"
] | 643 | 2018-02-28T12:05:20.000Z | 2020-05-22T08:34:38.000Z | apps/admin_api/lib/admin_api/v1/controllers/transaction_calculation_controller.ex | AndonMitev/EWallet | 898cde38933d6f134734528b3e594eedf5fa50f3 | [
"Apache-2.0"
] | 63 | 2018-02-28T10:57:06.000Z | 2020-05-27T23:10:38.000Z | # Copyright 2018-2019 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 ... | 33.654206 | 96 | 0.692308 |
c841957357f2f7fb02102402a185f6a125da4ca7 | 431 | ex | Elixir | lib/mipha_web/plugs/require_admin.ex | ZPVIP/mipha | a7df054f72eec7de88b60d94c501488375bdff6a | [
"MIT"
] | 156 | 2018-06-01T19:52:32.000Z | 2022-02-03T10:58:10.000Z | lib/mipha_web/plugs/require_admin.ex | ZPVIP/mipha | a7df054f72eec7de88b60d94c501488375bdff6a | [
"MIT"
] | 139 | 2018-07-10T01:57:23.000Z | 2021-08-02T21:29:24.000Z | lib/mipha_web/plugs/require_admin.ex | ZPVIP/mipha | a7df054f72eec7de88b60d94c501488375bdff6a | [
"MIT"
] | 29 | 2018-07-17T08:43:45.000Z | 2021-12-14T13:45:30.000Z | defmodule MiphaWeb.Plug.RequireAdmin do
@moduledoc false
import Plug.Conn
import Phoenix.Controller
alias MiphaWeb.Router.Helpers
def init(opts), do: opts
def call(conn, _opts) do
user = conn.assigns[:current_user]
if user && user.is_admin do
conn
else
conn
|> put_flash(:d... | 17.958333 | 55 | 0.647332 |
c841a2a0a89806bd5bd82e378f1657557c602768 | 931 | ex | Elixir | other/list-comprehensions.ex | MaraniMatias/elixir-hola-mundo | 325a6ba623378521ec6f79bd4627a0eb7c6cd1fa | [
"MIT"
] | 1 | 2016-12-25T09:53:53.000Z | 2016-12-25T09:53:53.000Z | other/list-comprehensions.ex | MaraniMatias/elixir-hola-mundo | 325a6ba623378521ec6f79bd4627a0eb7c6cd1fa | [
"MIT"
] | null | null | null | other/list-comprehensions.ex | MaraniMatias/elixir-hola-mundo | 325a6ba623378521ec6f79bd4627a0eb7c6cd1fa | [
"MIT"
] | null | null | null | # Testing Lists
list = [1, 2, 4, 8, 16, 32]
is_int = fn(value) -> is_integer(value) end
IO.inspect Enum.all?(list, is_int) # true
IO.inspect Enum.any?(list, is_int) # true
compare = &(&1 > 10)
IO.inspect Enum.all?(list, compare) # false
IO.inspect Enum.any?(list, compare) # true
# Splitting Lists
IO.inspect Enum.parti... | 37.24 | 79 | 0.650913 |
c841ffe1f5cc5a1e3c4430c8d7b442a43892db13 | 3,493 | ex | Elixir | clients/run/lib/google_api/run/v1/model/revision_spec.ex | kyleVsteger/elixir-google-api | 3a0dd498af066a4361b5b0fd66ffc04a57539488 | [
"Apache-2.0"
] | null | null | null | clients/run/lib/google_api/run/v1/model/revision_spec.ex | kyleVsteger/elixir-google-api | 3a0dd498af066a4361b5b0fd66ffc04a57539488 | [
"Apache-2.0"
] | null | null | null | clients/run/lib/google_api/run/v1/model/revision_spec.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... | 59.20339 | 462 | 0.741483 |
c842030cffd3acbb29f8d5da2472ed26b4cf0ee6 | 1,674 | exs | Elixir | test/teiserver/coordinator/setup_test.exs | Teifion/teiserver | 131e002160e1e948cb55e56d62370ba66a972cba | [
"MIT"
] | 6 | 2021-02-08T10:42:53.000Z | 2021-04-25T12:12:03.000Z | test/teiserver/coordinator/setup_test.exs | Teifion/teiserver | 131e002160e1e948cb55e56d62370ba66a972cba | [
"MIT"
] | null | null | null | test/teiserver/coordinator/setup_test.exs | Teifion/teiserver | 131e002160e1e948cb55e56d62370ba66a972cba | [
"MIT"
] | 2 | 2021-02-23T22:34:00.000Z | 2021-04-08T13:31:36.000Z | defmodule Teiserver.Protocols.Coordinator.SetupTest do
use Central.ServerCase, async: false
alias Teiserver.{Client}
alias Teiserver.Account.UserCache
alias Teiserver.TeiserverTestLib
alias Teiserver.Battle.Lobby
alias Teiserver.Common.PubsubListener
import Teiserver.TeiserverTestLib,
only: [tachyon_... | 31 | 113 | 0.687575 |
c84223741284e94bcd0c4b691ff5cbb1fffa2f1d | 174 | ex | Elixir | lib/elixir_reed_solomon_erasure.ex | helium/elixir-reed-solomon-erasure | 9324fc9f1e3d1e9b3ba1bd063aeeb28d88628ff2 | [
"Apache-2.0"
] | 2 | 2021-11-28T00:04:56.000Z | 2022-03-24T11:11:56.000Z | lib/elixir_reed_solomon_erasure.ex | helium/elixir-reed-solomon-erasure | 9324fc9f1e3d1e9b3ba1bd063aeeb28d88628ff2 | [
"Apache-2.0"
] | null | null | null | lib/elixir_reed_solomon_erasure.ex | helium/elixir-reed-solomon-erasure | 9324fc9f1e3d1e9b3ba1bd063aeeb28d88628ff2 | [
"Apache-2.0"
] | 1 | 2021-04-03T10:33:33.000Z | 2021-04-03T10:33:33.000Z | defmodule ElixirReedSolomonErasure do
def encode(data_shards, parity_shards, msg) do
Elixir.ReedSolomonErasure.Native.encode(data_shards, parity_shards, msg)
end
end
| 29 | 76 | 0.816092 |
c8422689dbbfede20511bcbc2b47162d322281e8 | 2,996 | ex | Elixir | apps/massa_proxy/lib/massa_proxy/cluster/entity/entity_registry.ex | drowzy/massa | 624cb02e0039b0624c534636f96fd157b1e34a95 | [
"Apache-2.0"
] | null | null | null | apps/massa_proxy/lib/massa_proxy/cluster/entity/entity_registry.ex | drowzy/massa | 624cb02e0039b0624c534636f96fd157b1e34a95 | [
"Apache-2.0"
] | 16 | 2021-11-01T08:19:03.000Z | 2022-03-30T08:17:43.000Z | apps/massa_proxy/lib/massa_proxy/cluster/entity/entity_registry.ex | drowzy/massa | 624cb02e0039b0624c534636f96fd157b1e34a95 | [
"Apache-2.0"
] | null | null | null | defmodule MassaProxy.Entity.EntityRegistry do
@moduledoc false
use GenServer
require Logger
alias Phoenix.PubSub
@topic "entities"
def child_spec(state \\ %{}) do
%{
id: __MODULE__,
start: {__MODULE__, :start_link, [state]},
shutdown: 10_000,
restart: :transient
}
end
... | 22.870229 | 78 | 0.610481 |
c842284603656a0eab637b24d728ffa2b812190c | 2,228 | ex | Elixir | lib/fomantic_ui.ex | easink/fomantic_ui | 069e3d9f8bf6859223d35d8e14e97d9e0fb03848 | [
"Apache-2.0"
] | null | null | null | lib/fomantic_ui.ex | easink/fomantic_ui | 069e3d9f8bf6859223d35d8e14e97d9e0fb03848 | [
"Apache-2.0"
] | null | null | null | lib/fomantic_ui.ex | easink/fomantic_ui | 069e3d9f8bf6859223d35d8e14e97d9e0fb03848 | [
"Apache-2.0"
] | null | null | null | defmodule FomanticUI 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 FomanticUI, :controller
use FomanticUI, :view
The definitions below will be executed for every view,
controller, ... | 22.28 | 81 | 0.678187 |
c842416e2d51ba1c8e8f3fe98c69a7a239d4a4a7 | 1,007 | ex | Elixir | apps/definition_dataset/lib/dataset/v1.ex | rucker/hindsight | 876a5d344c5d8eebbea37684ee07e0a91e4430f0 | [
"Apache-2.0"
] | 12 | 2020-01-27T19:43:02.000Z | 2021-07-28T19:46:29.000Z | apps/definition_dataset/lib/dataset/v1.ex | rucker/hindsight | 876a5d344c5d8eebbea37684ee07e0a91e4430f0 | [
"Apache-2.0"
] | 81 | 2020-01-28T18:07:23.000Z | 2021-11-22T02:12:13.000Z | apps/definition_dataset/lib/dataset/v1.ex | rucker/hindsight | 876a5d344c5d8eebbea37684ee07e0a91e4430f0 | [
"Apache-2.0"
] | 10 | 2020-02-13T21:24:09.000Z | 2020-05-21T18:39:35.000Z | defmodule Dataset.V1 do
@moduledoc """
Defines the dataset implementation of the
`Definition.Schema` behaviour and the
dataset `s/0` function.
Returns a valid Norm schema representing a
dataset for validation and defaults the current
struct version.
"""
use Definition.Schema
@impl true
def s do
... | 25.820513 | 78 | 0.621648 |
c8424e29d4fa4f7a7c03e7e83baaab3c12ab8bb7 | 61 | ex | Elixir | lib/sanbase_web/views/root_view.ex | sitedata/sanbase2 | 8da5e44a343288fbc41b68668c6c80ae8547d557 | [
"MIT"
] | 81 | 2017-11-20T01:20:22.000Z | 2022-03-05T12:04:25.000Z | lib/sanbase_web/views/root_view.ex | rmoorman/sanbase2 | 226784ab43a24219e7332c49156b198d09a6dd85 | [
"MIT"
] | 359 | 2017-10-15T14:40:53.000Z | 2022-01-25T13:34:20.000Z | lib/sanbase_web/views/root_view.ex | sitedata/sanbase2 | 8da5e44a343288fbc41b68668c6c80ae8547d557 | [
"MIT"
] | 16 | 2017-11-19T13:57:40.000Z | 2022-02-07T08:13:02.000Z | defmodule SanbaseWeb.RootView do
use SanbaseWeb, :view
end
| 15.25 | 32 | 0.803279 |
c842bb754e55daca2b99263d361b1209cf24d26f | 2,335 | ex | Elixir | apps/simple_rtmp_player/lib/simple_rtmp_player/client.ex | Kabie/elixir-media-libs | 9750c6dcdffdf8014183a6a4f303c5d0d658f062 | [
"MIT"
] | 75 | 2016-12-23T14:37:18.000Z | 2021-04-26T14:07:20.000Z | apps/simple_rtmp_player/lib/simple_rtmp_player/client.ex | Kabie/elixir-media-libs | 9750c6dcdffdf8014183a6a4f303c5d0d658f062 | [
"MIT"
] | 19 | 2016-12-22T03:20:43.000Z | 2020-06-11T12:10:37.000Z | apps/simple_rtmp_player/lib/simple_rtmp_player/client.ex | Kabie/elixir-media-libs | 9750c6dcdffdf8014183a6a4f303c5d0d658f062 | [
"MIT"
] | 3 | 2018-03-29T06:40:40.000Z | 2019-02-13T09:37:19.000Z | defmodule SimpleRtmpPlayer.Client do
@behaviour GenRtmpClient
alias Rtmp.ClientSession.Events, as: Events
require Logger
defmodule State do
defstruct status: :started,
connection_info: nil,
stream_key: nil,
av_bytes_received: 0,
last_av_announcement... | 29.556962 | 106 | 0.689079 |
c842c90b497c3aee14811e8bd540afb233149bc4 | 1,277 | ex | Elixir | apps/authorizer/lib/rules/commands/admin_access.ex | lcpojr/watcher_ex | bd5a9210b5b41a6c9b5d4255de19fc6967d29fb7 | [
"Apache-2.0"
] | 9 | 2020-10-13T14:11:37.000Z | 2021-08-12T18:40:08.000Z | apps/authorizer/lib/rules/commands/admin_access.ex | lcpojr/watcher_ex | bd5a9210b5b41a6c9b5d4255de19fc6967d29fb7 | [
"Apache-2.0"
] | 28 | 2020-10-04T14:43:48.000Z | 2021-12-07T16:54:22.000Z | apps/authorizer/lib/rules/commands/admin_access.ex | lcpojr/watcher_ex | bd5a9210b5b41a6c9b5d4255de19fc6967d29fb7 | [
"Apache-2.0"
] | 3 | 2020-11-25T20:59:47.000Z | 2021-08-30T10:36:58.000Z | defmodule Authorizer.Rules.Commands.AdminAccess do
@moduledoc """
Rule for authorizing a subject to do any action on admin endpoints.
In order to authorize we have to execute an verification if the subject matches some
requirements as:
- It has admin flag enabled;
- It is status is active;
"""
req... | 25.54 | 88 | 0.647612 |
c842d8cef975cfa6e78e6c6804d64806434ebebf | 714 | ex | Elixir | lib/mbanking_web/gettext.ex | kadmohardy/mbanking | 42a45f78956eac95597e72ade10cb0291ed5aa76 | [
"MIT"
] | null | null | null | lib/mbanking_web/gettext.ex | kadmohardy/mbanking | 42a45f78956eac95597e72ade10cb0291ed5aa76 | [
"MIT"
] | null | null | null | lib/mbanking_web/gettext.ex | kadmohardy/mbanking | 42a45f78956eac95597e72ade10cb0291ed5aa76 | [
"MIT"
] | null | null | null | defmodule MbankingWeb.Gettext do
@moduledoc """
A module providing Internationalization with a gettext-based API.
By using [Gettext](https://hexdocs.pm/gettext),
your module gains a set of macros for translations, for example:
import MbankingWeb.Gettext
# Simple translation
gettext("Here is... | 28.56 | 72 | 0.679272 |
c842e9a79b00f4e93adafb483cb5006881cb800e | 2,707 | ex | Elixir | clients/spectrum/lib/google_api/spectrum/v1explorer/model/geo_location.ex | nuxlli/elixir-google-api | ecb8679ac7282b7dd314c3e20c250710ec6a7870 | [
"Apache-2.0"
] | 1 | 2021-12-20T03:40:53.000Z | 2021-12-20T03:40:53.000Z | clients/spectrum/lib/google_api/spectrum/v1explorer/model/geo_location.ex | nuxlli/elixir-google-api | ecb8679ac7282b7dd314c3e20c250710ec6a7870 | [
"Apache-2.0"
] | 1 | 2020-12-18T09:25:12.000Z | 2020-12-18T09:25:12.000Z | clients/spectrum/lib/google_api/spectrum/v1explorer/model/geo_location.ex | nuxlli/elixir-google-api | ecb8679ac7282b7dd314c3e20c250710ec6a7870 | [
"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... | 50.12963 | 426 | 0.768009 |
c842f202ae2f01748003ad72c04a8ee39929caab | 1,642 | ex | Elixir | test/support/test_support.ex | joshuawscott/kayrock | 614b930d568f7d0655a00e8d0d760e3b33314366 | [
"MIT"
] | 24 | 2019-06-26T22:08:13.000Z | 2022-01-27T00:10:41.000Z | test/support/test_support.ex | joshuawscott/kayrock | 614b930d568f7d0655a00e8d0d760e3b33314366 | [
"MIT"
] | 10 | 2020-04-10T07:48:53.000Z | 2021-03-26T10:50:25.000Z | test/support/test_support.ex | joshuawscott/kayrock | 614b930d568f7d0655a00e8d0d760e3b33314366 | [
"MIT"
] | 11 | 2019-10-30T12:53:09.000Z | 2022-03-09T23:16:42.000Z | defmodule Kayrock.TestSupport do
@moduledoc "Support code for tests"
def compare_binaries(lhs, rhs) do
bytes_per_chunk = 16
chunks_lhs = chunk_binary(lhs, bytes_per_chunk)
chunks_rhs = chunk_binary(rhs, bytes_per_chunk)
max_l = max(length(chunks_lhs), length(chunks_rhs))
chunks_lhs = pad_list(... | 26.918033 | 84 | 0.600487 |
c8430193581fb9c9ba45bdf5101af609f0cfc858 | 1,285 | ex | Elixir | lib/oli/rendering/activity/plaintext.ex | malav2110/oli-torus | 8af64e762a7c8a2058bd27a7ab8e96539ffc055f | [
"MIT"
] | 1 | 2022-03-17T20:35:47.000Z | 2022-03-17T20:35:47.000Z | lib/oli/rendering/activity/plaintext.ex | malav2110/oli-torus | 8af64e762a7c8a2058bd27a7ab8e96539ffc055f | [
"MIT"
] | 9 | 2021-11-02T16:52:09.000Z | 2022-03-25T15:14:01.000Z | lib/oli/rendering/activity/plaintext.ex | malav2110/oli-torus | 8af64e762a7c8a2058bd27a7ab8e96539ffc055f | [
"MIT"
] | null | null | null | defmodule Oli.Rendering.Activity.Plaintext do
@moduledoc """
Implements the Plaintext writer for activity rendering
"""
import Oli.Utils
alias Oli.Rendering.Context
alias Oli.Rendering.Error
@behaviour Oli.Rendering.Activity
def activity(
%Context{
activity_map: activity_map,
... | 23.796296 | 79 | 0.587549 |
c84301bcf73286c4fe371d392adc91546732619f | 6,213 | ex | Elixir | lib/mix/tasks/phx.gen.notifier.ex | udanieli/phoenix | 40b79c8d227eadb2af90f19b26c297a87f3b69aa | [
"MIT"
] | 1 | 2021-09-25T11:49:31.000Z | 2021-09-25T11:49:31.000Z | lib/mix/tasks/phx.gen.notifier.ex | udanieli/phoenix | 40b79c8d227eadb2af90f19b26c297a87f3b69aa | [
"MIT"
] | null | null | null | lib/mix/tasks/phx.gen.notifier.ex | udanieli/phoenix | 40b79c8d227eadb2af90f19b26c297a87f3b69aa | [
"MIT"
] | null | null | null | defmodule Mix.Tasks.Phx.Gen.Notifier do
@shortdoc "Generates a notifier that delivers emails by default"
@moduledoc """
Generates a notifier that delivers emails by default.
$ mix phx.gen.notifier Accounts User welcome_user reset_password confirmation_instructions
This task expects a context module nam... | 28.240909 | 142 | 0.674714 |
c843188c81c73e414c60fe2b6a20d0969b57857b | 7,566 | ex | Elixir | lib/common/options.ex | andrzej-mag/meshx_rpc | 11e4cf8c280a2762309ea7fffd9c77a20c9debee | [
"Apache-2.0"
] | null | null | null | lib/common/options.ex | andrzej-mag/meshx_rpc | 11e4cf8c280a2762309ea7fffd9c77a20c9debee | [
"Apache-2.0"
] | null | null | null | lib/common/options.ex | andrzej-mag/meshx_rpc | 11e4cf8c280a2762309ea7fffd9c77a20c9debee | [
"Apache-2.0"
] | null | null | null | defmodule MeshxRpc.Common.Options do
@moduledoc false
def common(),
do: [
pool_opts: [
type: :keyword_list,
default: [],
doc: """
worker pool options for RPC client and server.
Server pool is build using [`ranch` socket acceptor pool](https://hex.pm/packages/ranch).... | 48.191083 | 527 | 0.609966 |
c8432ec734884b3cf7c85155a72de5bae4725025 | 839 | exs | Elixir | farmbot_ext/test/farmbot_ext/amqp/bot_state_channel_support_test.exs | va2ron1/farmbot_os | c80a38058713adc2ad91a4802664bcfe8da9d96c | [
"MIT"
] | null | null | null | farmbot_ext/test/farmbot_ext/amqp/bot_state_channel_support_test.exs | va2ron1/farmbot_os | c80a38058713adc2ad91a4802664bcfe8da9d96c | [
"MIT"
] | null | null | null | farmbot_ext/test/farmbot_ext/amqp/bot_state_channel_support_test.exs | va2ron1/farmbot_os | c80a38058713adc2ad91a4802664bcfe8da9d96c | [
"MIT"
] | null | null | null | defmodule FarmbotExt.AMQP.BotStateChannelSupportTest do
require Helpers
use ExUnit.Case, async: false
use Mimic
setup :verify_on_exit!
alias FarmbotExt.AMQP.BotStateChannelSupport
test "broadcast_state(chan, jwt_dot_bot, cache)" do
fake_chan = %{fake: :chan}
fake_bot = "xyz"
fake_cache = %{}
... | 25.424242 | 85 | 0.663886 |
c84330c4bf8d1558128b0fbe3ac6434f761ad03e | 184 | exs | Elixir | priv/repo/migrations/20210716195943_create_comments.exs | vrrpizzato/blog | bee1e71ca29925d43d62f0bbaa9ae7f4566d65fe | [
"MIT"
] | null | null | null | priv/repo/migrations/20210716195943_create_comments.exs | vrrpizzato/blog | bee1e71ca29925d43d62f0bbaa9ae7f4566d65fe | [
"MIT"
] | 17 | 2021-04-22T00:58:05.000Z | 2021-09-26T04:03:12.000Z | priv/repo/migrations/20210625013413_create_comments.exs | carlosviana/blog | 1dcf58c3ca40bc3a7105d75de6f51954eb44bca8 | [
"MIT"
] | null | null | null | defmodule Blog.Repo.Migrations.CreateComments do
use Ecto.Migration
def change do
create table(:comments) do
add :content, :string
timestamps()
end
end
end
| 15.333333 | 48 | 0.684783 |
c8433be956653fdcbc67a06098d5247709232bb5 | 556 | exs | Elixir | apps/re/test/mix/addresses/add_district_test.exs | ruby2elixir/emcasa-backend | 70d7f4f233555417941ffa6ada84cf8740c21dd2 | [
"MIT"
] | 4 | 2019-11-01T16:29:31.000Z | 2020-10-10T21:20:12.000Z | apps/re/test/mix/addresses/add_district_test.exs | eduardomartines/emcasa-backend | 70d7f4f233555417941ffa6ada84cf8740c21dd2 | [
"MIT"
] | null | null | null | apps/re/test/mix/addresses/add_district_test.exs | eduardomartines/emcasa-backend | 70d7f4f233555417941ffa6ada84cf8740c21dd2 | [
"MIT"
] | 5 | 2019-11-04T21:25:45.000Z | 2020-02-13T23:49:36.000Z | defmodule Mix.Tasks.Re.Addresses.AddDistrictTest do
use Re.ModelCase
alias Mix.Tasks.Re.Addresses.AddDistrict
alias Re.{
Addresses.District,
Repo
}
setup do
Mix.shell(Mix.Shell.Process)
on_exit(fn ->
Mix.shell(Mix.Shell.IO)
end)
:ok
end
describe "run/1" do
test "ins... | 15.885714 | 52 | 0.622302 |
c843557aa59dcf0d3e7fa234bc69de52e092f9e4 | 80 | exs | Elixir | test/context_web/views/page_view_test.exs | hotpyn/context-demo | 304c767be93f8dec75ef8ec97d13e5e90352a47d | [
"MIT"
] | null | null | null | test/context_web/views/page_view_test.exs | hotpyn/context-demo | 304c767be93f8dec75ef8ec97d13e5e90352a47d | [
"MIT"
] | null | null | null | test/context_web/views/page_view_test.exs | hotpyn/context-demo | 304c767be93f8dec75ef8ec97d13e5e90352a47d | [
"MIT"
] | null | null | null | defmodule ContextWeb.PageViewTest do
use ContextWeb.ConnCase, async: true
end
| 20 | 38 | 0.825 |
c843586473a8c8c870ab71343b0c0ffcb3d48253 | 1,925 | exs | Elixir | clients/storage_transfer/mix.exs | MasashiYokota/elixir-google-api | 975dccbff395c16afcb62e7a8e411fbb58e9ab01 | [
"Apache-2.0"
] | null | null | null | clients/storage_transfer/mix.exs | MasashiYokota/elixir-google-api | 975dccbff395c16afcb62e7a8e411fbb58e9ab01 | [
"Apache-2.0"
] | null | null | null | clients/storage_transfer/mix.exs | MasashiYokota/elixir-google-api | 975dccbff395c16afcb62e7a8e411fbb58e9ab01 | [
"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... | 28.731343 | 156 | 0.666494 |
c843e55c5da47503c61cc0e72920a05c55e572f8 | 2,380 | ex | Elixir | lib/currency_conversion/source/fixer.ex | strzibny/currency-conversion | 057ad0f4a6e9169db55ae52a06dc22675644d467 | [
"MIT"
] | null | null | null | lib/currency_conversion/source/fixer.ex | strzibny/currency-conversion | 057ad0f4a6e9169db55ae52a06dc22675644d467 | [
"MIT"
] | null | null | null | lib/currency_conversion/source/fixer.ex | strzibny/currency-conversion | 057ad0f4a6e9169db55ae52a06dc22675644d467 | [
"MIT"
] | null | null | null | defmodule CurrencyConversion.Source.Fixer do
@moduledoc """
Currency Conversion Source for http://fixer.io/
"""
alias Poison.Parser
@behaviour CurrencyConversion.Source
@default_protocol "http"
@base_endpoint "data.fixer.io/api/latest"
@doc """
Load current currency rates from fixer.io.
### Examp... | 32.162162 | 86 | 0.635294 |
c8446df3c7524c55a41299bff3f560da70cf57a9 | 626 | ex | Elixir | lib/quantum/run_strategy/local.ex | barthez/quantum-elixir | 264e8fad134ed3622360555def32d89d75c7e20e | [
"Apache-2.0"
] | null | null | null | lib/quantum/run_strategy/local.ex | barthez/quantum-elixir | 264e8fad134ed3622360555def32d89d75c7e20e | [
"Apache-2.0"
] | null | null | null | lib/quantum/run_strategy/local.ex | barthez/quantum-elixir | 264e8fad134ed3622360555def32d89d75c7e20e | [
"Apache-2.0"
] | null | null | null | defmodule Quantum.RunStrategy.Local do
@moduledoc """
Run job on local node
### Mix Configuration
config :my_app, MyApp.Scheduler,
jobs: [
# Run on local node
[schedule: "* * * * *", run_strategy: Quantum.RunStrategy.Local]
]
"""
@type t :: %__MODULE__{nodes: nil}... | 18.969697 | 74 | 0.610224 |
c8447430895bee166147c7658ba21d808fb884fd | 203 | ex | Elixir | ulrworker.ex | Dmdv/ElixirPlayground | 02d9e8a7fdd6e8742e200430debc9f0ec7fd28a1 | [
"Apache-2.0"
] | null | null | null | ulrworker.ex | Dmdv/ElixirPlayground | 02d9e8a7fdd6e8742e200430debc9f0ec7fd28a1 | [
"Apache-2.0"
] | null | null | null | ulrworker.ex | Dmdv/ElixirPlayground | 02d9e8a7fdd6e8742e200430debc9f0ec7fd28a1 | [
"Apache-2.0"
] | null | null | null | defmodule URLWorker do
# an example of pipe operator |>
def start(url) do
result = url |> HTTPoison.get |> do_request
end
def do_request(str) do
IO.puts str
end
end | 16.916667 | 51 | 0.605911 |
c8448bbcec3dbf58c36ca57467e044103f35f0f9 | 919 | exs | Elixir | deps/mime/mix.exs | rpillar/Top5_Elixir | 9c450d2e9b291108ff1465dc066dfe442dbca822 | [
"MIT"
] | null | null | null | deps/mime/mix.exs | rpillar/Top5_Elixir | 9c450d2e9b291108ff1465dc066dfe442dbca822 | [
"MIT"
] | null | null | null | deps/mime/mix.exs | rpillar/Top5_Elixir | 9c450d2e9b291108ff1465dc066dfe442dbca822 | [
"MIT"
] | null | null | null | defmodule MIME.Mixfile do
use Mix.Project
@version "1.3.1"
def project do
[
app: :mime,
version: @version,
elixir: "~> 1.3",
description: "A MIME type module for Elixir",
package: package(),
deps: deps(),
aliases: [test: "test --no-start"],
docs:... | 19.978261 | 66 | 0.48531 |
c844967b29c6de4b450e62f4f6fd4488bd4f20e9 | 1,542 | ex | Elixir | client_query/lib/client_query_web/endpoint.ex | gumberss/Ticketing-deno | 959b1b0763d246e05fd261aa5ceb94894dc5fe7b | [
"MIT"
] | 1 | 2020-09-08T00:06:33.000Z | 2020-09-08T00:06:33.000Z | client_query/lib/client_query_web/endpoint.ex | gumberss/Ticketing-deno | 959b1b0763d246e05fd261aa5ceb94894dc5fe7b | [
"MIT"
] | null | null | null | client_query/lib/client_query_web/endpoint.ex | gumberss/Ticketing-deno | 959b1b0763d246e05fd261aa5ceb94894dc5fe7b | [
"MIT"
] | null | null | null | defmodule ClientQueryWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :client_query
# 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: "_... | 29.09434 | 97 | 0.719196 |
c844a4b88b1b29ed9b7cee9110cb523033c44572 | 1,510 | ex | Elixir | clients/pub_sub/lib/google_api/pub_sub/v1/model/validate_schema_request.ex | mcrumm/elixir-google-api | 544f22797cec52b3a23dfb6e39117f0018448610 | [
"Apache-2.0"
] | null | null | null | clients/pub_sub/lib/google_api/pub_sub/v1/model/validate_schema_request.ex | mcrumm/elixir-google-api | 544f22797cec52b3a23dfb6e39117f0018448610 | [
"Apache-2.0"
] | null | null | null | clients/pub_sub/lib/google_api/pub_sub/v1/model/validate_schema_request.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... | 32.12766 | 122 | 0.742384 |
c844bb5f09078fad6080091f80243eee9431790b | 856 | ex | Elixir | web_finngen_r4/lib/risteys_web/controllers/home_controller.ex | vincent-octo/risteys | 5bb1e70b78988770048b91b42fad025faf98d84a | [
"MIT"
] | null | null | null | web_finngen_r4/lib/risteys_web/controllers/home_controller.ex | vincent-octo/risteys | 5bb1e70b78988770048b91b42fad025faf98d84a | [
"MIT"
] | null | null | null | web_finngen_r4/lib/risteys_web/controllers/home_controller.ex | vincent-octo/risteys | 5bb1e70b78988770048b91b42fad025faf98d84a | [
"MIT"
] | null | null | null | defmodule RisteysWeb.HomeController do
use RisteysWeb, :controller
alias Risteys.Phenocode
alias Risteys.Repo
import Ecto.Query
plug :put_layout, "minimal.html"
def index(conn, _params) do
{phenos_group1, phenos_group2} = get_demo_phenos()
conn
|> assign(:phenos_group1, phenos_group1)
|> a... | 28.533333 | 73 | 0.669393 |
c844fa79341aaa9ddac850bba2b1bc4d3b4961ac | 389 | exs | Elixir | elixir/priv/repo/migrations/20210128050228_add_update_available_credit_procedure.exs | williamhudson1218/web-homework | 0582a765854b36dd0f54ebff95abbe5f2f54269d | [
"MIT"
] | 1 | 2021-01-24T06:15:39.000Z | 2021-01-24T06:15:39.000Z | elixir/priv/repo/migrations/20210128050228_add_update_available_credit_procedure.exs | williamhudson1218/web-homework | 0582a765854b36dd0f54ebff95abbe5f2f54269d | [
"MIT"
] | null | null | null | elixir/priv/repo/migrations/20210128050228_add_update_available_credit_procedure.exs | williamhudson1218/web-homework | 0582a765854b36dd0f54ebff95abbe5f2f54269d | [
"MIT"
] | null | null | null | defmodule Homework.Repo.Migrations.AddUpdateAvailableCreditProcedure do
use Ecto.Migration
def change do
execute "CREATE FUNCTION update_available_credit()
RETURNS TRIGGER AS $BODY$
BEGIN
UPDATE companies
SET available_credit = (available_credit - NEW.amount)
WHERE id = NEW.company_id... | 24.3125 | 71 | 0.714653 |
c8458b8b8c6c8f050b0329b6474d6fdd735bdcea | 1,573 | ex | Elixir | lib/live_view_example_web/views/error_helpers.ex | RyoWakabayashi/phoenix-liveview-example | 1f7020d142a88fb2f68c4e58fd7635133cbaf8bc | [
"MIT"
] | null | null | null | lib/live_view_example_web/views/error_helpers.ex | RyoWakabayashi/phoenix-liveview-example | 1f7020d142a88fb2f68c4e58fd7635133cbaf8bc | [
"MIT"
] | null | null | null | lib/live_view_example_web/views/error_helpers.ex | RyoWakabayashi/phoenix-liveview-example | 1f7020d142a88fb2f68c4e58fd7635133cbaf8bc | [
"MIT"
] | null | null | null | defmodule LiveViewExampleWeb.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.770833 | 84 | 0.670693 |
c8459202899266eaff84899b928dd7f5f3609b16 | 26,316 | ex | Elixir | lib/elixir/lib/exception.ex | ellbee/elixir | c1acfe9827f12ef58f7f301baad7497472cb4bc9 | [
"Apache-2.0"
] | null | null | null | lib/elixir/lib/exception.ex | ellbee/elixir | c1acfe9827f12ef58f7f301baad7497472cb4bc9 | [
"Apache-2.0"
] | null | null | null | lib/elixir/lib/exception.ex | ellbee/elixir | c1acfe9827f12ef58f7f301baad7497472cb4bc9 | [
"Apache-2.0"
] | null | null | null | defmodule Exception do
@moduledoc """
Functions to format throw/catch/exit and exceptions.
Note that stacktraces in Elixir are updated on throw,
errors and exits. For example, at any given moment,
`System.stacktrace/0` will return the stacktrace for the
last throw/error/exit that occurred in the current pr... | 28.145455 | 153 | 0.667389 |
c845a67799a99f47897b95d308f9a5055d982651 | 4,686 | exs | Elixir | test/console_reporter_test.exs | akoutmos/telemetry_metrics | 842b7c8113540bc0825c3a91908624df00ea8222 | [
"Apache-2.0"
] | null | null | null | test/console_reporter_test.exs | akoutmos/telemetry_metrics | 842b7c8113540bc0825c3a91908624df00ea8222 | [
"Apache-2.0"
] | null | null | null | test/console_reporter_test.exs | akoutmos/telemetry_metrics | 842b7c8113540bc0825c3a91908624df00ea8222 | [
"Apache-2.0"
] | null | null | null | defmodule Telemetry.Metrics.ConsoleReporterTest do
use ExUnit.Case, async: true
import Telemetry.Metrics
import ExUnit.CaptureLog
def metadata_measurement(_measurements, metadata) do
map_size(metadata)
end
setup do
metrics = [
last_value("vm.memory.binary", unit: :byte),
counter("vm.m... | 30.627451 | 98 | 0.595817 |
c845e83a7144a12cc35d9a6dadf00003d1b0c320 | 6,540 | exs | Elixir | apps/state/test/state/trip/added_test.exs | fjlanasa/api | c39bc393aea572bfb81754b2ea1adf9dda9ce24a | [
"MIT"
] | 62 | 2019-01-17T12:34:39.000Z | 2022-03-20T21:49:47.000Z | apps/state/test/state/trip/added_test.exs | fjlanasa/api | c39bc393aea572bfb81754b2ea1adf9dda9ce24a | [
"MIT"
] | 375 | 2019-02-13T15:30:50.000Z | 2022-03-30T18:50:41.000Z | apps/state/test/state/trip/added_test.exs | fjlanasa/api | c39bc393aea572bfb81754b2ea1adf9dda9ce24a | [
"MIT"
] | 14 | 2019-01-16T19:35:57.000Z | 2022-02-26T18:55:54.000Z | defmodule State.Trip.AddedTest do
@moduledoc false
use ExUnit.Case
import State.Trip.Added
@trip_id "added_trip"
@route_id "route"
@route_pattern_id "pattern"
@route_type 3
@direction_id 0
@prediction %Model.Prediction{
trip_id: @trip_id,
route_id: @route_id,
route_pattern_id: @route_patte... | 27.711864 | 99 | 0.60948 |
c8460f5000dc916c24eae774e5f7a7c4f3481489 | 1,243 | ex | Elixir | discuss/lib/discuss_web/channels/user_socket.ex | hiroshisiq/elixir-sandbox | 3f014d2f15ae1eeda1c22db30ef111cbc22e9afc | [
"MIT"
] | null | null | null | discuss/lib/discuss_web/channels/user_socket.ex | hiroshisiq/elixir-sandbox | 3f014d2f15ae1eeda1c22db30ef111cbc22e9afc | [
"MIT"
] | null | null | null | discuss/lib/discuss_web/channels/user_socket.ex | hiroshisiq/elixir-sandbox | 3f014d2f15ae1eeda1c22db30ef111cbc22e9afc | [
"MIT"
] | null | null | null | defmodule DiscussWeb.UserSocket do
use Phoenix.Socket
## Channels
channel "comments:*", DiscussWeb.CommentsChannel
# Socket params are passed from the client and can
# be used to verify and authenticate a user. After
# verification, you can put default assigns into
# the socket that will be set for all ... | 31.871795 | 83 | 0.675784 |
c8460f72a2491e9bd90d907ff5b658dc0645e934 | 1,525 | ex | Elixir | clients/compute/lib/google_api/compute/v1/model/image_family_view.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2021-12-20T03:40:53.000Z | 2021-12-20T03:40:53.000Z | clients/compute/lib/google_api/compute/v1/model/image_family_view.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2020-08-18T00:11:23.000Z | 2020-08-18T00:44:16.000Z | clients/compute/lib/google_api/compute/v1/model/image_family_view.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... | 32.446809 | 195 | 0.739672 |
c8461c89d3a1c775f6cd24017eda8fcc28ce24b0 | 1,846 | ex | Elixir | clients/data_migration/lib/google_api/data_migration/v1beta1/model/list_locations_response.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2021-12-20T03:40:53.000Z | 2021-12-20T03:40:53.000Z | clients/data_migration/lib/google_api/data_migration/v1beta1/model/list_locations_response.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2020-08-18T00:11:23.000Z | 2020-08-18T00:44:16.000Z | clients/data_migration/lib/google_api/data_migration/v1beta1/model/list_locations_response.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... | 36.92 | 174 | 0.745395 |
c84621c06c17d9150f74af8cefc0a7ab49b193fb | 716 | ex | Elixir | test/support/models/user.ex | ianatha/formex | 7dbf2de83da05e167bbac5a0ed93fbb7dbfe5408 | [
"MIT"
] | 221 | 2017-01-15T18:14:55.000Z | 2021-08-17T14:15:40.000Z | test/support/models/user.ex | ianatha/formex | 7dbf2de83da05e167bbac5a0ed93fbb7dbfe5408 | [
"MIT"
] | 25 | 2017-04-09T01:01:20.000Z | 2019-04-17T01:36:01.000Z | test/support/models/user.ex | ianatha/formex | 7dbf2de83da05e167bbac5a0ed93fbb7dbfe5408 | [
"MIT"
] | 24 | 2017-04-08T22:15:06.000Z | 2021-11-15T11:55:41.000Z | # defmodule Formex.TestModel.User do
# use Formex.TestModel
# schema "users" do
# field :first_name, :string
# field :last_name, :string
# belongs_to :department, Formex.TestModel.Department
# belongs_to :user_info, Formex.TestModel.UserInfo
# has_many :user_addresses, Formex.TestModel.UserA... | 21.058824 | 62 | 0.667598 |
c8466bcb2343094e5ba80bea4221af81feadb63d | 2,375 | ex | Elixir | lib/freshcom/core/projector.ex | dclausen/freshcom | 7e1d6397c8ab222cfd03830232cee0718f050490 | [
"BSD-3-Clause"
] | null | null | null | lib/freshcom/core/projector.ex | dclausen/freshcom | 7e1d6397c8ab222cfd03830232cee0718f050490 | [
"BSD-3-Clause"
] | null | null | null | lib/freshcom/core/projector.ex | dclausen/freshcom | 7e1d6397c8ab222cfd03830232cee0718f050490 | [
"BSD-3-Clause"
] | null | null | null | defmodule Freshcom.Projector do
alias Phoenix.PubSub
alias Freshcom.PubSubServer
defmacro __using__(_) do
quote do
alias Ecto.{Changeset, Multi}
alias Phoenix.PubSub
alias Freshcom.{Projector, Projection, PubSubServer}
alias FCSupport.Struct
end
end
@doc """
The topic used ... | 28.27381 | 90 | 0.673263 |
c84681a1628fd59c0089986522f875e504599118 | 911 | ex | Elixir | ch09/supervise_database/lib/todo/database.ex | fboyer/elixir_in_action | d0acdcfc781020f8737f14900d3e2b5263f6f65e | [
"MIT"
] | null | null | null | ch09/supervise_database/lib/todo/database.ex | fboyer/elixir_in_action | d0acdcfc781020f8737f14900d3e2b5263f6f65e | [
"MIT"
] | null | null | null | ch09/supervise_database/lib/todo/database.ex | fboyer/elixir_in_action | d0acdcfc781020f8737f14900d3e2b5263f6f65e | [
"MIT"
] | null | null | null | defmodule Todo.Database do
use GenServer
def start_link(db_folder) do
IO.puts("Starting database server.")
GenServer.start_link(__MODULE__, db_folder, name: :database_server)
end
def store(key, data) do
key
|> get_worker
|> Todo.DatabaseWorker.store(key, data)
end
def get(key) do
... | 21.690476 | 71 | 0.671789 |
c84688882b4920fac84b61da7167960bf499a858 | 250 | exs | Elixir | create_fun_umbrella/apps/create_fun/config/test.exs | Vorzious/CreateFun | 5744c913ef706bc29062fa90a8ec5de12d267dab | [
"MIT"
] | null | null | null | create_fun_umbrella/apps/create_fun/config/test.exs | Vorzious/CreateFun | 5744c913ef706bc29062fa90a8ec5de12d267dab | [
"MIT"
] | 9 | 2018-06-17T09:54:03.000Z | 2018-06-17T09:55:20.000Z | create_fun_umbrella/apps/create_fun/config/test.exs | Vorzious/CreateFun | 5744c913ef706bc29062fa90a8ec5de12d267dab | [
"MIT"
] | 1 | 2018-06-05T18:38:01.000Z | 2018-06-05T18:38:01.000Z | use Mix.Config
# Database configuration
config :create_fun, CreateFun.Repo,
adapter: Ecto.Adapters.Postgres,
username: "postgres",
password: "postgres",
database: "create_fun_test",
hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox
| 22.727273 | 35 | 0.748 |
c846b4565966822c5a532d8b35446906aedf2d5f | 1,849 | exs | Elixir | clients/app_engine/mix.exs | ukrbublik/elixir-google-api | 364cec36bc76f60bec94cbcad34844367a29d174 | [
"Apache-2.0"
] | null | null | null | clients/app_engine/mix.exs | ukrbublik/elixir-google-api | 364cec36bc76f60bec94cbcad34844367a29d174 | [
"Apache-2.0"
] | null | null | null | clients/app_engine/mix.exs | ukrbublik/elixir-google-api | 364cec36bc76f60bec94cbcad34844367a29d174 | [
"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... | 27.597015 | 101 | 0.656571 |
c846c1e219dd35a5d773a0433cd0e92a5f056621 | 1,435 | ex | Elixir | apps/content/lib/content/post_admin.ex | votiakov/petal | ec03551da6dadc0c3482b25a5f5dcd400c36db43 | [
"MIT"
] | null | null | null | apps/content/lib/content/post_admin.ex | votiakov/petal | ec03551da6dadc0c3482b25a5f5dcd400c36db43 | [
"MIT"
] | null | null | null | apps/content/lib/content/post_admin.ex | votiakov/petal | ec03551da6dadc0c3482b25a5f5dcd400c36db43 | [
"MIT"
] | null | null | null | defmodule Legendary.Content.PostAdmin do
@moduledoc """
Custom admin logic for content posts and pages.
"""
import Ecto.Query, only: [from: 2]
def singular_name(_) do
"Post or Page"
end
def plural_name(_) do
"Posts and Pages"
end
def create_changeset(schema, attrs) do
Legendary.Content... | 22.421875 | 73 | 0.573519 |
c84709eabd064550c4e15566c2a164c29c8eccc1 | 2,559 | ex | Elixir | clients/dataproc/lib/google_api/dataproc/v1/model/instantiate_workflow_template_request.ex | mocknen/elixir-google-api | dac4877b5da2694eca6a0b07b3bd0e179e5f3b70 | [
"Apache-2.0"
] | null | null | null | clients/dataproc/lib/google_api/dataproc/v1/model/instantiate_workflow_template_request.ex | mocknen/elixir-google-api | dac4877b5da2694eca6a0b07b3bd0e179e5f3b70 | [
"Apache-2.0"
] | null | null | null | clients/dataproc/lib/google_api/dataproc/v1/model/instantiate_workflow_template_request.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... | 47.388889 | 461 | 0.754982 |
c8471151637cf2593ceac3992b247ac35b4509c1 | 295 | ex | Elixir | test/support/behaviours.ex | anagromataf/mox | 375f83ce5ecad71a81f6bafcc75b280e6f2f0c4c | [
"Apache-2.0"
] | 409 | 2020-01-20T14:55:51.000Z | 2022-03-31T22:31:20.000Z | test/support/behaviours.ex | anagromataf/mox | 375f83ce5ecad71a81f6bafcc75b280e6f2f0c4c | [
"Apache-2.0"
] | 38 | 2020-02-12T17:31:52.000Z | 2022-03-21T08:32:28.000Z | test/support/behaviours.ex | anagromataf/mox | 375f83ce5ecad71a81f6bafcc75b280e6f2f0c4c | [
"Apache-2.0"
] | 24 | 2020-03-30T07:17:39.000Z | 2022-03-28T21:08:57.000Z | defmodule Calculator do
@callback add(integer(), integer()) :: integer()
@callback mult(integer(), integer()) :: integer()
end
defmodule ScientificCalculator do
@callback exponent(integer(), integer()) :: integer()
@callback sin(integer()) :: float()
@optional_callbacks [sin: 1]
end
| 26.818182 | 55 | 0.694915 |
c84718bcae856b34aa02aa8ab4859dbb8e55100c | 239 | ex | Elixir | lib/tdbackend/router.ex | AndrewCEmil/TDBackend | 92d9ca8dc128a4ef21b446ca4d652c9def334fa4 | [
"MIT"
] | null | null | null | lib/tdbackend/router.ex | AndrewCEmil/TDBackend | 92d9ca8dc128a4ef21b446ca4d652c9def334fa4 | [
"MIT"
] | null | null | null | lib/tdbackend/router.ex | AndrewCEmil/TDBackend | 92d9ca8dc128a4ef21b446ca4d652c9def334fa4 | [
"MIT"
] | null | null | null | defmodule TDBackend.Router do
use Trot.Router
get "/", do: 200
# Returns an empty body with a status code of 400
get "/bad" do
:bad_request
end
import_routes TDBackend.Router.ShooterApi
import_routes Trot.NotFound
end
| 17.071429 | 51 | 0.723849 |
c8471c55f5e8695713219cd0b58991982cfcdc72 | 1,846 | ex | Elixir | test/support/conn_case.ex | imprest/mgp | 61457315243d0e0c26713601b9930ca34a116a16 | [
"MIT"
] | null | null | null | test/support/conn_case.ex | imprest/mgp | 61457315243d0e0c26713601b9930ca34a116a16 | [
"MIT"
] | 2 | 2020-12-22T12:30:58.000Z | 2021-05-19T10:07:26.000Z | test/support/conn_case.ex | imprest/mgp | 61457315243d0e0c26713601b9930ca34a116a16 | [
"MIT"
] | null | null | null | defmodule MgpWeb.ConnCase do
@moduledoc """
This module defines the test case to be used by
tests that require setting up a connection.
Such tests rely on `Phoenix.ConnTest` and also
import other functionality to make it easier
to build common data structures and query the data layer.
Finally, if the te... | 26.371429 | 65 | 0.706392 |
c84749eb0f94cbbb810d790b3f1fe16261584daa | 251 | exs | Elixir | priv/repo/migrations/20190817213949_add_similarity_search.exs | ashkan18/dobar | 37381af2a56b2456cfe2a0a358169fd2764cd3f0 | [
"MIT"
] | null | null | null | priv/repo/migrations/20190817213949_add_similarity_search.exs | ashkan18/dobar | 37381af2a56b2456cfe2a0a358169fd2764cd3f0 | [
"MIT"
] | 14 | 2019-09-02T18:00:07.000Z | 2021-09-02T00:49:54.000Z | priv/repo/migrations/20190817213949_add_similarity_search.exs | ashkan18/dobar | 37381af2a56b2456cfe2a0a358169fd2764cd3f0 | [
"MIT"
] | 1 | 2016-07-27T14:40:55.000Z | 2016-07-27T14:40:55.000Z | defmodule Dobar.Repo.Migrations.AddSimilaritySearch do
use Ecto.Migration
def change do
execute "CREATE EXTENSION IF NOT EXISTS pg_trgm"
execute "CREATE INDEX place_name_similarity_idx ON places USING gist (name gist_trgm_ops)"
end
end
| 27.888889 | 94 | 0.792829 |
c84788a18dc12250599f28ec8b853e95e9da219b | 711 | ex | Elixir | lib/calendarific/http_client.ex | Bounceapp/elixir-calendarific | f3c3b9b8d17d0fbf9773f3948bacf687a093a832 | [
"MIT"
] | 3 | 2021-03-16T15:21:08.000Z | 2021-03-19T22:38:20.000Z | lib/calendarific/http_client.ex | Bounceapp/elixir-calendarific | f3c3b9b8d17d0fbf9773f3948bacf687a093a832 | [
"MIT"
] | null | null | null | lib/calendarific/http_client.ex | Bounceapp/elixir-calendarific | f3c3b9b8d17d0fbf9773f3948bacf687a093a832 | [
"MIT"
] | null | null | null | defmodule Calendarific.HttpClient do
use HTTPoison.Base
def request(:get, url, params) do
case get(url, [], params: [api_key: api_key()] ++ params) do
{:ok, %HTTPoison.Response{status_code: code, body: body}} when code in 200..299 ->
body
{:ok, %HTTPoison.Response{body: body}} ->
r... | 23.7 | 88 | 0.64135 |
c8478f2700330f72c833a4b8d589ebf97223c39e | 5,243 | ex | Elixir | lib/loom/pncounter.ex | samgaw/loom | 574db0c8ce6170f65754474789382c142a1050c3 | [
"Apache-2.0"
] | null | null | null | lib/loom/pncounter.ex | samgaw/loom | 574db0c8ce6170f65754474789382c142a1050c3 | [
"Apache-2.0"
] | null | null | null | lib/loom/pncounter.ex | samgaw/loom | 574db0c8ce6170f65754474789382c142a1050c3 | [
"Apache-2.0"
] | null | null | null | defmodule Loom.PNCounter do
@moduledoc """
Positive-negative counters
PNCounters are counters that are capable of incrementing and decrementing.
They are useful for like counters, where a user may like and then unlike
something in succession.
They are not delta-CRDT's, as they are rather lightweight in ge... | 26.084577 | 83 | 0.56399 |
c847b3f39e848b4964398d901facf3f260830352 | 1,167 | exs | Elixir | clients/script/config/config.exs | GoNZooo/elixir-google-api | cf3ad7392921177f68091f3d9001f1b01b92f1cc | [
"Apache-2.0"
] | null | null | null | clients/script/config/config.exs | GoNZooo/elixir-google-api | cf3ad7392921177f68091f3d9001f1b01b92f1cc | [
"Apache-2.0"
] | null | null | null | clients/script/config/config.exs | GoNZooo/elixir-google-api | cf3ad7392921177f68091f3d9001f1b01b92f1cc | [
"Apache-2.0"
] | 1 | 2018-07-28T20:50:50.000Z | 2018-07-28T20:50:50.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... | 37.645161 | 73 | 0.761782 |
c847cd9f9b60b3cc862ffb13c76fd944b68e2d63 | 1,887 | ex | Elixir | lib/security/socket_types.ex | SmartCasual/elixir-zeromq | 91430a6a662399d2d96be731a778e29e8425ce7f | [
"MIT"
] | null | null | null | lib/security/socket_types.ex | SmartCasual/elixir-zeromq | 91430a6a662399d2d96be731a778e29e8425ce7f | [
"MIT"
] | null | null | null | lib/security/socket_types.ex | SmartCasual/elixir-zeromq | 91430a6a662399d2d96be731a778e29e8425ce7f | [
"MIT"
] | null | null | null | defmodule ZeroMQ.SocketTypes do
@valid_socket_combinations [
{"REQ", "REP"},
{"REQ", "ROUTER"},
{"REP", "REQ"},
{"REP", "DEALER"},
{"DEALER", "REP"},
{"DEALER", "DEALER"},
{"DEALER", "ROUTER"},
{"PUB", "SUB"},
{"PUB", "XSUB"},
{"XPUB", "SUB"},
{"XPUB", "XSUB"},
{"S... | 34.944444 | 89 | 0.245893 |
c8480bc7d3c83b174f2ce77bfd9f543b078ea12a | 258 | exs | Elixir | config/config.exs | appunite/jamdb_oracle | 1668e2d2d62dbe74bcf09ed49beec17c9700f892 | [
"MIT"
] | null | null | null | config/config.exs | appunite/jamdb_oracle | 1668e2d2d62dbe74bcf09ed49beec17c9700f892 | [
"MIT"
] | null | null | null | config/config.exs | appunite/jamdb_oracle | 1668e2d2d62dbe74bcf09ed49beec17c9700f892 | [
"MIT"
] | 2 | 2021-09-10T15:00:37.000Z | 2021-11-03T08:04:25.000Z | use Mix.Config
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
env_file = "#{Mix.env}.exs"
if Path.join("config", env_file) |> File.exists? do
import_config env_file
end
| 28.666667 | 68 | 0.75969 |
c848370bf73da667130bbce41fd5caf1504c5a72 | 3,377 | ex | Elixir | clients/dfa_reporting/lib/google_api/dfa_reporting/v35/model/directory_site.ex | renovate-bot/elixir-google-api | 1da34cd39b670c99f067011e05ab90af93fef1f6 | [
"Apache-2.0"
] | 1 | 2021-12-20T03:40:53.000Z | 2021-12-20T03:40:53.000Z | clients/dfa_reporting/lib/google_api/dfa_reporting/v35/model/directory_site.ex | swansoffiee/elixir-google-api | 9ea6d39f273fb430634788c258b3189d3613dde0 | [
"Apache-2.0"
] | 1 | 2020-08-18T00:11:23.000Z | 2020-08-18T00:44:16.000Z | clients/dfa_reporting/lib/google_api/dfa_reporting/v35/model/directory_site.ex | dazuma/elixir-google-api | 6a9897168008efe07a6081d2326735fe332e522c | [
"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... | 49.661765 | 238 | 0.711282 |
c84864a456e71e226eaef5852faa5458f55995a8 | 15,085 | ex | Elixir | clients/dfa_reporting/lib/google_api/dfa_reporting/v28/api/content_categories.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/api/content_categories.ex | matehat/elixir-google-api | c1b2523c2c4cdc9e6ca4653ac078c94796b393c3 | [
"Apache-2.0"
] | null | null | null | clients/dfa_reporting/lib/google_api/dfa_reporting/v28/api/content_categories.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... | 40.013263 | 615 | 0.671661 |
c848b27f16e25475efc5f72fbe7238cc30f70eeb | 1,343 | exs | Elixir | test/assertions/map/have_test.exs | MeneDev/espec | ec4b3d579c5192999e930224a8a2650bb1fdf0bc | [
"Apache-2.0"
] | 807 | 2015-03-25T14:00:19.000Z | 2022-03-24T08:08:15.000Z | test/assertions/map/have_test.exs | MeneDev/espec | ec4b3d579c5192999e930224a8a2650bb1fdf0bc | [
"Apache-2.0"
] | 254 | 2015-03-27T10:12:25.000Z | 2021-07-12T01:40:15.000Z | test/assertions/map/have_test.exs | MeneDev/espec | ec4b3d579c5192999e930224a8a2650bb1fdf0bc | [
"Apache-2.0"
] | 85 | 2015-04-02T10:25:19.000Z | 2021-01-30T21:30:43.000Z | defmodule Map.HaveTest do
use ExUnit.Case, async: true
defmodule SomeSpec do
use ESpec
defmodule TestStruct do
defstruct [:foo]
end
let map: %{foo: "bar"}
let struct: %TestStruct{foo: "bar"}
context "Success" do
it do: expect(map()) |> to(have({:foo, "bar"}))
it do: exp... | 27.408163 | 83 | 0.584512 |
c848c92ef71f9b3e9e44d4f8484d22bae463ad9b | 1,904 | exs | Elixir | test/stripe/subscriptions/plan_test.exs | Deepwalker/stripity_stripe | 8c091d4278d29a917bacef7bb2f0606317fcc025 | [
"BSD-3-Clause"
] | 2 | 2019-05-02T10:42:09.000Z | 2019-12-02T21:29:17.000Z | test/stripe/subscriptions/plan_test.exs | Deepwalker/stripity_stripe | 8c091d4278d29a917bacef7bb2f0606317fcc025 | [
"BSD-3-Clause"
] | null | null | null | test/stripe/subscriptions/plan_test.exs | Deepwalker/stripity_stripe | 8c091d4278d29a917bacef7bb2f0606317fcc025 | [
"BSD-3-Clause"
] | 1 | 2021-12-01T21:49:27.000Z | 2021-12-01T21:49:27.000Z | defmodule Stripe.PlanTest do
use Stripe.StripeCase, async: true
describe "create/2" do
test "creates a Plan for a customer" do
params = %{
amount: 5000,
currency: "usd",
id: "sapphire-elite",
interval: "month",
nickname: "Sapphire elite",
product: "abc_123"... | 27.594203 | 75 | 0.598214 |
c848d00c2610dacd86462617e84e3b525a99363b | 1,327 | ex | Elixir | lib/coherence/plugs/authorization/utils.ex | remigijusj/coherence | 36fe35b0bfe7ac63b44b4046f3ba62f2fe69603a | [
"MIT"
] | null | null | null | lib/coherence/plugs/authorization/utils.ex | remigijusj/coherence | 36fe35b0bfe7ac63b44b4046f3ba62f2fe69603a | [
"MIT"
] | null | null | null | lib/coherence/plugs/authorization/utils.ex | remigijusj/coherence | 36fe35b0bfe7ac63b44b4046f3ba62f2fe69603a | [
"MIT"
] | null | null | null | defmodule Coherence.Authentication.Utils do
@moduledoc false
import Plug.Conn
alias Coherence.Config
@param_key Application.get_env :coherence, :token_param_key, "param_key"
def param_key, do: @param_key
def assign_user_data(conn, user_data, key \\ :current_user) do
assign(conn, key, user_data)
end... | 25.037736 | 87 | 0.693293 |
c848d3cfa4b90350d445a51ad9150c8336ffdfc6 | 1,489 | exs | Elixir | bench.exs | ckampfe/vec | 5e3a6800882ada480a1d05ba338b3974e08b1bd3 | [
"BSD-3-Clause"
] | null | null | null | bench.exs | ckampfe/vec | 5e3a6800882ada480a1d05ba338b3974e08b1bd3 | [
"BSD-3-Clause"
] | null | null | null | bench.exs | ckampfe/vec | 5e3a6800882ada480a1d05ba338b3974e08b1bd3 | [
"BSD-3-Clause"
] | null | null | null | l = Enum.map(1..1000, fn i -> i end)
v = Vec.from_list(l)
ll = Enum.map(1..10_000, fn i -> i end)
vv = Vec.from_list(ll)
Benchee.run(
%{
"Vec.new()" => fn ->
Vec.new()
end,
"List prepend 1000" => fn ->
Enum.reduce(1..1000, [], fn i, acc ->
[i | acc]
end)
end,
"Vec.push... | 20.39726 | 64 | 0.478173 |
c848d8c9a1e6878455b83edd722344c0ab414b9e | 1,098 | ex | Elixir | apps/cam_web/lib/cam_web/binary_ws/direct_image_socket.ex | paulanthonywilson/mcam | df9c5aaae00b568749dff22613636f5cb92f905a | [
"MIT"
] | null | null | null | apps/cam_web/lib/cam_web/binary_ws/direct_image_socket.ex | paulanthonywilson/mcam | df9c5aaae00b568749dff22613636f5cb92f905a | [
"MIT"
] | 8 | 2020-11-16T09:59:12.000Z | 2020-11-16T10:13:07.000Z | apps/cam_web/lib/cam_web/binary_ws/direct_image_socket.ex | paulanthonywilson/mcam | df9c5aaae00b568749dff22613636f5cb92f905a | [
"MIT"
] | null | null | null | defmodule CamWeb.BinaryWs.DirectImageSocket do
@moduledoc """
Socket for "streaming" mjpeg from the camera to the locally connected browser.
"""
@behaviour Phoenix.Socket.Transport
require Logger
def child_spec(_) do
# Cargo culted from https://hexdocs.pm/phoenix/1.5.7/Phoenix.Socket.Transport.html
... | 24.954545 | 89 | 0.667577 |
c8490818046b3a6df2729def417aca5c657ab8d9 | 787 | exs | Elixir | test/game/format/npcs_test.exs | stevegrossi/ex_venture | e02d5a63fdb882d92cfb4af3e15f7b48ad7054aa | [
"MIT"
] | 2 | 2019-05-14T11:36:44.000Z | 2020-07-01T08:54:04.000Z | test/game/format/npcs_test.exs | nickwalton/ex_venture | d8ff1b0181db03f9ddcb7610ae7ab533feecbfbb | [
"MIT"
] | null | null | null | test/game/format/npcs_test.exs | nickwalton/ex_venture | d8ff1b0181db03f9ddcb7610ae7ab533feecbfbb | [
"MIT"
] | 1 | 2021-01-29T14:12:40.000Z | 2021-01-29T14:12:40.000Z | defmodule Game.Format.NPCsTest do
use ExUnit.Case
alias Game.Format.NPCs
doctest Game.Format.NPCs
describe "npc status line" do
setup do
npc = %{name: "Guard", extra: %{status_line: "[name] is here.", is_quest_giver: false}}
%{npc: npc}
end
test "templates the name in", %{npc: npc} ... | 29.148148 | 93 | 0.6277 |
c849118bece2ceb65abef4659b693a39771050fa | 13,433 | ex | Elixir | lib/mix/lib/mix/tasks/new.ex | kenichi/elixir | 8c27da88c70623cbe516d5310c885943395a82a2 | [
"Apache-2.0"
] | 1 | 2019-08-13T23:22:33.000Z | 2019-08-13T23:22:33.000Z | lib/mix/lib/mix/tasks/new.ex | kenichi/elixir | 8c27da88c70623cbe516d5310c885943395a82a2 | [
"Apache-2.0"
] | null | null | null | lib/mix/lib/mix/tasks/new.ex | kenichi/elixir | 8c27da88c70623cbe516d5310c885943395a82a2 | [
"Apache-2.0"
] | null | null | null | defmodule Mix.Tasks.New do
use Mix.Task
import Mix.Generator
@shortdoc "Creates a new Elixir project"
@moduledoc """
Creates a new Elixir project.
It expects the path of the project as argument.
mix new PATH [--app APP] [--module MODULE] [--sup] [--umbrella]
A project at the given PATH will be ... | 26.6 | 96 | 0.621752 |
c8494296078d2c65e09f5e73d6c2707321788e89 | 135 | ex | Elixir | lib/arrow_web/views/api/trip_short_name_view.ex | paulswartz/arrow | c1ba1ce52107c0ed94ce9bca2fef2bfeb606b8f9 | [
"MIT"
] | null | null | null | lib/arrow_web/views/api/trip_short_name_view.ex | paulswartz/arrow | c1ba1ce52107c0ed94ce9bca2fef2bfeb606b8f9 | [
"MIT"
] | 775 | 2019-11-18T16:23:57.000Z | 2022-03-28T18:20:04.000Z | lib/arrow_web/views/api/trip_short_name_view.ex | paulswartz/arrow | c1ba1ce52107c0ed94ce9bca2fef2bfeb606b8f9 | [
"MIT"
] | 1 | 2019-12-23T13:52:25.000Z | 2019-12-23T13:52:25.000Z | defmodule ArrowWeb.API.TripShortNameView do
use ArrowWeb, :view
use JaSerializer.PhoenixView
attributes([:trip_short_name])
end
| 19.285714 | 43 | 0.8 |
c8496cf75d971fa5f3c4c048189273edc01dafcf | 3,547 | ex | Elixir | lib/avrolixr/codec.ex | avvo/avrolixr | e5f5dd663597d2ab062ec9fea2d1da38897a4c42 | [
"MIT"
] | 3 | 2016-09-13T07:14:59.000Z | 2017-07-20T07:47:48.000Z | lib/avrolixr/codec.ex | avvo/avrolixr | e5f5dd663597d2ab062ec9fea2d1da38897a4c42 | [
"MIT"
] | 3 | 2016-10-12T21:24:11.000Z | 2017-06-29T08:35:55.000Z | lib/avrolixr/codec.ex | avvo/avrolixr | e5f5dd663597d2ab062ec9fea2d1da38897a4c42 | [
"MIT"
] | 5 | 2017-02-25T18:06:21.000Z | 2018-10-24T14:28:50.000Z | defmodule Avrolixr.Codec do
alias Avrolixr.Codec.Json
alias Avrolixr.Codec.Pairs
@type error_t :: {:error, String.t}
@type avro_t :: binary
@type schema_t :: String.t | map
@type type_t :: charlist
@type value_t :: any
@spec decode(avro_t) :: {:ok, value_t} | error_t
def decode(v_avro) do
case d... | 29.31405 | 109 | 0.646462 |
c8498506b8b39a88317c321a1617ee67790f5d9a | 57 | ex | Elixir | lib/empty_web/views/page_view.ex | manojsamanta/empty-app-with-auth | e601a7c6ef1b4a992758117e6bf0922a5ce08f04 | [
"MIT"
] | null | null | null | lib/empty_web/views/page_view.ex | manojsamanta/empty-app-with-auth | e601a7c6ef1b4a992758117e6bf0922a5ce08f04 | [
"MIT"
] | null | null | null | lib/empty_web/views/page_view.ex | manojsamanta/empty-app-with-auth | e601a7c6ef1b4a992758117e6bf0922a5ce08f04 | [
"MIT"
] | null | null | null | defmodule EmptyWeb.PageView do
use EmptyWeb, :view
end
| 14.25 | 30 | 0.789474 |
c849989dcc2ed49a5b1eae36ad956bc04135a94f | 609 | exs | Elixir | experiments/elixir_middleman_server/mix.exs | cjschneider2/Novluno | b1cbc13d1a0c83e81abf01ba1e2f257ad7a5a025 | [
"Unlicense"
] | 12 | 2017-07-05T03:05:56.000Z | 2021-04-30T23:17:36.000Z | experiments/elixir_middleman_server/mix.exs | cjschneider2/Novluno | b1cbc13d1a0c83e81abf01ba1e2f257ad7a5a025 | [
"Unlicense"
] | 4 | 2017-06-29T05:41:45.000Z | 2021-03-17T00:23:55.000Z | experiments/elixir_middleman_server/mix.exs | cjschneider2/Novluno | b1cbc13d1a0c83e81abf01ba1e2f257ad7a5a025 | [
"Unlicense"
] | 5 | 2019-02-07T04:15:37.000Z | 2021-03-10T03:16:29.000Z | defmodule RmServer.Mixfile do
use Mix.Project
def project do
[
app: :rm_server,
version: "0.1.0",
elixir: "~> 1.5",
start_permanent: Mix.env == :prod,
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_appli... | 20.3 | 88 | 0.576355 |
c8499bed225bd67dcab7637b7cb68c789eae5286 | 98 | ex | Elixir | code examples/example-15-6.ex | kujua/erlang-elixir-imperative-bookcompanion | 7bc9f033bacd0f8744ec6bcee3932794d594fe69 | [
"Apache-2.0"
] | 8 | 2016-08-14T12:35:16.000Z | 2021-01-26T04:05:31.000Z | code examples/example-15-6.ex | kujua/erlang-elixir-imperative-bookcompanion | 7bc9f033bacd0f8744ec6bcee3932794d594fe69 | [
"Apache-2.0"
] | null | null | null | code examples/example-15-6.ex | kujua/erlang-elixir-imperative-bookcompanion | 7bc9f033bacd0f8744ec6bcee3932794d594fe69 | [
"Apache-2.0"
] | 5 | 2016-08-18T22:12:19.000Z | 2020-02-17T18:52:41.000Z | iex(1)> num = 3
3
iex(2)> Macro.to_string(quote do rem(unquote(num),2) == 0 end)
"rem(3, 2) == 0"
| 19.6 | 62 | 0.591837 |
c849c4c143c2f46b59f1009aebbd8d9af304b4c2 | 986 | ex | Elixir | test/support/channel_case.ex | kh0r/phoenix_sample | 73fd0de067f966b712e70dfdcc1539c1ea2107a3 | [
"MIT"
] | null | null | null | test/support/channel_case.ex | kh0r/phoenix_sample | 73fd0de067f966b712e70dfdcc1539c1ea2107a3 | [
"MIT"
] | null | null | null | test/support/channel_case.ex | kh0r/phoenix_sample | 73fd0de067f966b712e70dfdcc1539c1ea2107a3 | [
"MIT"
] | null | null | null | defmodule PhoenixSample.ChannelCase do
@moduledoc """
This module defines the test case to be used by
channel tests.
Such tests rely on `Phoenix.ChannelTest` and also
imports other functionality to make it easier
to build and query models.
Finally, if the test case interacts with the database,
it cann... | 23.47619 | 72 | 0.707911 |
c849c860dd4d311027e7566d760aa94032e29aad | 2,143 | ex | Elixir | lib/ex_sdp/attribute/rtp_mapping.ex | membraneframework/membrane-protocol-sdp | 4cb3028d62a722e364196b58b73732567306a931 | [
"Apache-2.0"
] | null | null | null | lib/ex_sdp/attribute/rtp_mapping.ex | membraneframework/membrane-protocol-sdp | 4cb3028d62a722e364196b58b73732567306a931 | [
"Apache-2.0"
] | 1 | 2020-07-31T10:37:43.000Z | 2020-08-10T09:22:13.000Z | lib/ex_sdp/attribute/rtp_mapping.ex | membraneframework/membrane-protocol-sdp | 4cb3028d62a722e364196b58b73732567306a931 | [
"Apache-2.0"
] | null | null | null | defmodule ExSDP.Attribute.RTPMapping do
@moduledoc """
This module represents RTP mapping.
"""
use Bunch.Access
alias ExSDP.Utils
@enforce_keys [:payload_type, :encoding, :clock_rate]
defstruct @enforce_keys ++ [:params]
@type t :: %__MODULE__{
payload_type: 96..127,
encoding: bin... | 33.484375 | 106 | 0.659356 |
c84a05622d54090b1bae62732df8c6de3cfd290f | 1,811 | ex | Elixir | clients/domains/lib/google_api/domains/v1alpha2/model/list_locations_response.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2021-12-20T03:40:53.000Z | 2021-12-20T03:40:53.000Z | clients/domains/lib/google_api/domains/v1alpha2/model/list_locations_response.ex | pojiro/elixir-google-api | 928496a017d3875a1929c6809d9221d79404b910 | [
"Apache-2.0"
] | 1 | 2020-08-18T00:11:23.000Z | 2020-08-18T00:44:16.000Z | clients/domains/lib/google_api/domains/v1alpha2/model/list_locations_response.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... | 36.22 | 169 | 0.740475 |
c84a0967a42f33ed1ee02c37936b4db1c600dd1f | 296 | exs | Elixir | test/nostrum/cache/guild_cache_test.exs | chakrit/nostrum | f0ce383d06bb3bb1786ff0464c95cbd757d38f1f | [
"MIT"
] | null | null | null | test/nostrum/cache/guild_cache_test.exs | chakrit/nostrum | f0ce383d06bb3bb1786ff0464c95cbd757d38f1f | [
"MIT"
] | null | null | null | test/nostrum/cache/guild_cache_test.exs | chakrit/nostrum | f0ce383d06bb3bb1786ff0464c95cbd757d38f1f | [
"MIT"
] | null | null | null | defmodule Nostrum.Cache.GuildCacheTest do
use ExUnit.Case
alias Nostrum.Cache.GuildCache
alias Nostrum.Struct.Guild
setup_all do
:ets.new(GuildCache.tabname(), [:set, :public, :named_table])
assert true = GuildCache.create(%Guild{id: 0})
:ok
end
doctest GuildCache
end
| 19.733333 | 65 | 0.719595 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.