Permalink
Browse files

Moved to Holman topical setup

  • Loading branch information...
1 parent 48018a4 commit 00f1393d4f42f4c5c13bfda2e4615a63b0f716b9 @pengwynn committed Mar 27, 2012
Showing with 919 additions and 197 deletions.
  1. +2 −2 .gitignore
  2. +0 −30 .gitmodules
  3. +57 −0 Rakefile
  4. 0 home/.ackrc → ack/ackrc.symlink
  5. +22 −0 bin/e
  6. +5 −0 bin/git-all
  7. +5 −0 bin/git-amend
  8. +13 −0 bin/git-credit
  9. +8 −0 bin/git-delete-local-merged
  10. 0 {scripts → bin}/git-diff-grep
  11. +18 −0 bin/git-promote
  12. +60 −0 bin/git-rank-contributers
  13. +5 −0 bin/git-undo
  14. +36 −0 bin/git-up
  15. +364 −0 bin/git-wtf
  16. +33 −0 bin/gitio
  17. +8 −0 bin/headers
  18. +30 −0 bin/movieme
  19. +56 −0 bin/mustacheme
  20. +8 −0 bin/search
  21. +152 −0 bin/spark
  22. +34 −0 bin/wifi-signal-strength
  23. 0 {zsh → git}/git.zsh
  24. 0 {home/.git_template → git/git_template.symlink}/hooks/ctags
  25. 0 {home/.git_template → git/git_template.symlink}/hooks/post-checkout
  26. 0 {home/.git_template → git/git_template.symlink}/hooks/post-commit
  27. 0 {home/.git_template → git/git_template.symlink}/hooks/post-merge
  28. 0 {home/.git_template → git/git_template.symlink}/hooks/post-rewrite
  29. 0 home/.gitconfig → git/gitconfig.symlink
  30. 0 home/.gitingore → git/gitingore.symlink
  31. +0 −1 home/.janus/bubblegum
  32. +0 −1 home/.janus/hemisu
  33. +0 −1 home/.janus/nginx
  34. +0 −1 home/.janus/sahara
  35. +0 −1 home/.janus/taskpaper
  36. +0 −1 home/.janus/vim-bundler
  37. +0 −1 home/.janus/vim-stylus
  38. +0 −4 home/.powconfig
  39. +0 −63 home/.vimrc.after
  40. +0 −3 home/.vimrc.before
  41. 0 mail/.gitkeep
  42. 0 {zsh → node}/node.zsh
  43. 0 {zsh → ruby}/bundler.zsh
  44. 0 home/.gemrc → ruby/gemrc.symlink
  45. 0 home/.irbrc → ruby/irbrc.symlink
  46. 0 {zsh → ruby}/rails.zsh
  47. 0 home/.rspec → ruby/rspec.symlink
  48. 0 {zsh → sass}/sass.zsh
  49. +0 −85 scripts/spark
  50. 0 {zsh → titanium}/titanium.zsh
  51. 0 home/.tmux.conf → tmux/.tmux.conf.symlink
  52. 0 {zsh → tmux}/tmux.zsh
  53. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/betasplash.yml
  54. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/charity.yml
  55. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/fumblr.yml
  56. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/gtd.yml
  57. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/mission.yml
  58. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/paula.yml
  59. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/tcl.yml
  60. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/tsw.yml
  61. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/twitter.yml
  62. 0 {home/.tmuxinator → tmux/tmuxinator.symlink}/wynn.yml
  63. 0 tumblr/.gitkeep
  64. +1 −0 vim/vim.zsh
  65. +0 −1 zsh/common.zsh
  66. +2 −2 home/.zshrc → zsh/zshrc.symlink
View
@@ -1,2 +1,2 @@
-zsh/*_private.zsh
-zsh/*_creds.zsh
+*_private.zsh
+*_creds.zsh
View
@@ -1,30 +0,0 @@
-[submodule "home/.janus/taskpaper"]
- path = home/.janus/taskpaper
- url = https://github.com/davidoc/taskpaper.vim.git
-[submodule "home/.janus/nginx"]
- path = home/.janus/nginx
- url = https://github.com/jinfield/vim-nginx.git
-[submodule "home/.janus/YankRing"]
- path = home/.janus/YankRing
- url = https://github.com/vim-scripts/YankRing.vim.git
-[submodule "home/.janus/bubblegum"]
- path = home/.janus/bubblegum
- url = https://github.com/baskerville/bubblegum.git
-[submodule "yankring"]
- path = yankring
- url = https://github.com/vim-scripts/YankRing.vim.git
-[submodule "home/.janus/yankring"]
- path = home/.janus/yankring
- url = https://github.com/vim-scripts/YankRing.vim.git
-[submodule "home/.janus/sahara"]
- path = home/.janus/sahara
- url = https://github.com/tejr/sahara.git
-[submodule "home/.janus/vim-bundler"]
- path = home/.janus/vim-bundler
- url = https://github.com/tpope/vim-bundler.git
-[submodule "home/.janus/hemisu"]
- path = home/.janus/hemisu
- url = https://github.com/noahfrederick/Hemisu.git
-[submodule "home/.janus/vim-stylus"]
- path = home/.janus/vim-stylus
- url = https://github.com/wavded/vim-stylus.git
View
@@ -0,0 +1,57 @@
+require 'rake'
+
+desc "Hook our dotfiles into system-standard positions."
+task :install do
+ linkables = Dir.glob('*/**{.symlink}')
+
+ skip_all = false
+ overwrite_all = false
+ backup_all = false
+
+ linkables.each do |linkable|
+ overwrite = false
+ backup = false
+
+ file = linkable.split('/').last.split('.symlink').last
+ target = "#{ENV["HOME"]}/.#{file}"
+
+ if File.exists?(target) || File.symlink?(target)
+ unless skip_all || overwrite_all || backup_all
+ puts "File already exists: #{target}, what do you want to do? [s]kip, [S]kip all, [o]verwrite, [O]verwrite all, [b]ackup, [B]ackup all"
+ case STDIN.gets.chomp
+ when 'o' then overwrite = true
+ when 'b' then backup = true
+ when 'O' then overwrite_all = true
+ when 'B' then backup_all = true
+ when 'S' then skip_all = true
+ when 's' then next
+ end
+ end
+ FileUtils.rm_rf(target) if overwrite || overwrite_all
+ `mv "$HOME/.#{file}" "$HOME/.#{file}.backup"` if backup || backup_all
+ end
+ `ln -s "$PWD/#{linkable}" "#{target}"`
+ end
+end
+
+task :uninstall do
+
+ Dir.glob('**/*.symlink').each do |linkable|
+
+ file = linkable.split('/').last.split('.symlink').last
+ target = "#{ENV["HOME"]}/.#{file}"
+
+ # Remove all symlinks created during installation
+ if File.symlink?(target)
+ FileUtils.rm(target)
+ end
+
+ # Replace any backups made during installation
+ if File.exists?("#{ENV["HOME"]}/.#{file}.backup")
+ `mv "$HOME/.#{file}.backup" "$HOME/.#{file}"`
+ end
+
+ end
+end
+
+task :default => 'install'
File renamed without changes.
View
22 bin/e
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Quick shortcut to an editor.
+#
+# This means that as I travel back and forth between editors, hey, I don't have
+# to re-learn any arcane commands. Neat.
+#
+# USAGE:
+#
+# $ e
+# # => opens the current directory in your editor
+#
+# $ e .
+# $ e /usr/local
+# # => opens the specified directory in your editor
+
+if test "$1" == ""
+then
+ $($EDITOR .)
+else
+ $($EDITOR $1)
+fi
View
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+# Stage all unstaged.
+
+git add -A
View
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+# Use the last commit message and amend your stuffs.
+
+git commit --amend -C HEAD
View
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# A very slightly quicker way to credit an author on the latest commit.
+#
+# $1 - The full name of the author.
+# $2 - The email address of the author.
+#
+# Examples
+#
+# git credit "Zach Holman" zach@example.com
+#
+
+git commit --amend --author "$1 <$2>" -C HEAD
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# Delete all local branches that have been merged into HEAD. Stolen from
+# our favorite @tekkub:
+#
+# https://plus.google.com/115587336092124934674/posts/dXsagsvLakJ
+
+git branch -d `git branch --merged | grep -v '^*' | tr -d '\n'`
File renamed without changes.
View
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# Promotes a local topic branch to a remote tracking branch of the same name,
+# by pushing and then setting up the git config
+#
+# Thanks to ENTP:
+# http://hoth.entp.com/2008/11/10/improving-my-git-workflow
+
+curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
+
+remote_branch=$(git branch -r | grep "origin/${curr_branch}")
+[ -z "${remote_branch}" ] && ( git push origin "${curr_branch}" )
+
+origin=$(git config --get "branch.${curr_branch}.remote")
+[ -z "${origin}" ] && ( git config --add "branch.${curr_branch}.remote" origin )
+
+merge=$(git config --get "branch.${curr_branch}.merge")
+[ -z "${merge}" ] && ( git config --add "branch.${curr_branch}.merge" "refs/heads/${curr_branch}" )
View
@@ -0,0 +1,60 @@
+#!/usr/bin/env ruby
+
+## git-rank-contributors: a simple script to trace through the logs and
+## rank contributors by the total size of the diffs they're responsible for.
+## A change counts twice as much as a plain addition or deletion.
+##
+## Output may or may not be suitable for inclusion in a CREDITS file.
+## Probably not without some editing, because people often commit from more
+## than one address.
+##
+## git-rank-contributors Copyright 2008 William Morgan <wmorgan-git-wt-add@masanjin.net>.
+## This program is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or (at
+## your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You can find the GNU General Public License at:
+## http://www.gnu.org/licenses/
+
+class String
+ def obfuscate; gsub(/@/, " at the ").gsub(/\.(\w+)(>|$)/, ' dot \1s\2') end
+ def htmlize; gsub("&", "&amp;").gsub("<", "&lt;").gsub(">", "&gt;") end
+end
+
+lines = {}
+verbose = ARGV.delete("-v")
+obfuscate = ARGV.delete("-o")
+htmlize = ARGV.delete("-h")
+
+author = nil
+state = :pre_author
+`git log -M -C -C -p --no-color`.split("\n").each do |l|
+ case
+ when (state == :pre_author || state == :post_author) && l =~ /Author: (.*)$/
+ author = $1
+ state = :post_author
+ lines[author] ||= 0
+ when state == :post_author && l =~ /^\+\+\+/
+ state = :in_diff
+ when state == :in_diff && l =~ /^[\+\-]/
+ lines[author] += 1
+ when state == :in_diff && l =~ /^commit /
+ state = :pre_author
+ end
+end
+
+lines.sort_by { |a, c| -c }.each do |a, c|
+ a = a.obfuscate if obfuscate
+ a = a.htmlize if htmlize
+ if verbose
+ puts "#{a}: #{c} lines of diff"
+ else
+ puts a
+ end
+end
View
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+# Undo your last commit, but don't throw away your changes
+
+git reset --soft HEAD^
View
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Usage: git-up
+# git-reup
+#
+# Like git-pull but show a short and sexy log of changes
+# immediately after merging (git-up) or rebasing (git-reup).
+#
+# Inspired by Kyle Neath's `git up' alias:
+# http://gist.github.com/249223
+#
+# Stolen from Ryan Tomayko
+# http://github.com/rtomayko/dotfiles/blob/rtomayko/bin/git-up
+
+set -e
+
+PULL_ARGS="$@"
+
+# when invoked as git-reup, run as `git pull --rebase'
+test "$(basename $0)" = "git-reup" &&
+PULL_ARGS="--rebase $PULL_ARGS"
+
+git pull $PULL_ARGS
+
+# show diffstat of all changes if we're pulling with --rebase. not
+# sure why git-pull only does this when merging.
+test "$(basename $0)" = "git-reup" && {
+ echo "Diff:"
+ git --no-pager diff --color --stat HEAD@{1}.. |
+ sed 's/^/ /'
+}
+
+# show an abbreviated commit log of stuff that was just merged.
+echo "Log:"
+git log --color --pretty=oneline --abbrev-commit HEAD@{1}.. |
+sed 's/^/ /'
Oops, something went wrong.

0 comments on commit 00f1393

Please sign in to comment.