Dynamic configuration using YAML in Ruby

Dynamic configuration using YAML in Ruby

From time to time using Ruby or even more often using Ruby on Rails, I need additional configuration with some secret API keys. I don’t want to save those data in the git repository, but it is too early to put them in the database. In this case, environment variables can do the trick. You put sensitive data to the .env file, and you don’t track this file in the git repository. We’re done! Not exactly, in my case. I wanted to have the structured data in one file. So I used the environment variable together with YAML (recursive acronym...

How to focus as a programmer?

How to focus as a programmer?

In times of full connections and online life, we have a problem staying focused. We need to focus, to feel the flow. One of the most important feelings in our work time. Flow is the mental state in which we do some activity fully immersed and engaged in the process of the activity. It’s a very positive and energized feeling, which brings us a lot of satisfaction. But how can we have flow in a world full of distractions? Now, since a lot of us work from home, the situation can be even more challenging. This time, I would like...

Second look at pattern matching in Ruby

Second look at pattern matching in Ruby

Sometimes I like new changes, new features, or improvements in Ruby and sometimes not. Today I would like to tell you more about the changes that I’m very excited about. I mean the Pattern Matching. I wrote a separate article about Pattern Matching in Ruby some time ago. Now it’s the time to go deeper into the Pattern Matching news. So let’s get started!

Screenshot directly in the browser

Screenshot directly in the browser

When you are web developer, sometimes you need to do a screenshot of your work. In most cases, you just use the Print Screen key for that. Then, of course when you use Linux operating system, you open a graphic editor like GIMP to cut an important part. Or maybe you need to do a screenshot of the entire website? Then you use a couple of times Print Screen, or you use some extension in the browser. But there is an easier way to do that. You can use a screenshot built in your browser. Let’s check out how to...

Pattern name in class name. Good or bad practice?

Pattern name in class name. Good or bad practice?

In one of my last articles, I was writing about improving names in the project. One of the tips was tell what pattern you use. Then I read a newsletter from Sandi Metz “Don’t Name Classes After Patterns. Mostly.” which have a different opinion about patterns in names. I think it is a good topic to write about it. There is no one silver bullet rule on how to do programming or create names. We have some tips, but those are the signpost. There are always some pros and cons, so it is good to have a wider perspective. Let’s...

TDD in a nutshell

TDD in a nutshell

Some time ago, I was participating in an Instagram challenge called #30devstories. During that challenge, I create a lot of nice and short materials related to programming. I would like to share them with you using a more permanent way then InstaStory. I will start with TDD - Test Driven Development. In more details, I described this topic in the article TDD - Basics. Today I will focus only on a very short introduction to TDD.

Names have meaning: 13 ideas on how to improve names in the project

Names have meaning: 13 ideas on how to improve names in the project

As developers, we are often talking about high-level architecture. I mean DDD, hexagonal architecture, and so on. We want to introduce those concepts to our project. We want to do that now! The new concept, new architecture, new language, new framework. We fall into a trap. Technical news is for us like drugs. We want more and more. And we don’t think about the consequences. The goal is noble. We want to have a good quality project which can easily adjust to new requirements. Unfortunately, the way we do that is not always the best. We need evolution, not revolution....

How to add the yarn package from GitHub?

How to add the yarn package from GitHub?

In my current project, I use yarn for managing JavaScript packages. A few days ago, I needed a very specific version of a package from the GitHub repository. To keep it in mind, how to add a package from GitHub repository using yarn, I prepared this short note. I hope you will find it useful. I plan to do more this kind of short tips in the future.