Installing Homebrew for all your OSX command line goods

Getting your source on is a whole lot easier when using a package manager, for linux you might use Yum or APT, but on OSX Homebrew is my goto. It’s super easy to install, but to get full benefits and access to more software you will need to have an install disc or have the developer tools already installed. If you don’t you can download it from apple. Google it or comment if you need to know what I’m talking about.

Installing Homebrew on OSX in the Terminal

Installing Homebrew takes 5 seconds

Here’s how you install Homebrew:

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)

of course using ruby is awesome, because it's installed by default on everyone's machine and has read write. Also notice that it's not using wget, which you won't have on a clean install w/out the dev tools. Underneath brew is pretty much an alias to GIT with some cool ruby helpers.

Once you have brew installed you can do things like:

brew install mongodb

Command Z for developers

If your using GIT, your going to love this:

git reset HEAD~1

That will take you back to your last commit while leaving your working directory (files) alone. This is great if you make a commit and want to fix something, you would just do git reset HEAD~1, make your chages and then add and commit as regular.

Gitting Advanced

# Roll back one commit leaving the working directory intact
git reset HEAD~1

# Roll back your working directory to the last commit
git reset --hard HEAD~1

# Keeps the files AND index (what's been added for commit)
git reset --soft HEAD~1

One more thing…

Need to go back to a specific commit? Just use the commit’s SHA hash instead of HEAD~1, like so:
git reset --hard 9748bc01c6ef45ef7f824c6f2bd6052f0d8b9691

Protip: You can find your commit hash using git log.

SNIPPLR – Social code bookmarking

Aside

I recently found the amazing website and resource snipplr.com. I was delighted to see a vibrant community of developers sharing ideas, techniques, and approaches to problems. I immediatly added my first real “snippet” a expandable div with jQuery. I then found they ha a wordpress plugin, bookmarklet, and some other cool features. Well guess what, someone made my expandable div even better!

[snippet=16087]

I hope you all come to snipplr!