Monday, December 29, 2014

Git Tip of the Year: Find the Most Recent Common Commit

Okay, you're working on a branch called 'awesome' and you want to know what's the most recent common commit of branch 'awesome' and 'master'.

Just run this:
$ git merge-base awesome master
d931216adebf441dc7431f1a073baed8b4a1b20a
And you'll get the SHA1 of the most recent common commit.

Friday, December 26, 2014

IntelliJ Tip of The Year: Rectangular Select

Okay, you want to select a rectangular area in your favorite IDE?

If your favorite IDE is made by IntelliJ here's what you can do:
  1. Hold an  ⌥ (Option) key and do your usual select of the area.
  2. Enjoy yourself.
Here's a video:

Wednesday, December 24, 2014

Github Tip of the Year: Shortcuts for Searching

Github has two great shortcuts that can change your life.

1. Let's say you're browsing the bootstrap repository and you want to find a file named tooltip.js
Press T (yeah, that's the character T on your keyboard).
Boom!
You've activated the File Finder:



Just type tooltip and enjoy yourself:


You can exit the File Finder by pressing Escape.

2. Let's say you're browsing the bootstrap repository and you want to search for a string "awesome".
So, you need to click on a search box and start typing, right?
Nope, just type S (yeah,  that's the character S on your keyboard).
Boom!
The search box is focused now!
Just type awesome into it and press Enter.


Isn't Github awesome?

Sunday, December 21, 2014

PyCharm Tip of the Year: Switch to the Previous File

This tip applies to any IntelliJ product.

Press ⌘-E (slow motion instant replay: Command-E). The popup window containing the list of recent files will appear:


Just press Enter to switch to the previous file. In this example that'll be a file pydrill.css.

To sum it up: to switch to the previous file in IntelliJ press ⌘-E followed by Enter.

Thursday, December 18, 2014

Git Tip of the Year: Switch to the Previous Branch

Okay, you're working on a branch called 'awesome'. You switch to a branch 'master'. You merge 'awesome' into 'master'

How do you switch back to 'awesome'?
Use git checkout - to switch to the previous branch.
# suppose we're at the branch 'master' now
$ git checkout -
Switched to branch 'awesome'
# now let's go back to master
$ git checkout -
Switched to branch 'master'
Yeah, that's pretty similar to a good old cd -.

Git Tip of the Year: Aliases

If you want to use the "git st" instead of the "git status" then you've come to the right place.

If you want to use the "git co" instead of the "git checkout" then you've come to the right place.

If you want to use the "git ci" instead of the "git commit" then you've come to the right place.

Just run this commands:
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.ci commit
And you're done:
$ git ci --allow-empty -m "nice, we can commit with 'git ci' now"
Yay, we've just made a subversion out of git!

Monday, December 15, 2014

Alfred Tip of the Year: Run Command in the Terminal

First things first. This tip is for the powerpack. Come on, it's only £17!

Okay, fire up Alfred, type ">" followed by the terminal command:
This will open the Terminal and run the command "say Hallo".

If you want to use iTerm2 instead of the Terminal (who wouldn't?), no problem: Alfred Preferences -> Features -> Terminal -> Application:


Just choose an iTerm2 in the dropdown menu and you're set.


only £17 only only £17£17