Skip to content

Instantly share code, notes, and snippets.

jimothyGator /
Created January 24, 2019 20:34 — forked from bartoszmajsak/
How to automatically prepend git commit with a branch name
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
BRANCH_NAME=$(git symbolic-ref --short HEAD)
jimothyGator / .gitconfig
Last active August 29, 2015 14:06
Git aliases
View .gitconfig
ci = commit
co = checkout
st = status
lc = log ORIG_HEAD.. --stat --no-merges
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
conflicts = !git --no-pager diff --name-only --diff-filter=U
rollback = reset --soft HEAD^
root = !pwd
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(black)%s%C(reset) %C(dim black)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
jimothyGator / sidekiq.rake
Last active August 9, 2016 10:40
Strano init.d script and Rake task. Runs Strano with Puma. Adapted from init.d script for Gitlab.
View sidekiq.rake
# place in lib/tasks/
namespace :sidekiq do
desc "Strano | Stop sidekiq"
task :stop do
system "bundle exec sidekiqctl stop #{pidfile}"
desc "Strano | Start sidekiq"
task :start do
jimothyGator /
Last active February 26, 2023 01:58
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
jimothyGator / .bash_profile
Created March 8, 2013 14:37
Display current Git branch and root directory in Mac OS X Terminal title bar.
View .bash_profile
# Add to .bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
get_git_root() {
basename $(git rev-parse --show-toplevel 2> /dev/null) 2> /dev/null