Single Responsibility Principle (or SRP) is one of the most important concepts in software development. The main idea of this concept is: all pieces of software must have only a single responsibility.
Why SRP is important? It is the main idea that stands behind software development. Decompose complex tasks to the set of simple building blocks to compose complex software from them back again. Just like we can compose lego or builtin functions:
print(int(input('Input number: ')))
This article will guide you through a complex process of writing simple code. I personally consider this article rather complicated and hard to percept…
It was an early morning. I was drinking my first cup of tea and reviewing a pull request from another developer.
It looked pretty well. Just some new
python dependencies to generate beautiful reports. And a bunch of new
alpine libraries to make sure everything will work.
So, I have merged it without any hesitations.
Several hours later I have found out that our image size increased from
~200 MiB to
~1.5 GiB in size. This is unacceptable!
So, I have written this script to restrict the maximum image size in the future:
IMAGE='your-image-name:latest' SIZE="$(docker image…
Agile people are obsessed with writing user stories. And it is a powerful instrument indeed. But, from my practice a lot of people are doing it wrong.
Let’s see an example:
As a user
I want to receive issue webhooks from Gitlab
So that I can list all current tasks
Seems like a valid user story, doesn’t it? In fact, this tiny story contains multiple issues. And if you cannot find at least 8 mistakes in it — this article will be worth reading for you.
This article is split into three main parts:
The term “slug” comes from the world of newspaper production. If you have ever created a simple “Blog” application you have already reinvented it.
When you need to access any post at some URL you need to identify it somehow. The simplest idea is to identify them by id, but that does not seem too pretty. It would be better to identify your posts based on its title or content. So, a blog post with a title “Creating slugs for Ecto models” would be accessible via a nice-looking URL:
creating-slugs-for-ecto-models is a slug. Pretty cool, isn’t it?
Some time ago I was faced with a task of testing a bash script. At first I decided to use Python unit-tests, however, I was reluctant to bring external technologies to the project. Therefore I had to go with the testing framework written in the notorious
After googling available solutions, I was presented with very scarce options. We are going have a closer look at some of them.
Which criteria are going to be important?
bashtesting framework you wouldn’t want it to drag
lua, and a few more systems packages along with it
npm@5 was just released this question was the first one I have googled. No doubts it comes to mind since new
npm version introduced a lot of
yarn’s features. In other words: should I still use
yarn after installing
Why do people use
yarn in the first place?
npm had some known issues. Well, we all have been there: downloading and installing packages for hours, resolution hell, not using essential
--save-dev by default, and many others.
yarn was first released it solved many of these issues completely. It offered multiple improvements:
Phoenix Framework always has been awesome. But it was never as awesome as the new
1.3 release (which is
rc1 right now actually).
There are a lot of significant changes. Chris McCord made a great job writing a complete migrating guide. Inspired by it and by the talk Chris gave at the
LonestarElixir this article will try to guide through the most important changes in the
Let’s get started!
phoenix is new. And naturally it has some issues. The core team has worked really hard to solve some of the most curial ones in the newest release. …
Псс, парень, не хочешь немного
Передо мной недавно встала задача, как распространять одну консольную утилиту? Обычные мои инструменты вроде
gem не подходили в силу языка самой утилиты —
bash. Тогда стало понятно, что нужно распространять свое приложение в том числе и через системные пакетные менеджеры. Для Mac — в силу отсутствия встроенного — таких пакетных менеджеров несколько. И у каждого из них есть свои особенности и недостатки. И в первой части я хочу более подробно остановиться на Homebrew, и как создавать пакеты для него.
Ну а чтобы установить приложения на Linux, то нужно будет собирать пакеты…
Managing Django’s settings might be tricky. There are severals issues which are encountered by any Django developer along the way.
First one is caused by the default project structure. Django clearly offers us a single
settings.py file. It seams reasonable at the first glance. And it is actually easy to use just after the start. But when it comes to the real-world it only causes misunderstanding and frustration .
At some point, you will need to put some kind of personal settings in the main file: certificate paths, your username or password, database connection, etc. But putting your user-specific values…