TIL: Anonymous Functions Can Have Multiple Heads

There is no need to use case inside of anonymous function - instead, we can create function with multiple heads. list = [1, 2, 3, {4, 5}, 6, {7, 8}] Enum.each(list, fn {first_value, secon_value} -> IO.puts("Tuple: #{first_value}, #{secon_value}") element -> IO.puts("Simple element: #{element}") end) ...

October 28, 2019 · Michał Staśkiewicz

TIL: Using Sign Inside of Makefile

I’ve just learned that if you want to use a dollar sign inside Makefile you need to escape $ with an extra $. For example: LATEST_COMMIT := $(shell git log --oneline | head -1 | awk '{print $1}') It won’t work because make thinks that we are accessing make variable. If we want to use this awk command inside Makefile we need to escape the $ LATEST_COMMIT := $(shell git log --oneline | head -1 | awk '{print $$1}') ...

October 23, 2019 · Michał Staśkiewicz

The Next Generation of Testing Ember.js

...

April 5, 2019 · Michał Staśkiewicz

Things You Should Know About Ember Octane

...

February 6, 2019 · Michał Staśkiewicz

TIL: Mocking Behaviour in Child Processes

Imagine you have a process which is responsible for consuming some sort of queue and spawning a separate process for each given job. Each of the job processors later called workers communicates with some infrastructure layers for eg. external API, database, etc. We are injecting infrastructure to workers via configuration: defp current_impl do Application.get_env(:scanner, :ensure_file, __MODULE__.AwsImpl) end Each injected implementation must implement complementary behaviour for eg. defmodule Scanner.Scans.EnsureFile.Impl do @callback call(String....

October 9, 2018 · Michał Staśkiewicz

Optional and Upcoming Features in Ember.js

...

August 28, 2018 · Michał Staśkiewicz

TIL: Remove Sensitive Data From Git Repository

When you forgot to use secrets from the very beginning - and some secrets landed in your repository eg. login/password/secret_key you can remove them in a simple way using filter-branch for example to remove password you need to use: git filter-branch --tree-filter "find . -type f -exec sed -i -e 's/password/**REMOVED**/g' {} \;" It will replace password with **REMOVED** in the whole repo and commits....

August 6, 2018 · Michał Staśkiewicz

TIL: How to Inspect Remote Redis

If we want toinspect redis with web UI: npm install -g redis-commander redis-commander --redis-port PORT --redis-host HOST --redis-password PASSWORD redis-commander UI available at localhost:8081...

May 30, 2018 · Michał Staśkiewicz

Chomping GraphQL API with Ember.js

...

October 9, 2017 · Michał Staśkiewicz