profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/josevalim/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
José Valim josevalim @dashbitco Kraków, Poland https://dashbit.co/ Chief Adoption Officer at @dashbitco. Creator of @elixir-lang.

elixir-nx/nx 1541

Multi-dimensional arrays (tensors) and numerical definitions for Elixir

elixir-ecto/postgrex 854

PostgreSQL driver for Elixir

aaronrenner/phx_gen_auth 803

An authentication system generator for Phoenix 1.5 applications.

josevalim/enginex 450

An executable which creates a bare Rails 3 engine (which is used in Crafting Rails Applications)

elixir-ecto/db_connection 239

Database connection behaviour

elixir-makeup/makeup 120

Syntax highlighter for elixir inspired by Pygments

asaaki/cmark.ex 88

💧 Elixir NIF for cmark (C), a parser library following the CommonMark spec, a compatible implementation of Markdown.

devinus/markdown 83

A simple Elixir Markdown to HTML conversion library

elixir-plug/mime 72

A read-only and immutable MIME type module for Elixir

pull request commentphoenixframework/phoenix

Unix default hashing algorithm changed in #4471

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

kgautreaux

comment created time in 7 hours

push eventphoenixframework/phoenix

Keith Gautreaux

commit sha fda6ab1b2caab1c4c2a8e52d4e3d0e8769b9ab19

Unix default hashing algorithm changed in #4471 (#4486) This just syncs the documentation with the PR from @goncalotomas in #4471

view details

push time in 7 hours

PR merged phoenixframework/phoenix

Unix default hashing algorithm changed in #4471

This just syncs the documentation with the PR from @goncalotomas in #4471

+1 -1

0 comment

1 changed file

kgautreaux

pr closed time in 7 hours

issue commentdashbitco/broadway

Resize broadway pipeline

Not quite. You still need to go through the rest of the pipeline and tell them to subscribe to the new processors. Sizing down has its own challenges as you need to subscribe, drain, and then terminate. To be clear, it is all doable, but it is a sizeable amount of work and testing.

fcevado

comment created time in 7 hours

issue commentphoenixframework/phoenix_live_view

Allow MFArgs for on_mount hooks

I think we can call it arg, as in on_mount(arg, params, session, socket), since it is not really optional.

mcrumm

comment created time in 7 hours

issue commentphoenixframework/phoenix_live_view

Allow MFArgs for on_mount hooks

I am rethinking this and I think we should go with on_mount M and on_mount {M, arg} and always call on_mount/4. It is the cleanest API and in the docs we will say this:

Tip: if you need to define multiple `on_mount` callbacks, avoid
defining multiple modules. Instead, a tuple and pattern matching
to handle different cases:

    def on_mount(:admin, _, _, _) do
    end

    def on_mount(:user, _, _, _) do
    end

And then invoke it as:

    on_mount {M, :admin}
    on_mount {M, :user}

This is not really different from defining multiple functions. We keep the API clean and concise.

mcrumm

comment created time in 8 hours

pull request commentelixir-ecto/ecto

feat(Ecto.Schema): Add option to skip validations for default values

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

tomciopp

comment created time in 9 hours

push eventelixir-ecto/ecto

Thomas Cioppettini

commit sha 3bc87559c691acc321ff3d5ebcc96a55de6388a4

feat(Ecto.Schema): Add option to skip validations for default values (#3749)

view details

push time in 9 hours

PR merged elixir-ecto/ecto

feat(Ecto.Schema): Add option to skip validations for default values

@josevalim Addresses Issue #3747. Let me know if you need any additional changes or want to add documentation for this feature.

+24 -3

3 comments

2 changed files

tomciopp

pr closed time in 9 hours

pull request commentelixir-lang/elixir

Ignore `MIX_TEST_PARTITION` when partitions set to 1

Looks great! Just one comment and please add a mention to the docs and we are good to go!

hauleth

comment created time in 9 hours

Pull request review commentelixir-lang/elixir

Ignore `MIX_TEST_PARTITION` when partitions set to 1

 defmodule Mix.Tasks.Test do     cover =       if opts[:cover] do         compile_path = Mix.Project.compile_path(project)-        partition = opts[:partitions] && System.get_env("MIX_TEST_PARTITION")+        partition = opts[:partitions] > 1 && System.get_env("MIX_TEST_PARTITION")

Maybe we should Delete the option if it is set to 1 so we don’t have to handle it elsewhere?

hauleth

comment created time in 10 hours

PullRequestReviewEvent

issue commentelixir-lang/elixir

`mix xref trace` wrong line #

This is not an Elixir bug. Phoenix collects the modules and generates functions calls in a @before_compile callback. All code in such callback without line gets the module line (cause we don’t have anything else). We may need to fix this in Plug and Phoenix. I will leave this open so I don’t forget to explore this.

marcandre

comment created time in 11 hours

pull request commentdashbitco/nimble_totp

Prevent code reuse

Looks great! :heart: I have added some minor comments.

jeroenvisser101

comment created time in 12 hours

Pull request review commentdashbitco/nimble_totp

Prevent code reuse

 defmodule NimbleTOTP do   In this example by validating first against the current time, but also against 30 seconds   ago, we allow the _previous_ code, to be still valid.   """+  @spec valid?(binary(), [option() | validate_option()]) :: boolean()   def valid?(secret, otp, opts \\ [])    def valid?(secret, <<a1, a2, a3, a4, a5, a6>>, opts) do     <<e1, e2, e3, e4, e5, e6>> = verification_code(secret, opts)      (bxor(e1, a1) ||| bxor(e2, a2) ||| bxor(e3, a3) ||| bxor(e4, a4) ||| bxor(e5, a5) |||-       bxor(e6, a6)) === 0+       bxor(e6, a6)) === 0 and not reused?(opts)   end    def valid?(_secret, _otp, _opts), do: false++  @spec reused?([option() | validate_option()]) :: boolean()+  defp reused?(opts) do+    if since = opts |> Keyword.get(:since) |> to_unix() do+      time = opts |> Keyword.get(:time, System.os_time(:second)) |> to_unix()+      period = Keyword.get(opts, :period, @default_totp_period)++      Integer.floor_div(time, period) <= Integer.floor_div(since, period)+    else+      false+    end+  end++  @spec to_unix(nil) :: nil+  defp to_unix(nil), do: nil++  defp to_unix(%NaiveDateTime{} = naive_date_time),+    do: naive_date_time |> DateTime.from_naive!("Etc/UTC") |> to_unix()++  @spec to_unix(Calendar.datetime()) :: integer()+  defp to_unix(+         %{+           calendar: _calendar,+           year: _year,+           month: _month,+           day: _day,+           hour: _hour,+           minute: _minute,+           second: _second,+           microsecond: _microsecond+         } = date_time+       ),+       do: DateTime.to_unix(date_time)

I would just match on the struct here too:

  defp to_unix(%DateTime{} = date_time),
    do: DateTime.to_unix(date_time)

I don't think we need to make the code as generic as Elixir's stdlib :)

jeroenvisser101

comment created time in 12 hours

PullRequestReviewEvent

Pull request review commentdashbitco/nimble_totp

Prevent code reuse

 defmodule NimbleTOTP do   In this example by validating first against the current time, but also against 30 seconds   ago, we allow the _previous_ code, to be still valid.   """+  @spec valid?(binary(), [option() | validate_option()]) :: boolean()   def valid?(secret, otp, opts \\ [])    def valid?(secret, <<a1, a2, a3, a4, a5, a6>>, opts) do     <<e1, e2, e3, e4, e5, e6>> = verification_code(secret, opts)      (bxor(e1, a1) ||| bxor(e2, a2) ||| bxor(e3, a3) ||| bxor(e4, a4) ||| bxor(e5, a5) |||-       bxor(e6, a6)) === 0+       bxor(e6, a6)) === 0 and not reused?(opts)   end    def valid?(_secret, _otp, _opts), do: false++  @spec reused?([option() | validate_option()]) :: boolean()+  defp reused?(opts) do+    if since = opts |> Keyword.get(:since) |> to_unix() do+      time = opts |> Keyword.get(:time, System.os_time(:second)) |> to_unix()+      period = Keyword.get(opts, :period, @default_totp_period)++      Integer.floor_div(time, period) <= Integer.floor_div(since, period)+    else+      false+    end+  end++  @spec to_unix(nil) :: nil+  defp to_unix(nil), do: nil++  defp to_unix(%NaiveDateTime{} = naive_date_time),+    do: naive_date_time |> DateTime.from_naive!("Etc/UTC") |> to_unix()
    do: NaiveDateTime.diff(naive_date_time, ~N[1970-01-01 00:00:00])
jeroenvisser101

comment created time in 12 hours

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentdashbitco/nimble_totp

Prevent code reuse

 defmodule NimbleTOTP do   In this example by validating first against the current time, but also against 30 seconds   ago, we allow the _previous_ code, to be still valid.   """+  @spec valid?(binary(), [option() | validate_option()]) :: boolean()   def valid?(secret, otp, opts \\ [])    def valid?(secret, <<a1, a2, a3, a4, a5, a6>>, opts) do     <<e1, e2, e3, e4, e5, e6>> = verification_code(secret, opts)

What do you think about a verification_code/3 that receives the time and the period, so we don't need to parse it in verification_code and then again inside reused??

jeroenvisser101

comment created time in 12 hours

Pull request review commentdashbitco/nimble_totp

Prevent code reuse

 defmodule NimbleTOTP do   @doc """   Checks if the given `otp` code matches the secret. -  It accepts the same options as `verification_code/2`.+  ## Options+    * :time - The time to be used. Default is `System.os_time(:second)`+    * :since - The time to prevent previous code from being used before
    * :since - The last time the secret was used. Recommended to be given to avoid token reuse
jeroenvisser101

comment created time in 12 hours

PullRequestReviewEvent

Pull request review commentdashbitco/nimble_totp

Prevent code reuse

 defmodule NimbleTOTP do   @doc """   Checks if the given `otp` code matches the secret. -  It accepts the same options as `verification_code/2`.+  ## Options
  ## Options

Nit for consistency. :)

jeroenvisser101

comment created time in 12 hours

PullRequestReviewEvent

Pull request review commentdashbitco/nimble_totp

Prevent code reuse

 defmodule NimbleTOTP do    ## Options -    * :time - The time in unix format to be used. Default is `System.os_time(:second)`+    * :time - The time to be used. Default is `System.os_time(:second)`

Let's document them, yeah. :)

jeroenvisser101

comment created time in 12 hours

PullRequestReviewEvent

Pull request review commentphoenixframework/plds

Add CLI and batteries to PLDS

 defmodule PLDS.MixProject do   def application do     [       mod: {PLDS.Application, []},-      extra_applications: [:logger, :runtime_tools]+      extra_applications: [:logger, :runtime_tools, :os_mon, :inets]

What do we need inets for? 🤔

philss

comment created time in 12 hours

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentphoenixframework/plds

Add CLI and batteries to PLDS

 defmodule PLDSWeb.Router do    scope "/" do     pipe_through [:fetch_session, :protect_from_forgery]-    live_dashboard "/", metrics: PLDSWeb.Telemetry++    get "/health", PLDSWeb.HealthController, :index++    live_dashboard "/",+      metrics: PLDSWeb.Telemetry,

We can nuke the telemetry stuff I think. Can we set it to false or something to disable the page altogether?

philss

comment created time in 12 hours