261 private links
Using a similar process, including the habit of dropping any decimals after dividing by 2, you can also quickly and easily convert any decimal number to a binary number. How? You take any given number, ask yourself whether it's odd or even. If it's odd, you're going to write down a 1, and if it's even, you'll write down a 0. You then divide by 2, and repeat this process. When you've completed this step all the way down to 1, you're done.
To make this clearer, let's try a small example, such as 19. Working this out step-by-step, we get this:
19 is odd: 1
(19/2 = 9.5, round down to get 9)
9 is odd: 1
(9/2 = 4.5, round down to get 4)
4 is even: 0
(4/2 = 2)
2 is even: 0
(2/1 = 1)
1 is odd: 1
Working from top to bottom, we write these numbers down from right to left (opposite of the way you would normally read) to get 10011. Double checking with Wolfram|Alpha, we see that 10011 is indeed the binary for 19.
As you can see, this is actually a bit simpler than the Russian peasant multiplication, but comes across as more impressive.
Let's try this with a higher number, such as 76, and simulate how you'd think and write it when showing this to someone else (the steps of dividing by 2 and rounding down are implied from one step to the next), noting that each step's result is written to the left of the previous result:
Think: 76 is even...
Write: 0
Think: 38 is even...
Write: 00
Think: 19 is odd...
Write: 100
Think: 9 is odd...
Write: 1100
Think: 4 is even...
Write: 01100
Think: 2 is even...
Write: 001100
Think: 1 is odd...
Write: 1001100
Yep, 1001100 is binary for 76! From the point of view of anybody watching, you seem to just work out the binary equivalent of the given number in your head without breaking a sweat!
Once you're comfortable converting decimal to binary, it's not hard to learn to work the other way.
To take a binary number and convert it, you're going to start from the leftmost 1. The leftmost binary digit will always be a 1 because, just like in decimal, you can put as many zeroes as you want to the left side without changing the number.
You start at the leftmost 1 with a mental total of 1. Every time you move to the right, regardless of the digit, you're always going to multiply by 2. If the digit you're at is a 1, then you're going to add a 1. Next, you move to the right again and multiply by 2, adding 1 if the digit is 1, and so on until you get to the rightmost digit.
Multigit allows checking out multiple git repositories overlaid onto the same directory.
It is useful for projects which are made of different components that are developed separately, but which need to track files from different parts of the directory structure of the project.
Tiao (跳, Chinese for "jump") is a two-player strategy game where you capture pieces by jumping over them.
It's played on a 19×19 grid — the same as a Go board. First to capture 10 enemy pieces wins. White always moves first.
What Changes the Most: git log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -20
The 20 most-changed files in the last year. The file at the top is almost always the one people warn me about. “Oh yeah, that file. Everyone’s afraid to touch it.”
Who Built This: git shortlog -sn --no-merges
Every contributor ranked by commit count. If one person accounts for 60% or more, that’s your bus factor. If they left six months ago, it’s a crisis. If the top contributor from the overall shortlog doesn’t appear in a 6-month window (git shortlog -sn --no-merges --since="6 months ago"), I flag that to the client immediately.
Where Do Bugs Cluster: git log -i -E --grep="fix|bug|broken" --name-only --format='' | sort | uniq -c | sort -nr | head -20
Same shape as the churn command, filtered to commits with bug-related keywords
Is This Project Accelerating or Dying: git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -c
Commit count by month, for the entire history of the repo
How Often Is the Team Firefighting: git log --oneline --since="1 year ago" | grep -iE 'revert|hotfix|emergency|rollback'
Revert and hotfix frequency