Journal Entry, June 7th to June 14th 2019

June 14, 2019 · 1 min read

Laravel

  1. Mon Jun 10

    • Returning files sorted by creation time.

      $files = collect(\File::files($realDirectory))
          ->filter(function(\SplFileInfo $file) {
              return strpos($file->getFileName(), "{$this->fileName}");
          })->sortBy(function (\SplFileInfo $file) {
              return $file->getCTime();
          }, SORT_NUMERIC)->map(function (\SplFileInfo $file) {
              return [
                  'base' => $file->getBasename(),
                  'name' => $file->getFilename(),
                  'created' => $file->getCTime(),
                  'modified' => $file->getMTime(),
                  'size' => $file->getSize(),
              ];
          });
  2. Fri June 14

Journal Entry, April 12th to April 19th 2019

April 19, 2019 · 1 min read

Elixir Koans

  1. Thu Apr 18

    • Numbers

      • 2 / 2 = 1.0? Division seems to coerce to floats
      • div() returns the divisor or 2, not 2.5. It's an integer
      • rem() returns the remainder or 1, not 0.5. The .5 is dividing the remainder by 2.
      • (2 * 2.0) = 4.0 as the types coerce the result
      • Float.round(1.2) === round(1.2) == false
      • Individual digits builds an array, not count of digits.

        • i.e. Use that fancy peek feature to determine what each method is doing before blindly answering.
      • Remaining unparsable portion counts the space.
      • Integer.parse returns the unparsable part as a string ".2"
      • Float.ciel seems to round > 0 up to the next integer, even 0.25
    • Atoms
    • Tuples

      • List.delete_at is zero-based or more importantly pretty much all these methods are zero based to match array indexes
    • Lists
    • Keyword Lists koan.

      • It's interesting that it's foo: like json but the tuple reads :foo
      • {:foo , "bar"} Needs the space after :foo

Journal Entry, March 22nd to March 29th 2019

March 29, 2019 · 1 min read

MySQL

  1. Mon Mar 25

Specifically using JSON fields as virtual calculations versus setting an explicit string/integer field and filling it in that way. This way we only store the JSON and the rest is done for us.

Elixir Koans

  1. Wed Mar 27

    • Strings

Journal Entry, March 15th to March 22nd 2019

March 22, 2019 · 1 min read

VSCode usage patterns

  • Highlighting the method name like Integer.is_odd gives the definition (hell yes).

    • Peek reminds me of PHPStorm.

JavaScript

  1. Mon Mar 18

Elixir Koans

  1. Wed Mar 20

    • Initially tried using my elixir version but ran into minor issues

      • Changes the file mix.lock due to differences in runtime.
      • Various warnings that come up in the official docker image.
    • Equalities
    • Prepped git repository for common changes and using a feature/pass_1 branch to show our first pass.

      Erlang/OTP 21 [erts-10.2.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]
      
      Elixir 1.8.1 (compiled with Erlang/OTP 21)

Journal Entry, February 22nd to March 1st 2019

March 1, 2019 · 1 min read

Phoenix Framework

  1. Mon Feb 25

  2. Tue Feb 26

    • Created self-signed certificate via mix phx.gen.cert
    • Added self-signed port to dev config

      • Unlike valet these self-signed certs are a major eyesore.
    • Added force_ssl configuration though I'm unsure if it's working correctly
    • Changed medicine route to a resource. Added show method and initial view.

      • It took way too long to figure out the <%= @medicine.id %> syntax. The key is the @ symbol.
      • This likely gets easier as I move through the guide.
    • Added title from layout view. Will want to make it Supple - Page dynamically as you move about the app

      • This will seem a little tricky but I suspect it's doable.