Incident 0.4.1 released for Event Sourcing and CQRS

Just published Incident version 0.4.1 for Event Sourcing and CQRS, check it out https://hex.pm/packages/incident #myelixirstatus

Implementing a custom ExUnit assert to test PDF output

I went on and implemented my custom ExUnit assert to visually vet PDF output.

Simple Phoenix LiveView App: Markdown show notes

Part 10 of the Simple Phoenix LiveView App series

It covers setting up an enhanced version of Markdown for editing show notes, and sanitize user-entered content.

https://alchemist.camp/episodes/phoenix-markdown-show-notes

Announced the Domo library's first release during the lightning talk at the ElixirConf EU Virtual

The library is to model a business domain with type-safe structs and composable tagged tuples.

Now a new valid way to have type-safe structs at the runtime is available:

defmodule Order do
  use Domo

  typedstruct do
    field :id, integer
    field :item, String.t(), default: "mixed fruits"
    field :quantity, float
  end

  # the new!/1 constructor function is generated automatically
end
iex(1)> Order.new!(id: "twenty one", quantity: 20)
** (ArgumentError) Can't construct %Order{...} with new!([id: "twenty one", quantity: 20])
    Unexpected value type for the field :id. The value "twenty one" doesn't match the integer type.
    Unexpected value type for the field :quantity. The value 20 doesn't match the float type.

iex(2)> Order.new!(%{id: 125, item: "banana", quantity: 20.5})      
%Order{id: 125, item: "banana", quantity: 20.5}

It was awesome!

https://hex.pm/packages/domo

https://github.com/IvanRublev/Domo

Please, give it a try, and star on the GitHub if you like it or hate it 😀

How to use Elixir LS with Vim

I’ve updated my article “How to use Elixir LS with Vim” to reflect the recent updates to Elixir LS and ALE.

https://www.mitchellhanberg.com/post/2018/10/18/how-to-use-elixir-ls-with-vim/

The beauty of recursion and pattern matching in functional programming languages


or how to write full-featured functions with ZERO INSTRUCTIONS about HOW it should work!

https://dev.to/ericdouglas/the-beauty-of-recursion-and-pattern-matching-in-functional-programming-languages-hmn

Elixir Wizards S4E5 Dave Thomas on Learning How Things Work

Latest episode of Elixir Wizards is out today! Check it out here: https://smartlogic.io/podcast/elixir-wizards/s4e5-thomas/

Create mocks of erlang modules with elixir_mock v0.2.9

Version 0.2.9 of the elixir_mock library now allows you to create mocks from erlang modules like :erlang and :inet.

test "should create simple mocks from erlang modules" do
    mock = mock_of :erlang
    assert mock.self() == nil
end

test "should create custom mocks from erlang modules" do
    with_mock(mock) = defmock_of :inet do
      def ip(_), do: :fake_ip
    end
    assert mock.ip(nil) == :fake_ip
end

`Blocked` released! Keep track of when hotfixes can be removed

Blocked is an Elixir-library that helps you to keep track of when hotfixes can be removed by showing compile-time warnings when issues (in your project repository or any other source-code GitHub repository) are closed.

hex.pm version Build Status Documentation


Blocked was made to improve the quality of your project’s code over time: It automates away the human task of checking whether certain hot-fixes, ‘temporary patches’ or ‘duct-tape code’ are still required. This makes it less scary to add a temporary workaround to your codebase, because you’ll know the minute it is no longer necessary!

Basic features:

  • Runs at compile-time as a macro.
  • Prints a compile-time warning any time an issue is closed that a piece of your code was waiting for.
  • Works for your own project issues as well as for issues of any other GitHub-hosted repository.
  • Allows specifying both ‘hotfix’ and optionally a ‘desired’ code block, to make it clear to future readers of your code what can be changed once the related issue is closed.
  • Configurable to work on private repositories as well.
  • By default performs only checking in Continuous Integration, to keep local compilation fast.

Simple usage example

defmodule Example do
  require Blocked

  def main do
    IO.puts("Hello, world!")
    Blocked.by("#42", "This code can be removed when the issue is closed") do
      hacky_workaround()
    end
    
    # The reason is optional
    Blocked.by("#69") do
      a_quick_fix()
    end
    
    # It is possible to indicate
    # the desired 'ideal' code as well, by passing an `else` block:
    Blocked.by("#1337") do
      ugly_fallback()
    else
      beautiful_progress()
    end
    
    # If the blockage is more general, you can also leave out the `do` block.
    Blocked.by("#65535", "This whole module can be rewritten once we're on the new Elixir version!")
    
    # Blocked supports many ways of referring to an issue
    Blocked.by("#13")
    Blocked.by("elixir#13")
    Blocked.by("elixir/13")
    Blocked.by("elixir-lang/elixir#13")
    Blocked.by("elixir-lang/elixir/13")
    Blocked.by("https://github.com/elixir-lang/elixir/issues/13")
  end
end

Find it on GitHub and talk about it on the Elixir Forum! :-)

ThinkingElixir 001: News and Meet the Hosts

First episode of the Thinking Elixir Podcast! We cover recent community news and introduce the hosts. We discuss pattern matching, immutability, supervision trees, and concurrency as things that captured our attention when coming to Elixir. Mark Ericksen was a long time host of the Elixir Mix podcast and launched a new show. Check it out!

Podcast Episode

Correios CEP 0.6.0 released! Remove zipcode field and update HTTPoison.

Correios CEP allows to find Brazilian addresses by postal code, directly from Correios API. No HTML parsers.

DEPRECATION NOTE

Correios.CEP.Address.zipcode was removed in the version 0.6.0. Use Correios.CEP.Address.postal_code instead.

Changelog for version 0.6.0:

Changed

  • Update HTTPoison to 1.17.0 (hackeny 1.16.0)

Deprecated

  • The field zipcode in Correios.CEP.Address. Use the field postal_code instead.

Removed

  • Support for OTP 20.

Check it out at:

Should you use database transactions for data consistency?

In our systems, most business actions require changes across multiple contexts. How can we keep these contexts consistent?

https://patrykbak.com/2020/04/15/should-you-use-database-transactions-for-data-consistency.html

Blog post: "More than one thing at a time"

Wrote about performance and about tech stacks and their potentials. Mostly Elixir versus other popular high-level runtimes (Python, Ruby, Node.js).

https://underjord.io/more-than-one-thing-at-a-time.html

Simple Phoenix LiveView App: Fonts, logos and sass

Part 9 of the Simple Phoenix LiveView App series

It covers setting up SASS, custom fonts and logos

https://alchemist.camp/episodes/phoenix-markdown-fonts-logos

ElixirMix Podcast 096: Sharing Protobuf Schemas with Andrea Leopardi

In this episode of ElixirMix, we talk with Andrea Leopardi about how they solved sharing Protobuf protocols across multiple projects for their RabbitMQ consumers. We also learn the benefits they found of using Elixir in a microservices architecture, the benefits they got from Broadway and much more!

Podcast Episode

Fetch web pages and all assets with Dust

Introducing Dust it allows you to fetch web pages with all assets and embed in a single HTML file

GitHub: https://github.com/imanhodjaev/dust

Hex: https://hex.pm/packages/dust

Inspired by https://github.com/Y2Z/monolith but different.

It is still under development.

gen_rmq 3.0.0 version release

GenRMQ is a set of behaviours meant to be used to create RabbitMQ consumers and publishers.

Changelog:

  • Custom deadletter exchange type
  • Updated telemetry events
  • Bump amqp from 1.2.1 to 1.4.2
  • Bump min supported elixir version to 1.8
  • Task Supervisor for message consumers

It is a major release, which contains non-backward compatible changes. Please check how to migrate to version 3.0.0 from older versions: https://github.com/meltwater/gen_rmq/blob/master/documentation/migrations/3.0.0.md

Kudos to @akoutmos, @Shemeikka, @spier, and @vorce for making it possible.

Simple Phoenix LiveView App: Upgrade LiveView to v0.8.1

Part 8 of the Simple Phoenix LiveView App series.

It covers upgrading LiveView from v0.4.1 to v0.8.1.

https://alchemist.camp/episodes/phoenix-live-view-upgrade-0.8.1

Ecto embeds have IDs by default

While working with JSONB and Ecto I found out that even a <a href=”https://nts.strzibny.name/ecto-cast-embed-id/“>single embed have an ID</a> by default (as far as Ecto is concerned).

Elixir Berlin Meetup June Remote Edition

https://youtu.be/gBMfjq_gXuw

“I used mix built-in releases and you won’t believe what happened next” by Guilherme

“APA : Arbitrary Precision Arithmetic - pure Elixir implementation” by Ralph

Previous page Next page