Most probably, everyone went through the simplest form of Git setup when we started using it. What I mean is configuring our username and email that is going to be used with Git. E.g. git config --global user.email "<your-email-address>" which will add a line into our .gitconfig file and it will be used throughout all of our Git repositories.

This is perfect when we haven’t started a job yet but when we do, it’s almost certain that the company will require from us to use our company email for company projects. However, it makes perfect sense that we would like…


We will see one way to refactor our React components by replacing conditionals with object map. This is a favorite refactoring of mine because it makes the components easier to understand and extend, groups the logic in a single place, and requires fewer lines of code.

Simple conditionals example

A lot of times based on some input we want to display different information to our users. Let’s see an example which should make things clearer:

We have a component that should show the appropriate message for a certain errorField. It is a very simple one but by reading it we got some…


JavaScript functional programming

We are going to quickly see what is pattern matching, see basic examples of it in Scala and make an analogy with one less known usage of JavaScript switch statement.

There is no native support for pattern matching in JavaScript. However, there is an open proposal which is great and it would be nice to have support and use it in the future if it gets approved and goes through all of the stages.

Note: this isn’t a tutorial about Scala pattern matching and the given examples will be simple ones without going into details.

Let’s get started!

What is pattern matching?

It is…


git rebase — onto

This post was originally published on https://belev.dev/how-to-effectively-use-git-rebase-onto

We are going to get a step further and explore the git rebase --onto command. What is it, how to use it to fix Git branches after rebase, how to change a branch's base, and a bit more? We will learn those things by exploring real-world scenarios in which git rebase --onto is really useful.

Let’s get started!

Quick git rebase recap

Visiting the docs, we will see the following explanation:

Reapply commits on top of another base tip

The most important bit here is what base means/refers to? This is the previous/parent commit. …


Don’t be afraid to use git rebase

This post was originally published on https://belev.dev/some-of-the-most-used-git-interactive-rebase-options

In the previous blog post Git merge vs rebase to keep feature branch up to date we learn about the differences between merge and rebase. If you aren't very familiar with the basics of those commands and haven't read it yet, it is a good idea to do so before diving into this one.

The idea of this blog post is to show with examples some of the most used options of git rebase command. In my experience, I observed that this is one of the most misunderstood commands, especially for less experienced…


Hi all,

Having a personal website was a long wanted project of mine but I always postponed it for different reasons. Today, I am extremely excited to share it with all of you — https://belev.dev/. I am going to use it as a blog and mainly share things around software development from my experience.

The site is built using Gatsby and LekoArts minimal blog theme. It is deployed using Netlify. I bought the domain name from Namecheap and afterwards configure the DNS through Netlify DNS.

Most probably I am going to write a blog post about my experience building my first personal website and my impressions about Gatsby and Netlify because it was my first touch with them.

Thank you for reading this and I would really appreciate it if you give the website a try. Any feedback is welcome.


Today we are going to look at how Git merge and rebase commands behave while trying to keep feature branch up to date.

In a large codebase where a lot of people are working we have constant updates to the master branch. We want to work on top of this branch and always have to latest changes. We can achieve this by either using merge or rebase to get the latest changes made in master branch into our feature branch.

merge

So what is merge doing:

Join two or more development histories together

Let’s now look at an example using merge


In this article, we will learn how to enable JUnit 5 in a newly created Spring Boot project. We are going through the following steps:

  1. Initialize new Sprint Boot project
  2. Having a look at our pom.xml and mostly on sprint-boot-starter-test dependency, going a little deeper in spring-boot-starter-test and see what JUnit version it uses
  3. How to exclude child dependency that comes from one of our dependencies using Maven
  4. Add JUnit 5
  5. Migrate JUnit 4 to JUnit 5
  1. First, let’s go to Spring Boot initializr and generate a new project.
Sprint Boot initializr default values

The defaults should be fine and you can click the “Generate…

Martin Belev

Full stack web developer, ex mathematics competitor, loves solving problems in simple manner, helping others, reading, fitness enthusiast.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store