Skip to content

Instantly share code, notes, and snippets.

@shifakhan
Created March 14, 2016 17:46
Show Gist options
  • Save shifakhan/8fd07497630ad1836019 to your computer and use it in GitHub Desktop.
Save shifakhan/8fd07497630ad1836019 to your computer and use it in GitHub Desktop.
Script to create shortcuts / aliases in Rails project, or any other project using gem aka
#!/bin/bash
echo 'Creating aliases'
if SOURCE="${BASH_SOURCE[0]}"; then
echo 'Install and setup aka gem'
echo `sudo gem install aka2`
echo `sudo aka init --dotfile $HOME/.bash_profile`
echo 'Setting up aliases'
# System
echo `aka g lsl='ls -Gp -halt'`
# Rails
echo `aka g rc='rails c'`
echo `aka g rs='rails s'`
# Git
echo `aka g gc='git checkout'`
echo `aka g gs='git status'`
echo `aka g latest_branches='for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r'`
# SSH
echo `aka g ssh-staging='ssh user@12.23.233.123'`
echo `aka g ssh-production='ssh user@12.23.233.123'`
fi
source $HOME/.bash_profile
echo `aka l`
@shifakhan
Copy link
Author

Run: source shortcuts.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment