Journal Entry, October 4th to October 11th 2019

October 11, 2019 · 2 min read

Elixir

  1. Thu Oct 10

    • Compiling elixir language EPUB
    • How to generate EPUB documentation for Elixir v1.6

      • Note: You must remove your phx_new mix archive (mix archive.uninstall phx_new-1.4.10) or conflicts happen during the build process
      git clone https://github.com/phoenixframework/phoenix.git
      cd phoenix
      git checkout v1.4 (or next completed)
      mix deps.get
      mix docs --formatter epub
      git clone https://github.com/elixir-lang/elixir-lang.github.com.git
      git clone https://github.com/elixir-lang/elixir.git
      cd elixir
      
      nano Makefile
      #==> Documentation tasks
      # DOCS_FORMAT = html
      DOCS_FORMAT = epub
      
      make docs
      
      cp doc/elixir/Elixir.epub

Elixir Koans

  1. Tue Oct 8

    • IEx testing a file

      • import_file("lib/knockin/tasks/stack_overflow_query.ex")
      • data = %Knockin.Tasks.StackOverflowQuery{}
      • Knockin.Tasks.StackOverflowQuery.get_base_url
    • Sort order

      • number < atom < reference < function < port < pid < tuple < map < list < bitstring
    • Collections

      • Lists - Simple collection of values
      • Tuples - Lists stored contiguously. Expensive as modifications require copying the entire tuple
      • Keyword lists - a special list of two-element tuples whose first element is an atom; they share performance with lists
      • Maps - the “go-to” key-value store. Unlike keyword lists, they allow keys of any type and are un-ordered.
    • Enum - Set of algorithms for enumerating over enumerables

      • all? - Returns true if supplied callback applies to all values
      • any? - Returns true if supplied callback applies to a single value
      • chunk_every
      • chunk_by
      • map_every
      • each
      • map
      • min
      • max
      • filter
      • reduce
      • sort
      • uniq
      • uniq_by
    • Pattern matching - allows us to match simple values, data structures, and even functions

      • Match operator (=) - Turns into an equation, the left side has to match the right
      • Pin operator (^) - With the match operator, variable assignment happens if included on the left. The pin operator prevents rebinding
      • Any equation or assignment seems to set a pattern or match
    • Control structures

      • if and unless - if looks for truthy, unless is the inverse and defaults to false
      • case - match against multiple patterns. _ required in the event there is no match (like default in other languages but required, unlike others). Allows for guard clauses
      • cond - Match conditions instead of values, akin to else if from other languages
      • with - (Need to look this up)

Laravel Nova

  1. Tue Oct 8

    • You need to run nova:publish as Nova updates via composer. It's easier, if using composer, to run the commands on update.
    • https://twitter.com/freekmurze/status/1169233283269451776 is what happens when this generally breaks but the docs don't point this out in a painfully obvious way.
    • Make a blog post on Chrome overrides and looking at Nova in Vue devtools.