ElixirMock: Inspectable mocks based on real elixir modules.

ElixirMock is new library for creating inspectable mocks based on real elixir modules for testing.

ElixirMock’s mocks have the same api as the modules they are created from and are:

  • Easy to create from already-defined modules
  • Do not modify or replace the modules they are based on
  • Are independent of each other
  • Allow you to inspect calls made to them, and much more!

See the Getting started guide for a gentle introduction. API docs available here

Guide to setting up HTTP/2.0 with Ace server

Ace 0.10.0 introduces support for HTTP/2 with the following features.

  • Stream isolation; one process per stream
  • Bidirectional streaming; stream data too and from clients
  • TLS(SSL) support via ALPN; data encrypted in transit
  • Raxx interface; simplicitfy for request/response interactions

https://hexdocs.pm/ace/getting_started.html

Sobelow, the Phoenix vulnerability scanner - v0.4.1

Changes include:

  • Save settings in a config file
  • JSON output formatting
  • Fuzzy finding for secrets
  • Bug fixes and improvements

Install the latest update with mix archive.install hex sobelow

https://github.com/nccgroup/sobelow

Shameless plug: Check out @elixirstatus' other community project:

Credo, a new static code analysis tool that acts as a code linter, but also focusses on teaching coding practices and code consistency.

Recurring Tasks in Elixir

Carrying out recurring tasks is a common undertaking for any web application. Follow along with this article to build a recurring task in pure Elixir. 🍉

Creating slugs for Ecto schemas

This article covers a process of creating slugs for Ecto models with different use cases. https://medium.com/wemake-services/creating-slugs-for-ecto-schemas-7349513410f0

Keeping Elixir Packages Updated

Here is a short article on how to use some simple mix commands to help keep your Elixir packages updated.

http://tosbourn.com/keeping-elixir-packages-updated/

It contains a handy script you can use to make keeping Umbrella projects updated a breeze.

Phoenix Inside Out Series - Complete version now available

Last month I released a beta version of the series. On July 18th, I have launched the full release of this series.

It contains 3 books and 1 booklet.

  • Mastering Phoenix Framework
  • Garuda - Rebuild Phoenix
  • Ecto Cookbook
  • Blueprint for Phoenix Context

Read more about the book and buy it at: https://shankardevy.com/phoenix-book/

5 Benefits of Immutable Objects Worth Considering for Your Next Project

https://buttercms.com/blog/5-things-you-should-know-about-immutable-objects

In programming, an immutable object is an object whose state cannot be modified after it is created. While at first this may not seem very useful, we explain why you should take a second look.

Drab 0.5.0 released, introducing living assigns in Phoenix templates

Drab is not jQuery dependent anymore, and allows to update the assign value by pushing it to the browser(s) from the server, live, without re-rendering the page.

https://tg.pl/drab

Client:

<a href="https://<%= @url%>" @style.backgroundColor=<%= @color%>>
  <%= @url %>
</a>

Immediate change color and url on the server side:

iex> poke socket, url: "tg.pl/drab", color: "red"

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.

Benchmarking and profiling Elixir apps

This article explores ways and tools available for benchmarking and profiling Elixir apps.

Measure, identify and fix potential bottlenecks.

http://iacobson.net/the-elixir-bottleneck/

Geo 2.0

Geo 2.0.0 released. Breaks out Postgrex extension into its own package, geo_postgis

https://hex.pm/packages/geo

https://hex.pm/packages/geo_postgis

Razor - an opinionated Phoenix app generator

Here’s a phoenix app skeleton generator I released through Carbon Five today, with help from a couple others too. If you like what’s in the box, give it a spin! http://blog.carbonfive.com/2017/07/13/razor-hit-the-ground-running-with-your-next-phoenix-project/

Writing a HTTP API Client in Elixir

I wrote an Elixir Client for the Noun Project API and did a gigantic (beginner-friendly!) write-up, showing how to abstract and refactor things.

http://www.eidel.io/2017/07/13/http-api-client-elixir-noun-project/

My New Favorite Elixir Testing Trick

There’s a brilliant way to use OTP to test your interactions with the scary world outside your application, and it’s my new favorite testing trick! Check it out here:

http://www.devonestes.com/my-new-favorite-elixir-testing-trick

Using Ranch with Elixir

I couldn’t find a nice example of using ranch with GenServer in elixir so I made one.

https://blog.oestrich.org/2017/07/using-ranch-with-elixir/

Convert strings to any case

Ever wanted to convert snake case to camel case? You can use Macro module for that. Except it should not be used this way. As it states itself:

Do not use it as a general mechanism for underscoring or camelizing strings as it does not support Unicode or characters that are not valid in Elixir identifiers.

But with recase it is easy and reliable: Recase.to_camel("some_value") # => "someValue"

recase also supports: UpperCase, kebab-case, Path/case, CONSTANT_CASE, and dot.case

Check it out: https://github.com/sobolevn/recase

Getting Started With Phoenix v1.3.0

A gentle introduction to Phoenix for those with a basic understanding of Elixir. Readers build the backend to a basic rostering system, with many of the basic tasks required to build a Phoenix application progressively introduced and explained.

On Getting Started With Phoenix v1.3.0

A Year with Cachex in Production

I wrote up some stuff about the first year of Cachex, check it out: https://whitfin.io/a-year-with-cachex-in-production/

WebSockex 0.4.0

There’s one breaking change this release:

  • send_frame/2 is now synchronous and returns an error when connection is opening or closing.

I think the most exciting thing about this release is the addition of OTP based debugging capabilities. Check it out and provide feedback!

Take a look at the v0.3.1...v0.4.0 diff, the release on hex.pm, or the v0.4.0 Release Notes for more information

Mastering the Pipe Operator

Pipe Operator, its best practices and tricks.

https://www.youtube.com/watch?v=28UIBW2CeVc