Skip to content

Instantly share code, notes, and snippets.

Avatar

Jim Cushing jimothyGator

View GitHub Profile
@jimothyGator
jimothyGator / README.md
Last active Aug 6, 2020
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
View README.md
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 Mar 8, 2013
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
}
@jimothyGator
jimothyGator / prepare-commit-msg.sh
Created Jan 24, 2019 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
View prepare-commit-msg.sh
#!/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 / sidekiq.rake
Last active Aug 9, 2016
Strano init.d script and Rake task. Runs Strano with Puma. Adapted from init.d script for Gitlab. https://github.com/joelmoss/strano/
View sidekiq.rake
# 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
View .gitconfig
[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
You can’t perform that action at this time.