Permalink
Browse files

Synced w holman/dotfiles

  • Loading branch information...
1 parent a07f4eb commit f7fa3a67c04b7c5ec607b9bfeb9727a9b53bfd48 @dflems committed Dec 3, 2013
View
@@ -8,8 +8,5 @@
# Set OS X defaults
$ZSH/osx/set-defaults.sh
-# Upgrade homebrew
-brew update
-
-# Install homebrew packages
+# Install/update homebrew packages
$ZSH/homebrew/install.sh 2>&1
View
@@ -14,7 +14,7 @@
# $ e /usr/local
# # => opens the specified directory in your editor
-if [ "$1" == "" ] ; then
+if [ "$1" = "" ] ; then
exec $EDITOR .
else
exec $EDITOR "$1"
View
@@ -42,4 +42,4 @@ test -z "$res" && {
exit 1
}
-echo "$res"
+echo "$res"
View
@@ -1,51 +0,0 @@
-#!/bin/sh
-#/ Usage: man.cx [<section>] <topic>...
-#/ Open manpage <topic> on http://man.cx. When <section> is given, it
-#/ must start with a numeric. Multiple <topic>s may be specified.
-set -e
-
-# Open the cowsay(1) and wall(1) manpages:
-# $ man.cx cowsay wall
-#
-# Open the 1posix section sh, command, and type manpages:
-# $ man.cx 1posix sh command type
-
-# Command to use when opening URLs. Use the first one found on
-# PATH, unless the BROWSER environment variable is already set.
-: ${BROWSER:=$(
- for c in xdg-open open firefox
- do command -v $c && break
- done
- )}
-
-# The man.cx root URL
-MANCX_URL="http://man.cx"
-
-# Write usage and bail out with no args or with --help.
-test $# -eq 0 -o $(expr "$*" : ".*--help") -ne 0 && {
- grep ^#/ < $0 |
- cut -c4-
- exit
-}
-
-# Bail out if we couldn't find a browser.
-test -z "$BROWSER" && {
- echo "$(basename $0): BROWSER not set and no opening program found" 2>&1
- exit 1
-}
-
-# When the first arg starts with a numeric, its the <section>.
-section=
-case "$1" in [0-9]*)
- section="($1)"
- shift
- ;;
-esac
-
-# Run over remaining arguments and open in BROWSER.
-for page in "$@"
-do $BROWSER "${MANCX_URL}/${page}${section}"
-done
-
-# Copyright (c) 2010 by Ryan Tomayko <http://tomayko.com/about>
-# This is Free Software distributed under the terms of the MIT license
View
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Quick search in a directory for a string ($1).
+#
+set -e
+
+# use -iru to search directories ack usually ignores (like .git)
+if [ -x /usr/bin/ack-grep ]; then
+ ack-grep -i $1
+else
+ ack -i $1
+fi
View
@@ -2,14 +2,3 @@
if (( $+commands[hub] )) then
alias git=hub
fi
-
-# The rest of my fun git aliases
-alias gl='git pull --prune'
-alias gp='git push origin HEAD'
-alias gd='git diff'
-alias gc='git commit'
-alias gca='git commit -a'
-alias gco='git checkout'
-alias gb='git branch'
-alias gs='git status -sb' # upgrade your git if -sb breaks for you. it's fun.
-alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
View
@@ -1,5 +0,0 @@
-#!/bin/sh
-#
-# Use the last commit message and amend your stuffs.
-
-git commit --amend -C HEAD
@@ -1,62 +0,0 @@
-#!/bin/bash
-#
-# From Gary Berhnardt
-# https://github.com/garybernhardt/dotfiles/blob/master/bin/git-divergence
-
-set -e
-
-(
- function branch() {
- git branch 2>/dev/null | grep -e '^*' | tr -d '\* '
- }
-
- function ensure_valid_ref() {
- ref=$1
- (
- set +e
- git show-ref $ref > /dev/null
- if [[ $? == 1 ]]; then
- echo "$0: bad ref: $ref"
- exit 1
- fi
- )
- }
-
- function show_rev() {
- rev=$1
- git log -1 $rev --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
- echo
- git di $rev^..$rev | diffstat
- echo
- }
-
- if [[ $# == 2 ]]; then
- LOCAL=$1
- REMOTE=$2
- elif [[ $# == 1 ]]; then
- LOCAL=`branch`
- REMOTE=$1
- else
- LOCAL=`branch`
- REMOTE=origin/$LOCAL
- fi
-
- ensure_valid_ref $LOCAL
- ensure_valid_ref $REMOTE
-
- echo "changes from local ${LOCAL} to remote ${REMOTE}:"
- echo
-
- echo incoming:
- echo
- for rev in `git rev-list $LOCAL..$REMOTE`; do
- show_rev $rev
- done
-
- echo
- echo outgoing:
- echo
- for rev in `git rev-list $REMOTE..$LOCAL`; do
- show_rev $rev
- done
-) | less -r
@@ -1,6 +0,0 @@
-#!/bin/bash
-#
-# From Gary Berhnardt
-# https://github.com/garybernhardt/dotfiles/blob/master/bin/git-goodness
-
-git diff $* | gn
View
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Nukes a branch locally and on the origin remote.
+#
+# $1 - Branch name.
+#
+# Examples
+#
+# git nuke add-git-nuke
+
+git branch -D $1
+git push origin :$1
View
@@ -2,4 +2,3 @@
git submodule sync
git submodule update --init --recursive
-
View
@@ -1,23 +0,0 @@
-#!/bin/sh -e
-# git trail [-r] [-t] [COMMIT] - show all branching points in Git history
-
-[ "$1" = -r ] && shift || REMOTES="-e refs/remotes/"
-[ "$1" = -t ] && shift || TAGS="-e refs/tags/"
-COMMIT=$(git rev-parse --no-flags --default HEAD "$@")
-
-{ git for-each-ref | grep -v -e '^$' $TAGS $REMOTES
- git log --date=short --format="%cd %h %H" "$@"
-} | awk '
- $2 == "commit" || $2 == "tag" {
- "git merge-base '$COMMIT' " $1 | getline mb
- merge[mb] = merge[mb] " " $3
- }
- {
- if ($3 in merge) {
- split(merge[$3], mbs, " ")
- for (i in mbs) {
- "git name-rev --name-only --refs=\"" mbs[i] "\" " $3 | getline nr
- if (nr != "undefined") print $1, $2, nr # skip unreachable commits
- }
- }
- }' | git -p column # paginate output
View
@@ -1,31 +0,0 @@
-#!/usr/bin/python
-#
-# From Gary Berhnardt
-# https://github.com/garybernhardt/dotfiles/blob/master/bin/gn
-#
-# Print a diff summary like:
-#
-# $ git diff 'master~10..master' | gn
-# 293 lines of diff
-# 185 lines added
-# 19 lines removed
-# +166 lines net change
-
-import sys, os, re, fileinput
-
-def get_lines(diff_lines):
- # Added lines start with '+' (but not '+++', because that marks a new
- # file). The same goes for removed lines, except '-' instead of '+'.
- added_lines = [line for line in diff_lines
- if line.startswith('+') and not line.startswith('+++')]
- removed_lines = [line for line in diff_lines
- if line.startswith('-') and not line.startswith('---')]
- return added_lines, removed_lines
-
-if __name__ == '__main__':
- diff_lines = list(fileinput.input())
- added_lines, removed_lines = get_lines(diff_lines)
- print '%i lines of diff' % len(diff_lines)
- print '%i lines added' % len(added_lines)
- print '%i lines removed' % len(removed_lines)
- print '%+i lines net change' % (len(added_lines) - len(removed_lines))
@@ -6,47 +6,21 @@
[credential]
helper = osxkeychain
[alias]
- # Most of these courtesy of garybernhardt
- # https://github.com/garybernhardt/dotfiles/blob/master/.gitconfig
+ b = branch
st = status -sb
ci = commit
co = checkout
- di = diff
- dc = diff --cached
- amend = commit --amend
+ amend = commit --amend -C HEAD
aa = add --all
- ff = merge --ff-only
- pullff = pull --ff-only
- noff = merge --no-ff
- fa = fetch --all
- pom = push origin master
- b = branch
- ds = diff --stat=160,120
- dh1 = diff HEAD~1
-
- # Divergence (commits we added and commits remote added)
- div = divergence
-
- # Goodness (summary of diff lines added/removed/total)
- gn = goodness
- gnc = goodness --cached
+ po = push origin
+ dlm = !git-delete-local-merged
- # Fancy logging
- # h = head
- # hp = head with patch
- # r = recent commits, only current branch
- # ra = recent commits, all reachable refs
- # l = all commits, only current branch
- # la = all commits, all reachable refs
- head = !git l -1
- h = !git head
- hp = "!. ~/.githelpers && show_git_head"
- r = !git l -30
- ra = !git r --all
+ # l = log all commits, (la = all reachable refs)
+ # r = log recent commits (ra = all reachable refs)
l = "!. ~/.githelpers && pretty_git_log"
la = !git l --all
-
- news = log -p HEAD@{1}..HEAD@{0}
+ r = !git l -20
+ ra = !git r --all
[color]
diff = auto
status = auto
@@ -64,8 +38,4 @@
[help]
autocorrect = 1
[push]
- # See `git help config` (search for push.default)
- # for more information on different options of the below setting.
- #
- # Setting to git 2.0 default to surpress warning message
default = simple
@@ -21,11 +21,6 @@ SUBJECT="%s"
FORMAT="$HASH}$RELATIVE_TIME}$AUTHOR}$REFS $SUBJECT"
-show_git_head() {
- pretty_git_log -1
- git show -p --pretty="tformat:"
-}
-
pretty_git_log() {
git log --graph --pretty="tformat:${FORMAT}" $* |
# Replace (2 years ago) with (2 years)
View
@@ -8,12 +8,13 @@
# Check for Homebrew
if test ! $(which brew)
then
-echo " x You should probably install Homebrew first:"
- echo " https://github.com/mxcl/homebrew/wiki/installation"
- exit
+ echo " Installing Homebrew for you."
+ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" > /tmp/homebrew-install.log
+else
+ brew update
fi
# Install homebrew packages
-brew install grc coreutils z
+brew install grc coreutils
exit 0
View
@@ -1 +1 @@
-alias iossim="open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app"
+alias ios="open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app"
View
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if test ! $(which rbenv)
+then
+ echo " Installing rbenv for you."
+ brew install rbenv > /tmp/rbenv-install.log
+fi
+
+if test ! $(which ruby-build)
+then
+ echo " Installing ruby-build for you."
+ brew install ruby-build > /tmp/ruby-build-install.log
+fi
Oops, something went wrong.

0 comments on commit f7fa3a6

Please sign in to comment.