Skip to content

Instantly share code, notes, and snippets.

@jimothyGator
jimothyGator / prepare-commit-msg.sh
Created January 24, 2019 20:34 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/bin/bash
# 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)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
@jimothyGator
jimothyGator / .gitconfig
Last active August 29, 2015 14:06
Git aliases
[alias]
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
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. https://github.com/joelmoss/strano/
# place in lib/tasks/
namespace :sidekiq do
desc "Strano | Stop sidekiq"
task :stop do
system "bundle exec sidekiqctl stop #{pidfile}"
end
desc "Strano | Start sidekiq"
task :start do
@jimothyGator
jimothyGator / README.md
Last active October 1, 2024 21:57
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
jimothyGator / .bash_profile
Created March 8, 2013 14:37
Display current Git branch and root directory in Mac OS X Terminal title bar.
# 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
}