ReceiptDecoder: Decode iOS App receipt
ReceiptDecoder is a tool to decode iOS App receipt in Elixir. You can do some validation before sending receipt to remote server.
Benchmarking in Elixir
Ready to measure the performance of two pieces of code w/ the same output? Check out the latest episode: Benchmarking with Benchee https://elixircasts.io/benchmarking-with-benchee
What if Elixir were Homoiconic?
This article explores the misconception that Elixir is homoiconic, dives into what “homoiconic” actually means, and envisions what Elixir would look like if it truly were a homoiconic language.
Hammer: an elixir rate-limiter with pluggable backends
Hammer is a rate-limiter for Elixir, with a modular backend system, so you can choose where to persist the rate-limit counters. Currently supported backends are ETS and Redis.
alembic 3.4.0
https://hex.pm/packages/alembic/3.4.0
Changelog
Enhancements
-
Alembic.Document.from_ecto_changeset/2converts theerrorsinecto_changesettoAlembic.Error.tin a singleAlembic.Document.t. Bypasses a bug inJaSerializerwhere it assumes all fields that don’t end in_idare attribute names, which leads to association names (as opposed to their foreign key) being put under/data/attributes.Alembic.Document.from_ecto_changesetreflects on theEcto.Changeset.tdatastruct module to get the__schema__/1information from theEcto.Schema.t. It also assumes that if the field maps to no known attribute, association or foreign key, then the error should not have anAlembic.Source.tinstead of defaulting to/data/attributes. -
Alembic.Pagination.Page.countcalculates the number of pages given the pagesizeand thetotal_sizeof resources to be paginated. -
Alembic.Pagination.Page.firstreturns theAlembic.Pagination.Page.tfor thefirstforAlembic.Pagination.tgiven any page and the page count. -
Alembic.Pagination.Page.lastis the last page forAlembic.Pagination.tgiven any page and the page count. -
Alembic.Pagination.Page.nextis the next page after the currentpage. Ifpagenumbermatchescount, then it must be the last page and so next will benil. -
Alembic.Paginaton.Page.previousis the previous page to the currentpage. If thepagenumberis1, then it is the first page, and the previous page isnil. -
Alembic.Pagination.Page.to_paginationtakes the currentpageand thetotal_sizeof resources to paginated and produces theAlembic.Paginationwithfirst,last,next, andpreviousaround thatpage. Ifpagenumberis greater than the calculated page count{:error, Alembic.Document.t}is returned instead of{:ok, Alembic.Pagination.t}. -
Alembic.FromJson.integer_from_json -
Alembic.FromJson.integer_to_positive_integertakes an integer and returns it if positive, otherwise returns errorDocumentif0or below. -
Alembic.Pagination.Page.from_paramsparses param format with quoted integer page number and size or JSON format with integer page number and size. -
Allow pagination opt-out with
%{“page” => nil}.Alembic.Pagination.Page.from_params(%{“page” => nil})will return{:ok, :all}while no“page”param will return{:ok, nil}. - Use IntelliJ Elixir formatter for make the formatting consistent
-
Support
many_to_manyassociations inAlembic.ToEctoSchema.to_ecto_schema/2 -
Alembic.ToEctoSchema.to_ecto_schema/2doctests
Bug Fixes
-
Allow
nextandpreviousto benilinPagination.t@typesince they were already allowed to benilin use for the last and first page, respectively. -
Alembic.Pagination.Pagenumberispos_integerbecausenon_neg_integerallows 0, but that’s not valid becausenumberis 1-based, not 0-based.
Elixir for the Little Things
You don’t have to have a big problem to use a great language. Elixir shines at scripting, too
Elixir and Doctest - Help Writing Better Programs, One Method At A Time
Sometimes it’s the small things that you find enjoyable, like… having Doctest. ;)
http://fredwu.me/post/163901408538/elixir-and-doctest-help-writing-better-programs
How to run Phoenix framework application inside a Docker container?
How to run Phoenix framework application inside a Docker container? https://blog.lelonek.me/how-to-run-phoenix-framework-application-inside-a-docker-container-b02817d860b4
Nerves 0.7.1 Released
Nerves has really been moving forward quickly over the past few months. One exciting new feature that I’ve been working on is the nerves.system.shell Mix task, which allows you to more easily build custom Nerves systems regardless of what OS you’re using. Check out the updated documentation to learn more!
HTTP/2 client available from Ace > 0.11.1
The latest version of Ace includes a HTTP/2.0 client. https://hexdocs.pm/ace/Ace.HTTP2.Client.html
From zero to Production Elixir, part 2
This is the second part of the story of how we got an Elixir application running in Production in a month. This time we’re more focused on the code aspect and how we applied the umbrella apps concept. The article ends with some thoughts on how Elixir welcomes newcomers like me. https://medium.com/onfido-tech/from-zero-to-production-elixir-in-1-month-2-2-1deca839be14
National Health Service on Elixir, React and Kubernetes
The second case study how we built eHealth system for NHS of Ukraine on Elixir, React and Kubernetes. https://medium.com/nebo-15/national-health-service-on-elixir-and-kubernetes-b1c2551f0dbb
Time zones in PostgreSQL, Elixir and Phoenix
I just blogged about the way I handle time zones (specifically timestamps) in Elixir/Phoenix/Ecto applications on our corporate blog
String.Naming :: fuzzy grapheme search by name
https://github.com/am-kantox/string_naming
Added StringNaming.graphemes/1 function that receives a regular expression and returns the list of matched characters:
iex> StringNaming.graphemes ~r/\Aspace/i
[
space_medium_mathematical_space: " ",
spaces_em_quad: " ",
spaces_em_space: " ",
spaces_en_quad: " ",
spaces_en_space: " ",
spaces_figure_space: " ",
spaces_four_per_em_space: " ",
spaces_hair_space: " ",
spaces_punctuation_space: " ",
spaces_six_per_em_space: " ",
spaces_thin_space: " ",
spaces_three_per_em_space: " "
]
Setting Up Continuous Integration for an Elixir Project Using Semaphore
Learn how to set up continuous integration for an Elixir Phoenix project using Semaphore. https://semaphoreci.com/community/tutorials/setting-up-continuous-integration-for-an-elixir-project-using-semaphore
Elixir with Love Conf Tickets Available
Tickets to the Elixir with Love conference go on sale today! Event: November 10, 2017 at the Providence Biltmore Hotel in Providence, RI.
ShorterMaps 2.2 released: ES6 map shorthand for Elixir
Tired of this? %{id: id, first_name: first_name, last_name: last_name, address_1: address_1, address_2: address_2, city: city, zip_code: zip_code}
ShorterMaps provides the map syntax you wish vanilla Elixir allowed:
~M{id, first_name, last_name, address_1, address_2, city, zip _code}
Version 2.2 is a tremendous upgrade in capability: ShorterMaps now can work with expressions alongside elided keys, e.g.:
~M(id, first_name, last_name, full_name: “#{first_name} #{last_name}”)
Check it out on Github. Try it out with {:shorter_maps, “~> 2.0”},
