How Phoenix Live Reload works behind the scene?

I wrote a blog post explaining the internals of how Phoenix Live Reload works:

https://shankardevy.com/code/phoenix-live-reload/

For the brave ones, I have 3 challenge questions towards the end of the post. Will be happy to see devs solve them :-)

Use Context in Phoenix

Refactor my application to use Context.

https://github.com/co0lsky/deep-work-hours-phoenix/commit/2d290265ad4b017d4399145ebfa87ea215a4aae1

A couple of blog posts about the fundamentals

I wrote a couple of blog posts that are seemingly as basic as they come but I dug a little deeper than you’d expect. :)

IntelliJ Elixir v11.6.0

Changelog

Enhancements

  • Treat .leex files as .eex files, so same features apply to both.
  • Switch build to GitHub Actions.
  • Update build to IntelliJ IDEA 2020.1

Bug Fixes

  • Swap improperly sized General.QuestionDialog icon for RunConfigurations.TestUnknown icon for Unknown icon in Structure View.

  • Fix MODULENAME variable in defm live template, so that the file name is camel-cased before being capitalized.

  • Update README.md about information for Goland IDE since has been released for awhile and no longer only an EAP.

  • Restore canary builds being published to JetBrains Marketplace.

  • JetBrains IDEs 2020.1 compatibility

    • Change obsolete references to AllocIcons in Icons to new ones in AlllIcons that are recommended in documentation.

    • Update to @NotNull annotation on PsiElementVisitor

      • DepGatherer
      • QuotableImpl.quote
    • Fix tests for IDEA 2020.1.

    • Get ProjectImportProvider builder in doGetBuilder instead of constructor.

      Fixes use of deprecated constructor dependency injection that is incompatible with dynamic, injectable plugins in 2020.1.

      com.intellij.diagnostic.PluginException: getComponentAdapterOfType is
      used to get org.elixir_lang.mix.project._import.Builder(
        requestorClass=org.elixir_lang.mix.project._import.Provider,
        requestorConstructor=protected org.elixir_lang.mix.project._import.Provider(org.elixir_lang.mix.project._import.Builder)
      ).
      Probably constructor should be marked as NonInjectable. [Plugin: org.elixir_lang]
  • Allow underscores in binary (0b), octal (0o) , and hexadecimal (0x) numbers.

Installation Instructions

Live Elixir Wizards Betweenisode recording today at 11AM EDT

Special live episode recording today at 11AM EDT - with many special guests including the Elixir Outlaws, Dave Thomas, Meryl Dakin, Saša Jurić, the Freezes, Frank Hunleth, and lots more!

https://www.twitch.tv/smartlogictv

ExUnited - Easily spawn Elixir supervising nodes within ExUnit tests

ExUnited  is a Hex package designed to easily facilitate spawning  supervising  local Elixir nodes within tests. Unfortunately, I was not able to properly setup a spawned node for supervisioning with the Erlang  :slave.start_link/1  function. So I have written  ExUnited  to accomplish that, along with supporting  Mix.Config  configurations, additional loaded code, and a developer friendly way of writing assertions and refutations in the context of a spawned node which really improved the readability of the tests and more.

Features

  • Spawn nodes for testing purposes
  • Spin up “partially connected” vs “fully connected” nodes
  • Run in “verbose” mode which prints a colorized STDOUT of the nodes
  • Specify extra “code paths” which will be included ( config.exs  included)
  • Support child supervisioning within a spawned node
  • Exclude certain dependencies for spawned nodes
  • Easily assert and refute within the context of spawned nodes

Example

defmodule MyNodeClusterTest do
  use ExUnited.Case

  setup do
    {:ok, spawned} =
      ExUnited.spawn(
        david: [code_paths: ["test/nodes/beckham"], supervise: [David]]
      )

    on_exit(fn ->
      ExUnited.teardown()
    end)

    spawned
  end

  test "executes code in spawned node", spawned do
    assert :"captain@127.0.0.1" = Node.self()
    refute :"david@127.0.0.1" == Node.self()
    sentence = "The only time you run out of chances is when you stop taking them."

    as_node(:david, phrase: sentence) do
      assert :"david@127.0.0.1" = Node.self()
      refute :"captain@127.0.0.1" == Node.self()
      assert ^phrase = David.talk()

      foo = :bar
      refute match?(%{node: ^foo}, %{node: :foo})
    end
  end
end

See full example.

Enjoy the package! I would love to receive a shoutout and/or your feedback ;)

AyeSQL: Writing Raw SQL in Elixir

A small tutorial on how, why and when to use raw SQL, as well as giving some examples using Ecto and AyeSQL.

AyeSQL: Writing Raw SQL in Elixir

Deploying to Gigalixir Tutorial

Gigalixir is Elixir’s Platform as a Service. In this episode we create and deploy a new Elixir application with Gigalixir.

https://elixircasts.io/deploying-with-gigalixir-(revised)

Custom IEx Prompt : Elixir

You might be bored being locked down and using the same default IEx prompt. Let’s turn our boredom interesting by decorating IEx look out.

Check out the Setup and Installation

https://medium.com/@blackode/custom-iex-prompt-elixir-c95b7f5bf8c3 Article Image

Simple Elixir wrapper for Covid Tracking API

A simple Elixir wrapper for https://covidtracking.com/api:https://github.com/TheFirstAvenger/covidtracking_dot_com_api

gen_rmq 2.6.0 version release

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

Changelog:

With the redesigned queue configuration options, users have bigger flexibility in creating their desired consumer setup. This includes support for quorum queues as well. Check our documentation to learn more: https://github.com/meltwater/gen_rmq#documentation

Files watcher and compiler for elixir projects (only: :dev) 😉

Lettuce is a generic server process that checks the files within an elixir project that has lettuce as a dependency and then runs iex -S mix. It initialises the state of the generic server with the .ex files inside lib and their last modified time.

https://github.com/gilacost/lettuce

Elixir Wizards S3E19 Season Three Wrap and Remote Work Tips

Final episode of the Elixir Wizards Podcast third season. Check it out here: https://podcast.smartlogic.io/s3e19-season-wrap

Simple DIY Persistence for Mailgun

We created and open sourced a small tool to persist events from Mailgun, since the retention they offer is expensive. Mailgun boost a fantastic tool, we just wanted simple logging in case we needed it. Fork, run the source or use the docker container.

https://jackjoe.be/articles/mailgun-logger/

For comprehensions in Elixir

Going beyond simple mapping - a refresher on comprehensions and what they can do.

https://www.pompecki.com/post/for-comprehensions/

Looking for help maintaing Ace, an Elixir HTTP Server

https://elixirforum.com/t/help-maintaining-elixir-http-2-server-nearly-at-1-0-release/30279

I’m not able to spend as much time looking after Ace as I would like and am looking for some help.

Share my Elixir journey in GO.Exchange

GO.Exchange is a cryptocurrency exchange which adopt Elixir in production. I’ve worked on this product for almost 2 years. I think would benefit to share what I’ve learnt in this journey.

https://medium.com/@theesit/my-elixir-journey-in-go-exchange-3d9934e53790

mix.el - new Emacs Minor Mode for Mix

I’ve been using alchemist and its built-in functions to work with mix tasks from Emacs: to execute a specific test, to execute tests in a file, to list all tasks etc. They work ok if you don’t work with umbrella apps. Umbrella project is an application split into multiple subprojects. alchemist uses custom Elixir app under the hood. This Elixir app is initialized only for a specific application. So it’s either initialized for a subproject or an umbrella project. Maybe there are customizable variables that allow you to work with umbrella projects and subprojects at the same time but I couldn’t find any.

I spend my days writing Elixir code and sometimes I want to execute a Mix task from the root directory for the whole project (for example, to run a credo check) and sometimes I want to execute a task from a subproject (for example, to fetch deps only for this subproject). mix.el allows you to do it. Also, it allows you to add additional parameters before executing a mix task.

ElixirMix Podcast 091: Managing Change with Ecto and David Bernheisel

In this episode of ElixirMix, we talk with David Bernheisel about the power in Ecto. Coming from ActiveRecord, Ecto and Changesets were a wonderful alternative! We cover David’s blog post where he shares tips and tricks for working with Changesets. We cover, Ecto.Multi, how to compose Changesets, “embedded” schemas, and much more!

Podcast Episode

Single Sign On Auth with Pow Assent

https://youtu.be/eic29sMwdJ4

Create an Elixir app that authenticates users with Strava as an OAuth2 provider, and lists users recent activities by making requests against Strava’s API.

Previous page Next page