Skip to content

Instantly share code, notes, and snippets.

View dep-deprecated's full-sized avatar

danny peck dep-deprecated

  • Asheville, NC
View GitHub Profile
@dep-deprecated
dep-deprecated / vow
Created July 22, 2016 17:05
Vim Open With: Open all files in vim matching a string
#! /bin/bash
if [[ -z "$1" ]]; then
echo 'missing search'
else
vim $(ag --html --js --css --py -l "$1") -c /"$1"
fi
@dep-deprecated
dep-deprecated / shadiff
Created July 22, 2016 17:04
Show a list of commits unique to a git branch
#! /bin/bash
if [[ -z "$2" ]]; then
echo 'Shows commits exclusive to a branch (from master)'
echo 'sha_diff [new_branch] [old_branch] (ex: sha_diff tp1234_dep_int master)'
else
git fetch && git log $1 ^origin/$2 --no-merges --oneline
fi
@dep-deprecated
dep-deprecated / mmt
Created July 22, 2016 17:03
Merges master to a comma separated list of branches
#! /bin/bash
if [[ -z "$1" ]]; then
echo 'Merges master to branches'
echo 'mmt [branch],[branch],[branch]'
else
git fetch
IFS=', ' read -a array <<< "$1"
for((i=0;i<${#array[@]};i++))
do
echo '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-'
@dep-deprecated
dep-deprecated / clean
Created July 22, 2016 17:03
Cleans a comma separated list of git branches from origin/locally
#! /bin/bash
if [[ -z "$2" ]]; then
echo 'Deletes remote and local branch(es)'
echo 'clean [remote] [feature,feature] (ex: clean origin tp1234,tp2345)'
else
read -p "Press [Enter] to perform the remote actions (CTRL-C to stop)..."
IFS=', ' read -a array <<< "$2"
git checkout master
for((i=0;i<${#array[@]};i++))
@dep-deprecated
dep-deprecated / deadbranches
Created July 22, 2016 17:02
Shows branches that are redundant to master
git checkout master && git fetch && git merge origin/master && git remote prune origin && echo 'Dead branches:' && git branch -r --merged | grep -v master && git checkout -
@dep-deprecated
dep-deprecated / gist:c66743742377e433933b
Created September 23, 2014 20:56
Put your git branch in your prompt (.bash_profile)
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="${TITLEBAR}\
$WHITE[$LIGHT_GRAY\w$GREEN\$(parse_git_branch)$WHITE]\
$GREEN\$ "
PS2='> '
PS4='+ '
}
@dep-deprecated
dep-deprecated / irssi
Created May 29, 2013 14:39
irssi config
settings = {
core = {
real_name = "dep";
user_name = "dep";
nick = "dp";
log_close_string = "--- Log closed %a %b %d %H:%M:%S %Y";
log_timestamp = "(%H:%M) ";
log_day_changed = "--- Day changed %a %b %d %Y";
};
"fe-text" = { actlist_sort = "refnum"; };
@dep-deprecated
dep-deprecated / vimrc
Last active July 22, 2016 16:59
my vimrc file
execute pathogen#infect()
" Inits
filetype off
au! BufRead,BufNewFile *.tmpl
setf tt2html
" fuzzyfind (https://github.com/junegunn/fzf)
set rtp+=~/.fzf
@dep-deprecated
dep-deprecated / mcabberrc
Created May 29, 2013 14:37
mcabber config
# server
set jid = user@domain.com
set username = user@domain.com
set nickname = username
set server = chat.server.com
set port = 5223
set password = password_here
# colors
set color_status = white
@dep-deprecated
dep-deprecated / eventcmd
Last active December 17, 2015 20:49 — forked from letsgetrandy/eventcmd
event_command script for mcabber (fork from letsgetrandy)
#! /usr/bin/python
'''
EVENTCMD -
This script is meant to respond to external 'eventcmd' calls from
the mcabber command-line jabber client.
'''
import sys
import re
import string