Solution to Challenge 12: Making bitmaps with color palettes

https://youtu.be/pTR89d1yVbk

We’ll dive into working with Elixir bitstrings and upgrade the bitmap image generator from last lesson.

By the end of the video we’ll be able to create color palettes and generate monochrome or 16-color images along with 24-bit color images.

IntelliJ Elixir 7.2.1

  • Use documentionRootType to indirectly get the documentation OrderRootType in the Erlang SDK Type, so that it works in Small IDEs that have more than CLASSES and SOURCES root types installed.

  • The credo annotator is disabled by default as numerous users find running mix credo in the background has a negative impact on their system performance. If you like to try enabling the annotation, you can turn it on using the configuration.

    1. Preferences > Editor > Inspections > Elixir
    2. Check “Credo”
    3. Click OK to save and close Preferences If you notice a degradation the in the responsiveness of the editor, it is recommended you disable the annotator again.
    4. Preferences > Editor > Inspections > Elixir
    5. Uncheck “Credo”
    6. Click OK to save and close Preferences
  • Protect from PsiFile being null in Local credo inspector

  • Run Qualified#moduleName getText in Read Action.

  • Scratch Files have a Project, but not a Module, so change flow to use Project when Module is null in credo annotator.

  • Don’t add .bat to mix on Windows. mix is never run as an executable. It is either run as a script to elixir.bat OR as an argument to erl.exe when erl.exe is running elixir.

Installation Instructions

phoenix_integration 0.4 published to hex

Just published phoenix_integration 0.4 to hex.

phoenix_integration is a lightweight server-side integration framework that helps you test your controllers/templates working together through a series of calls. Previously described in this blog post.

Among several bug fixes, the big change is the addition of Requests.fetch_form/2. This lets you fish the contents of a form out of a conn that has been rendered from a controller in test. You either query/use values that were set in the app or simply verify that the preloaded values are correct.

Lesson 12 Constructing bitmap files with Elixir

youtu.be/9o5bDiCiJ90

Let’s take advantage of Elixir’s built-in binary handling and construct Win2.x bitmap files! No external dependencies needed. #nostalgia

EventBus v0.8.0 released

Your favorite event delivery library has a new version with new features. https://github.com/mustafaturan/event_bus

[0.8.0] - 2018-01-06

Added

  • Register/unregister topics on-demand (EventBus.register_topic/1 and EventBus.unregister/1)
  • Add block/yield builder for Event with auto initialized_at and occurred_at attribute assignments
  • Add block/yield notifier for delivering/notifying events creation with same benefits of build block
  • Add samples to README
  • Add CHANGELOG file

Elixir Wants to Change the Way You Think About Programming

A look at how we think about code at 10,000ft and how learning Elixir has made me see programming differently through three key languages features: immutability, data transformations, and syntactic expressiveness.

Elixir Wants to Change the Way You Think About Programming

Nerves Project January Update

See what the Nerves core team and community have been working on recently and where you can learn more about Nerves at upcoming training events - http://embedded-elixir.com/post/2018-01-02-nerves-update/

Logging from headless Nerves machines to Papertrail

I wrote a little how-to on setting up logging to Papertrail from a headless Raspberry Pi running Nerves.

https://timgilbert.wordpress.com/2017/12/31/logging-from-headless-nerves-machines-to-papertrail/

AC8: Creating a DSL for our router

https://youtu.be/8GUFE0F8pE8

Building the http://Alchemist.Camp website, Part 8.

Let’s write some macros and make a nice router DSL like Phoenix has!

What I Learned During the Advent of Code

I learned quite a bit after completing this year’s Advent of Code challenges with Elixir. Check it out!

From 0 to 11 with Nerves

Walk through the creation of a fully featured Nerves starter project

https://nerves.build/posts/nerves-0-11

Pattern matcher for Protocols

Just blogged about how one could pattern match function clauses against the implementations of the protocol.

http://rocket-science.ru/hacking/2018/01/03/pattern-matcher-for-protocols

AC7: Creating controllers for a Cowboy web server

https://youtu.be/JjV2LXvjU54

Building the http://Alchemist.Camp website, Part 7. It’s time to make controllers.

Our router was starting to look like a kitchen sink so we factored a controller out of the app and started pulling some code into a framework. This required the use of simple macros.

Elasticsearch

Elasticsearch is a new Elixir library for interacting with Elasticsearch. Highlights include:

  • No DSLs. Interact directly with the Elasticsearch JSON API through simple get/put/post/delete functions.
  • Zero-downtime index (re)building. Via an included mix task.
  • Dev Tools. Helpers for running Elasticsearch as part of your supervision tree during development.

It’s based on protocols and behaviours, so it’s both simple and flexible.

Cloak v0.4.0 Released!

Cloak makes it easy to encrypt data in your Ecto schemas. This new release adds several new features, including support for AES.GCM encryption.

https://github.com/danielberkompas/cloak/releases/tag/v0.4.0

IntelliJ Elixir v7.2.0

Enhancements

  • mix runs will be faster as they will no longer check to see if the SDK is updated.

Bug Fixes

  • Avoid problems with read and write locks when updating Elixir SDK on-demand by instead updating them when any project is open using a project converter.
  • JetBrains/intellij-community@9adbba0 added @NotNull to OrderRootType.getOrderRootType, which JavaDocRootType.getInstance calls, which means any Small IDE using intellij-community since 4 months ago, including the newest CLion cannot have JavadocOrderRootType.getInstance safely called.
  • Path changes were not being written back to disk because the projectSdksModel.apply() was being called before the editor.apply(), which would have copied to the editor’s path changes to the projectSdksModel.

Installation Instructions

Winners for @spawnfest were announced!

Check it out: https://spawnfest.github.io/winners/ Congratulation @micmus, @bondalex & @andrewdryga!! You won, big time!

IntelliJ Elixir v7.1.0

Enhancements

  • Elixir Facet in Small IDEs

    • Preferences > Languages & Frameworks > Elixir can set the Elixir Facet SDK for the Project Module used in Small IDEs as a per-project settings.
    • Preferences > Languages & Frameworks > Elixir> SDKs can add, delete, and configure Elixir SDKs as per-application settings.
    • Preferences > Languages * Frameworks > Elixir > Internal SDKs can add, delete, and configure Erlang SDK for Elixir SDKs as per-application settings.
  • Configure SDK before running mix when importing mix projects, so that the mix path does not need to be configured separately from the SDK path.

    • The mix path no longer needs to be setup independently from the Elixir SDK.
  • Add Local shared credo inspection, so the the credo inspection works for Code > Code Cleanup.

    • Show Mix ExUnit in context menu in Elixir Facets, so that
      • Run ‘Mix ExUnit …’
      • Debug ‘Mix ExUnit …’
      • “Create “Mix ExUnit …’”
      appear in Rubymine when you right-click the test directory and it is Marked as a Test Sources Root. It will appear green in Rubymine if already marked. To mark it, do the following:
      1. Right-Click test directory
      2. Select “Mark Directory as > Test Sources Root”

Bug Fixes

  • Protect access to JavadocOrderRootType.getInstance() so that it doesn’t cause an error in Small IDEs where its Extension Point is not defined.
  • If the explanation tooltip is empty, fallback to the message for the credo annotator instead.
  • Check if SdkAdditionalData is null before getting ErlangSDK as it can be null in certain scenarios in Rubymine.
  • Fix isConfigurationFromContext, so that it works on Mix ExUnit Run Configurations generated from directories. Check if the programParameters and workingDirectory match by just generating another configuration from the context as this ensures the logic matches and includes support for PsiDirectory.

Installation Instructions

Elixir Users' Survey 2017

I’ve just published this year’s Elixir Users’ Survey. If you’d visit this link and fill it out for me I would sincerely appreciate it! :)

https://www.dailydrip.com/blog/elixir-users-survey-2017

Raxx 1.0.0-rc.2 released

https://hex.pm/packages/raxx/1.0.0-rc.2

Raxx is a simple, functional foundation for web applications. It’s role is as an alternative to plug.

This release adds typespecs throughout to work with dialyzer.

Previous page Next page