Magit Tutorial - Bisect

How to use Magit in Emacs to do bisecting

3 minute read

Git rebase with Magit

It’s 5 o’clock on a sunny Friday afternoon, you are thinking where to have dinner with friends and such. The only thing you have to finish before you can go is to pull your colleage’s latest changes and make a demo build to customer. You pull, there are 20 commits all nicely structured, you are now giving yourself a pat on the back for teaching him to use rebase yesterday (by pointing him to these 2 wonderful articles 1 and 2).

Magit tutorial - Rebase (Part II)

How to use Magit in Emacs to do rebase in Git

2 minute read

Git rebase with Magit

In part I we went through how to use git rebase to modify commit history, things like reword a commit, squash multiple commits, split commit. In this part, we will talk about another common use case of rebase: rebase before merging branches. Let’s first create a new repo and add one file.txt as the first commit. apple pear peach cat dog snake Now we create a feature branch from master branch.

Magit tutorial - Rebase (Part I)

How to use Magit in Emacs to do rebase in Git

3 minute read

Git rebase with Magit

Magit is arguably the best Git tool out there and also my favorite. It is a package in Emacs, and it is text based. In this tutorial, we will explore how to use it to tackle one of the more elusive topics in Git: Rebase. In the beginning there was darkness Let’s create an empty repository and add one empty file to it. git init touch file.txt git add . git commit -m 'first commit' Rewording commit Now let’s add some fruits in the file.

Tree Vs Iterative Fibbonacci Numbers

Two types of recursion

2 minute read

Being a programmer, you should be very familiar with Fibbonacci numbers. It is often being introduced when teaching recursion. Tree Recursion Most likely the implementation of a function that calculate fib number is as follows: (defn fib-tree [n] (cond (= n 0) 0 (= n 1) 1 :else (+ (fib-tree (- n 1)) (fib-tree (- n 2))))) This is just a direct translation from the Fibonacci number definition. Since it is straightforward and easy to understand, most textbooks use it as an typical example for illustrating recursive function.

How (Not) To Store Password

Ways not to store user passwords and why

3 minute read

Design and Architecture

If you are a programmer, especially backend programmer, sooner or later you will face the problem of storing users' passwords. Even though at first sight this seems like an entry level problem that we should hand over to an intern, it is really not. If you ask me how to do it. My first answer would be DON’T DO IT! I’m serious, try to avoid it as much as you can, just use Google or Facebook signin and your life goes on.