September 10, 2015

My Favorite Git Aliases

If you're like me, you like to find patterns in your work and turn them into aliases and shortcuts in the terminal. I thought I'd share with you my current Git aliases, explaining a few along the way.

For starters, you'll want to add these aliases to your .gitconfig file.

[alias]
  br = branch
  brm = branch --merged
  brnm = branch --no-merged
  ci = commit
  co = checkout
  copl = "!f() { git checkout $1 && git pull --rebase origin $1; }; f"
  df = diff
  lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
  mg = merge
  st = status
  plo = pull --rebase origin
  pho = push origin
  plod = pull --rebase origin dev
  phod = push origin dev
  plos = pull --rebase origin stage
  phos = push origin stage
  plom = pull --rebase origin master
  phom = push origin master
  reaper-nokill = remote prune --dry-run origin
  reaper = remote prune origin

Most of these aliases are…

Categories
Web Development
August 08, 2015

How to Set the Order of Media Queries for Sprockets Media Query Combiner

Today I was working on a project that's about to launch in a few weeks. I was asked to make a last-minute change to the layout of a page (of course!), which required me to use a media query size I had not yet used in the project. At FINE, we've established the standard of using a breakpoint mixin…

Categories
Web Development
July 25, 2015

Bash Shortcut: Copy your Present Working Directory to your Clipboard

Like most developers, I'm always looking for ways to increase my efficiency. One way I like to do this is through Bash functions.

Just like other programming languages, Bash functions allow you to combine Bash commands or manipulate user input to output a desired effect. While I have a good number…

Categories
Web Development
July 25, 2015

Bash Shortcut: How to Make Directory and Change Directory in One Command

If you're like me, you're constantly using the command line to make a directory and then immediately change to that directory. Here's a Bash function that will allows you to do that:

# Make a directory && cd into that directory
function mkdircd () { mkdir -p "$@" && eval cd "\"\$$#\""; }

This function takes the user supplied directory name, makes all the directories needed to get there, and then cds to…

Categories
Web Development
January 26, 2015

Small Gripe: Target="_blank"

I'm often asked to make small, almost trivial changes to our clients' websites. One of these changes that grinds my gears is the frequent request to "Make this hyperlink open in a new tab/window."

This bothers me because it changes the default behavior of links and takes away the user's control over…

Categories
Web Development
Previous12345678
9
10Next