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(),
];
});
Fri June 14
Needed to get directories from my dotfiles using yadm as the PHPStorm license was no longer active.
yadm log --all --full-history -- **/thefile.*
Thu Apr 18
Numbers
2 / 2 = 1.0
? Division seems to coerce to floatsdiv()
returns the divisor or 2, not 2.5. It's an integerrem()
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 resultFloat.round(1.2) === round(1.2) == false
Individual digits builds an array, not count of digits.
Integer.parse
returns the unparsable part as a string ".2"
Float.ciel
seems to round > 0 up to the next integer, even 0.25
Tuples
List.delete_at
is zero-based or more importantly pretty much all these methods are zero based to match array indexesKeyword Lists koan.
foo:
like json but the tuple reads :foo
{:foo , "bar"}
Needs the space after :foo
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.
Wed Mar 27
Highlighting the method name like Integer.is_odd gives the definition (hell yes).
Wed Mar 20
Initially tried using my elixir version but ran into minor issues
mix.lock
due to differences in runtime.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)
Mon Feb 25
.gitignore
for VSCode integrationTue Feb 26
mix phx.gen.cert
Added self-signed port to dev config
Changed medicine route to a resource. Added show method and initial view.
<%= @medicine.id %>
syntax. The key is the @ symbol.Added title from layout view. Will want to make it Supple - Page dynamically as you move about the app