Customize outputs with Inspect protocol
The latest changes to the Inspect protocol can help you change the way data is presented. With the new
optional option, you can only indicate information when the data has changed.
Features of well-prepared tests
Software development is often a test creation process. To achieve success, it is worth considering what features good tests have. Well-written tests should document the implemented functionality and check the tested function well.
Use GitHub discussion to have comments on your Jekyll blog
I introduced the possibility of commenting on posts directly on the page. With giscus, we can use Discussions on GitHub to store comments. In this simple way, you can add comments to your Jekyll blog!
TIL: Using phash2 for data partitioning
In programming, we often need fairly distribution of data. Using phash2 we can get the same hash for the same Erlang term regardless of machine architecture and ERTS version. This fast function should always be used for hashing any data and limiting the result to a range of integers.
Tech Companies Layoffs
Layoffs have accelerated significantly this year. These layoffs affect the entire tech industry. The same problems can be observed both in the USA and in Europe.
TIL: Only one server will run your migrations
Ecto uses SHARE UPDATE EXCLUSIVE lock to ensure that only one instance is running a migration at a time and only once. Internally stored version and inserted at allows you to modify and improve created files.
Refactoring is the key to success
Refactoring should be an integral part of a developer’s day. Systematic refactoring allows for reducing the process of self-degradation of the project. This change makes our code easier to understand and cheaper to maintain.
TIL: Regex with name bindings
In Elixir, regular expressions can extract a lot of useful information. Using Regex and named_captures/3 function, we can parse the input data based on the prepared regex.
Should Team Lead continue to code?
Being promoted from Programmer to Team Leader is not unusual. Should Team Lead continue to code? Managing people becomes your job, among other things. You do not have to stop coding completely. Unfortunately, it will be less than before.
Take care of your health
It is one of the few “things” that will ultimately happen to everyone. How well are you using your life? Do you like your job and the people you work with? Instead of postponing it, just start acting!
Your GitHub professional card
GitHub offers a great opportunity to create our card for everyone visiting our profile. Best of all, even this card uses a version control system.
Use dbg to check your Elixir code
Debugging Elixir code has become even more accessible thanks to the
dbg function. Thanks to the latest version, your work may become more pleasant and the search for errors even easier. Check how to apply new possibilities in your code. A simple one-line can facilitate your error analysis.
TIL: Correctly comparing dates in Elixir
Special functions are used to compare dates. With it, you can prepare a comparison based on semantics. Simple functions can solve your problems with incorrect results.
Let’s get to know before you start changing the world
Every change is hard. Before making changes, get to know yourself from the best side. Try to understand it as quickly as possible, at least in general terms.
Preventing reuse of the same password
Safe passwords are a very important aspect of application security. How can you check if the password has not been used before? Compare passwords in Elixir thanks to Bcrypt.