In this article, I would like to show you how to prepare the script that will back up your important files to the cloud storage using a tool called restic. Even though the article is specific for macOS and Backblaze B2, you can use some techniques for creating a similar script for Linux systems.
Write code for people
The first draft of this article was about the code-style. I wanted to show you why it is important and why we should care about it. But the longer I thought, the stronger conviction I gained, that the code-style – whatever it means – is only a way to achieve a much more important goal.
I’m a big advocate of well-quality code. Besides good architecture, I pay attention to style – consistent spacing and indentation, coherent naming convention and other rules that make the code visually better. But how to convince someone, who never took care of style before, that is it a good thing?
The hidden cost of self-hosted services
The Internet is teeming with services you can take advantage of. You can store your files in the cloud, share movies, organize photo collections, talk with friends, manage your projects and so on. It also means that your data is stored outside your computer and you don’t have full control over it.
You may use self-hosted counterparts of services. Instead of accepting vague privacy policies, you may set the rules. However, you are fully responsible for sustaining your data.
I used to consider self-hosted services as a privacy-respective and cheap alternatives of popular services. The former is true, however, the latter factor is often far-fetched.
Collecting tiny thoughts
I collect lots of thoughts in my private notes. Some of them could be quite useful if I show them in a decent form. Unfortunately, they are too small to be a full article, so I decided to introduce another form of posts – tiny thoughts.
Use make as task runner
5 stages of development as the programmer
This post is also available in: Polski 🇵🇱
5 years have passed since I had started working as a professional software developer. Although the programming was my hobby since the early years, my skill started to grow when I had taken a real job.
I was surprised when I had recalled my very beginning because I noticed how much I had changed and how big progress I had taken. So, I decided to write it down.
In this article, I’ll take you on a short journey where I’ll tell you about my development process. You’ll find out what I’ve been thinking about, what I’ve been working on and ultimately what changed from my perspective. Ready?
Automatic file versioning after change using fswatch and git
I create a lot of notes. Seriously, I write tons of notes. Inspired by Getting Things Done method, I treat my mind as a thoughts generator rather than the storage. I capture thoughts, ideas, inspiring quotes, links, and pictures. Mostly using files.
Although I’m on the early stage of creating my custom note-taking solution, I’ve done some work to synchronize notes between devices and versioning them. In this article, I’d like to focus on the latter and I’m going to show you how to set up automatic files versioning.
I’m a software developer so, unsurprisingly, I use git to versioning my notes as well. Instead of manually committing changes, I take advantage of tools like fswatch and launchd to automate this process.
How to use final in PHP?
If someone would ask me about my favorite keyword in PHP, I would certainly answer: final. It doesn’t mean I write this modifier in each class or method. It not only shows the intention but also provides a mechanism to protect the code. At least from the assumption.
The final keyword can be used both on the class level and on the method level. It prevents future extension of functionalities in a non-effective way. If a class is marked as final, then we can’t inherit from it. If a method is marked as final, we can’t override it.
The theory sounds good. Let’s go to details.
The practical difference between “findBy” and “getBy” in repositories
Repositories are a special example of a class. They usually have a lot of methods designed to retrieve data from the database or the other storage. To mark this operation in the name of the method, we can use one of the common words: find, get, search. Are all them mean the same? In this article, I would like to show you a practical difference between getById
and findById
methods.
Quick start with TDD in JavaScript using Jest
JavaScript is one of the most versatile programming languages I know, however, I had a constant problem with the testing. Since I run into TDD, I was looking for something that allows me to build my solutions using this approach. When I had been creating a small project in React, I accidentally discovered Jest.
It surprised me because it hadn’t required any extra configuration. I thought that the configuration was built-in into the create-react-app tool. It turns out that zero-configuration is one of the philosophies behind this tool. I decided to try using it outside the React application. Since this moment, this is a standard tool for my unit tests for the JavaScript.
Let me show how easy work with Jest is.