How to code like a hacker

If you’re reading this blog than you probably spend a lot of time using a keyboard to tell computers what to do. Here is how you can do less of the former and more of the latter, plus it makes you look like hacker on TV.

FYI this is specific to Apple Keyboards, but its not hard to figure out similar commands in any OS.

1) use ‘option’ & shift & arrow keys all at once

Open some text or a Jupiter notebook and try moving around the text using the arrow keys. Good, now hold down the ‘option’ key while you use the arrow keys.

You should now be moving word by word. In code this moves over things like big_long_dumb_var_names_df_joined__ in one fell swoop. AND it stops at points, commas, and parentheses which is logically very helpful. Now a row like this:

eda_info = eda_info.reindex_axis(sorted(eda_info.columns), axis=1)

Is 16 clicks long. Only using the arrow keys it would have been 64 clicks! Get good at this and you will start to look like a hacker for realz.

2) try ‘command’

Try it with arrows and shift like above. Its a quick way to get to the far end of a line or the top or bottom of a box.

3) don’t forget these keys exist.

It takes some practice but once you have it you’ll never look back.