Achievement is not always about doing more things

A lot of people reflect on what they’ve done, either daily or weekly. I’m one of them. Every morning, I write down three things I want to accomplish that day—sometimes on paper, sometimes in a text file—and try to check them off throughout the day. Most days, I manage to complete them, but there are also days when I don’t, which is absolutely normal.

A few weeks ago, I realized that I hadn’t completed most of the tasks I had written down for the day. When I looked back at the entire week, I noticed the same pattern! I was confused because, by the evening, I was so exhausted that I couldn’t do anything else. My energy had to be going somewhere else. So, I decided to track how I was spending my time each day, writing down everything I did for a few days. That’s when I noticed something interesting:

For the past three weeks, I had been spending a significant amount of time following a political figure. My interest in Future Studies had led me to discover this person, whose job is in that field. I started watching almost all their videos on YouTube and scrolling through their content on social media platforms like Instagram and X. Thanks to social media personalization and recommendation algorithms, I was introduced to even more figures in the same space, and I began watching their videos as well. After a week, I realized that most of my time was being consumed by this, which explained why I was so drained by the end of the day.

Sometimes, instead of writing a to-do list, we should write a “not-to-do” list. Here’s an example:

  • Don’t check social media today.
  • Don’t follow the news today.
  • Don’t eat sugar today.
  • Don’t drink today.

Achievement isn’t always about doing more—it can also be about avoiding the things that drain your time and energy. If you don’t check social media, you’ll have more time for things that actually matter.

Authentic discussions happen actually in the comments

I was reading Cal Newport’s new blog post Back to the (Internet) Future, and I found it super valuable. It reminded me of the days when social media platforms like Twitter (X) and Instagram weren’t as popular, and people actually took the time to read. In his post, Newport argues that conversations happening through blog posts or articles are usually more authentic and meaningful.

Back in 2012, Scott Hanselman also wrote about how publishing your words on Twitter (X) or any other social network means they are essentially wasted. He suggested that when you post your ideas on your own website, you truly own them. Although the post was published over a decade ago, he had already warned us about tech companies that lure us into writing on their platforms instead of maintaining our own spaces. They achieve this through clever “marketing traps” such as “reimagining writing” or “rethinking publishing.”

Personally, I neither disagree with social media platforms nor have concerns about the ownership of the content we publish on them. What worries me more is that people today read far less than before. Instead of engaging deeply with written content, they scroll mindlessly through social media, seeking quick dopamine hits, only to be bombarded with random (or even “personalised”) advertisements. To me, social media platforms don’t care whether you actually absorb the information in a post—they only care about keeping you engaged for as long as possible so they can monetize your attention. The dopamine rush is so strong that quitting social media becomes incredibly difficult. In reality, it’s just another form of addiction.

Another concerning trend is the quality (or lack thereof) of interactions on social media. When scrolling through comments on most posts, you’ll often find irrelevant comments, a string of emojis, or completely off-topic replies. Many people don’t even take the time to view all the images in a post! Let me share a real-world example that happened to me recently: A few days ago, I posted on Instagram about the first loaf of bread I had baked. I wanted to share the process with my friends and family, from preparing the dough to cutting the finished bread. The post contained four photos, starting with the dough preparation and ending with the final result. Here is the first and the last photo:

The first and the last photo of the post I did on Instagram about my first bread baking The photo on the left: Dough, the photo on the right: Me cutting the final loaf of bread

After posting, I received a few strange comments like, “What is this?” I was confused, so I messaged one of the commenters privately to ask why they were unsure. Their response shocked me—they admitted they hadn’t even scrolled to the last photo to understand what the post was about!

To me, these behavioral patterns are alarming. As social media addiction grows, people skim through almost everything instead of taking the time to process, reflect, and engage meaningfully. This isn’t just my personal observation. In 2018, Maryanne Wolf published an article in The Guardian titled Skim Reading Is the New Normal—The Effect on Society Is Profound. In the article, she explained how social media has conditioned us to skim rather than read deeply:

When the reading brain skims texts, we don’t have time to grasp complexity, to understand another’s feelings, or to perceive beauty. We need a new literacy for the digital age.

All in all, we need to be mindful of how we use social media—before it’s too late.

Five useful git commands & options that are not being used often

git changed the way we all think of a source control program. It’s simple yet powerful with a lot of features and capabilities; however, I see software engineers use only a handful of its commands in their day-to-day work. So, in this post, I would like to mention some git commands and options that are not being used so often but are very useful.

According to my observation (Probably people have already researched about it), These are the most used git commands by engineers: clone, commit, push, pull, add, status, stash, log, merge, and maybe rebase (I said maybe because the majority of people tend to use merge instead). Nowadays, I see some people also use the built-in git features in their preferred code editor or IDE. For example, in an IDE like PyCharm or VSCode, there’s a very powerful git integration that a lot of people are using (and it’s totally fine). However, somehow I don’t feel comfortable using them. The fact is, I want to see exactly what is happening under the hood and be able to run those commands myself.

The following is a list of some commands and options that you may don’t use often but they are very useful and powerful:

git commit --amend

When I’m coding, I commit very often and I believe this is the right thing to do; however, some engineers commit only when they are finished with the task. Sometimes after saving a commit, I notice there are still things that I would like to include in the commit message. Or, sometimes after I commit and before I push the code, I suddenly realise that there are still things that I would like to include in the same commit. Of course, I can still add them to a different commit, but to make the commit history cleaner I prefer to include them in the current one (Yes, I might have an OCD). To do that, the git commit --amend can be used. If you add the --amend at the end of the commit, it will add the staged files to the last commit and it also allows you to modify the commit message if you want.

Important: It’s very important not to use --amend when you have already pushed the changes into the remote. Otherwise, the will be conflicts between your local and the remote.

git show

I personally like this one a lot. A lot of times, you would like to understand what has changed in a commit. One way that is being used by most of the engineers I know is to use the Github/Gitlab GUI. However, you can do it easily offline as well using git show. To use this command, you need to have the commit hash (you can get it using git log):

git show 65de9d3c6afe0c75d5956b9fac692915881bd195

The above command shows all of the changes that happened in the commit 65de9d3c6afe0c75d5956b9fac692915881bd195. A lot of time, you would like to know what’s changed in the last commit. To do that you can use the HEAD keyword which points to the last commit in the tree.

git show HEAD

git diff [--staged]

A lot of times before you commit your changes, you may like to know what you have changed. Using the diff command will help you. It’s very similar to the show command we discussed above but for the current state of your work. One thing to note is that by default the diff command will now show changes that are staged. If you want to see those, you can use the --staged option.

git clone --depth=0

There are a lot of cases where I want to clone a project and check the source code but I don’t care about the history of all of the commits. This is mainly because I don’t want to contribute to the project but like to only check the code. For 90% of the project, there’s no such big difference given the recent internet connection speeds and computer hard drive capacities. However, there are still some projects that are too big to clone entirely. The Linux Kernel is a very good example of it. Android is another. When cloning a project you can use the --depth option to indicate the depth of history you would like to receive! If you would like to only have the latest state of the code, you can pass zero 0 to thedepth.

git log [options]

Git log is a classic git command. I also mentioned it in the beginning of the post. However, there are lots of very useful options that can be used to help you find what you want. Here are some of the them that I use the most:

git log --author=[the email address or name of the person] will show all of the commits by a specific person.

git log --oneline simplifies the log output by providing only the commit titles and not the details along with 7-character commit hashes.

git log --since=[date] --after=[date] will let you find the logs for the specific date range.

Nowadays, a lot of these commands and options I mentioned above are also available in your preferred Git service like GitHub and GitLab; but, as a person who prefers to spend more of his development time in the terminal, They are very useful. I hope you find it useful as well. If you know any cool git command that I haven’t mentioned it here, please feel free to email me using the one provided in the contact page.

In Git | 16 Sep 2023

How to access OS clipboard in neovim

One of the cool things about (neo)vim is that it has its own clipboard system meaning if you copy (yank) something, you won’t be able to just paste it in other apps because the clipboard is only available inside the editor. You might say this is not a good thing at all and I agree to some extend; however, in some cases it provides more flexibility.

Since I don’t like this behavior as well, whenever I configure a new machine, one of the first things I usually do is to setup my neovim in a way that it can read and write to the system clipboard. Recently, I was setting up an Ubuntu 22.04 laptop as my primary work machine and had some problem dealing with the clipboard in neovim; so, I decided to post this and provide some guide on how to access the system clipboard in different operating systems.

How it works actually?

Unlike vim, clipboard management in neovim is done via third-party apps. Consequently, you will need different tools for each OS you are working with. According to the neovim’s official documentation, for each OS, specific tools are required. So let’s dig in to each OS’s configuration separately:

macOS

The macOS configuration is probably the most straight-forward one since the pbcopy and pbpaste commands are already available. You all you need to do is to just set the clipboard correctly:

set clipboard+=unnamedplus

Windows

To be able to system clipboard on Windows, you need to install win32yank app. You can download it from here. After that, you need to set the clipboard just the macOS:

set clipboard+=unnamedplus

Note: I haven’t tried this myself since I don’t have any Windows machine.

Linux

Although accessing system clipboard should be the most straight-forward way on Linux; it’s not :-/ It’s actually depends on the window system that is being used. The two mostly used window systems are Wayland and X11:

Wayland

If you are using Wayland as your windows system (The default in Ubuntu 22.04 and some other mainstream distributions), you need to have wl-copy and wl-paste commands accessible in your $SHELL. You can install these two tools by install wl-clipboard package.

wl-clipboard can be installed using your distro’s package manager. For example in ubuntu you can use apt to install it:

sudo apt install wl-clipboard

However, if you couldn’t find it, you can simply check the GitHub repo here and install from source code.

X11

For X window system, you need to install xclip. Just like the instructions provided for the Wayland above, you should be able to install the package using the OS’s package manager. Also, if you couldn’t find it, you can also install it from source by checking the GitHub repo here.

Finally after installing the required tools, you need to also set the clipboard just like macOS and Windows:

set clipboard+=unnamedplus

How to solve Wayland issues with HiDPI and multiple monitors

Since I joined my current company, I had been using a 2020 Macbook Pro. To be honest, I was totally satisfied with that laptop as it was super stable. But the main reason I chose a Mac rather than Linux when I joined was because of the fact that at the time I joined the company, they were offering Dell Latidudes for Linux which are (in my opinion) not the best choices. Recently, the company announced that in addition to Dell laptops they have started to offer ThinkPad laptops for Linux users as well! So, without thinking further I requested it :)

Diffrent scale for each monitor

After receiving the new laptop, it took me a few days to configure it the way I want. At first, I had some issues with multiple monitor configurations and settings. The problem was I couldn’t set different scale factors for each monitor separately. When trying to do so, it was applying the last configuration to all of my monitors instead of keeping each configuration separated. I researched a lot about it and and realized that I had to activate the “Fractional Scaling” to be able to have separated configs for each monitor even if I didn’t want to use the actual fractional scaling feature.

So, if you want to set different scaling percentage for each monitors, you need to activate “Fractional Scaling” just like the following:

Fractional scaling option in GNOME Control Center

I know the provided solution is not relevant at all, but it was how it worked for me and I hope it works for you too.

Blurry texts in some apps

Another problem I faced was after changing the default scaling some apps’ texts became blurry. This is mainly because of the fact the some apps are not natively support Wayland. To Solve this problem you may need to two arguments when executing the app. These two arguments are --enable-features=UseOzonePlatform and --ozone-platform=wayland. For instance, here’s an example for Google Chrome:

google-chrome --enable-features=UseOzonePlatform --ozone-platform=wayland

You may say OK but I usually open Google Chrome from the menu not the terminal. Then, how can I add these arguments to the to the applications’ shortcuts? To include the arguments when running applications from the side menu or any menu in your Linux distro, you should add them to the applications’ .desktop files. Depending on the Linux distro you are using, the path to the files may vary. In Ubuntu, desktop files are located under /usr/share/applications. For example, to update Google Chrome shortcut, you should open /usr/share/applications/google-chrome.desktop (You may need to open the file with sudo since the user is root). After opening, search for the term Exec and add the above arguments like the following:

Exec=/usr/bin/google-chrome-stable --enable-features=UseOzonePlatform --ozone-platform=wayland %U

The only issue with this method is that every time apps are updated, they usually update their shortcuts as part of the installation process; so, you may need to do the steps mentioned above every time you update the apps.

Conclusion

Although more and more user are using Linux as their preferred desktop operating system, the application support is still limited in my opinion. You cannot expect everything to work as you expect from macOS and as a result, you should prepare yourself for a little bit of uncomfortably when want to switch to Linux OS especially for work. Also, all of the issues I have mentioned above are in place if you decide to choose “Wayland”. There’s also an option which you can use the legacy “X11” and according to my knowledge you won’t face any of the mentioned issues.