LOL. Yeah, pretty true.

June 13 Comments Off on LOL. Yeah, pretty true. Category: Code, Feed, Tumblr

LOL. Yeah, pretty true.

Code to get the first class of an object

June 09 Comments Off on Code to get the first class of an object Category: Code, Feed, Tumblr

Easy:event.target.className.split(” “)[0]; //0 to retrieve first class

Git trick for code review

April 13 Comments Off on Git trick for code review Category: Feed, Tumblr

Dealing with a specific branch outside of the master that you want to review? One with a lot of work merged in from various progress? The trick is to look at only those commit logs that distinguish it from the branch you want to merge it in to

git log oldbranch ^newbranch –no-merges 

Will let you see just the logs that are on oldbranch that aren’t on newbranch. Nifty! 

Some new git tricks

April 13 Comments Off on Some new git tricks Category: Feed, Tumblr

git fetch origin 
git reset –hard origin/master

I’ve known this one for a while, but worthwhile to write it down as a way to reset branch state. This can be especially important if you’ve had to do a few rebases in the past and the current history doesn’t match commit IDs with the new (origin) history. 

git clean -f -d –dry-run

Remove unstaged files with -f, also directories with -d. Preview the process before you do it with –dry-run.