Blog

Firefox tricks: efficient QuantumBar usage

6 minute read    Published: 2021-09-07

The Firefox QuantumBar (formerly AwesomeBar, or just address bar) is surprisingly capable. There's a lot you can do with it to quickly navigate through your browser. It's one of the things which makes Firefox so comfy to me.

I like to be as quick as possible without leaving the keyboard. For this, I use scope characters, bookmark keywords, and DuckDuckGo bangs. In this article I'll go through these features and hope to show you something new, no add-ons required.

Elegant bash conditionals

5 minute read    Published: 2021-03-02

The if-statement is a very basic thing, not just in bash, but in all of programming. I see them used quite a lot in shell scripts, even though in many cases they can be replaced with something much more elegant.

In this rather short article, I'll show how control operators can be used instead. Many probably know about this, but don't realize how to use them nicely. This will help you write cleaner shell scripts in the future.

Here is what a simple if-statements looks like in bash:

if [ expression ]
then
    command
fi

# or
if [ expression ]; then command; fi

Ughh. Let's improve!

List & export your subreddits

2 minute read    Published: 2021-03-01

The last few years I've been wanting to export the list of subreddits I joined. It's fun to share with friends having a similar interest, as I've collected many gems throughout the years.

To achieve this I've set-up a simple script. It exports your subreddits to a plain text list.

Reconnect to broken tmux session

2 minute read    Published: 2021-02-28

Ever tried to attach to a running tmux session, only to find that that fails?

tmux attach
# no sessions
tmux ls
# error connecting to /tmp/tmux-1000/default (No such file or directory)

Even though you're sure tmux is running fine, it shows up as running in your task manager after all.

So, where are your precious tmux sessions?

Solving Advent of Code 2020 in under a second

25 minute read    Published: 2021-02-27
       ,--.-----.--.
       |--|-----|--|
       |--|     |--|
       |  |-----|  |
     __|--|     |--|__
    /  |  |-----|  |  \              mm    mmmm    mmm
   /   \__|-----|__/   \             ##   m"  "m m"   "
  /   ______---______   \/\         #  #  #    # #
 /   /               \   \/         #mm#  #    # #
{   /    _     _   _  \   }        #    #  #mm#   "mmm"
|  { /  | | . | | /|   }  |-,   
|  | \  |_| . |_| _|_  |  | |    mmmm   mmmm   mmmm   mmmm
|  {                   }  |-'   "   "# m"  "m "   "# m"  "m
{   \                 /   }         m" #  m #     m" #  m #
 \   `------___------'   /\       m"   #    #   m"   #    #
  \     __|-----|__     /\/     m#mmmm  #mm#  m#mmmm  #mm#
   \   /  |-----|  \   /
    \  |--|     |--|  /
     --|  |-----|  |--
       |--|     |--|
       |--|-----|--|
       `--'-----`--'

Advent of Code is a popular yearly programming competition. It's an Advent calendar of small programming puzzles for a variety of skill sets and levels that can be solved in any programming language you like.

Puzzles are released daily throughout December. More than 150k people take part in this event. The toughest battle to solve each puzzle as soon as possible to become the best on the global leaderboard.

In my timezone, puzzles are released at 6 o'clock in the morning. Since I'm a night owl, the biggest challenge for me here is to get up so early. I, therefore, set a different goal instead.