Skip to content

Instantly share code, notes, and snippets.

Avatar

danny peck dep-deprecated

  • Asheville, NC
View GitHub Profile
@dep-deprecated
dep-deprecated / vow
Created Jul 22, 2016
Vim Open With: Open all files in vim matching a string
View vow
#! /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 Jul 22, 2016
Show a list of commits unique to a git branch
View shadiff
#! /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 Jul 22, 2016
Merges master to a comma separated list of branches
View mmt
#! /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 Jul 22, 2016
Cleans a comma separated list of git branches from origin/locally
View clean
#! /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 Jul 22, 2016
Shows branches that are redundant to master
View deadbranches
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 Sep 23, 2014
Put your git branch in your prompt (.bash_profile)
View gist:c66743742377e433933b
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='+ '
}
View irssi
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 Jul 22, 2016
my vimrc file
View vimrc
execute pathogen#infect()
" Inits
filetype off
au! BufRead,BufNewFile *.tmpl
setf tt2html
" fuzzyfind (https://github.com/junegunn/fzf)
set rtp+=~/.fzf
View mcabberrc
# 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 Dec 17, 2015 — forked from letsgetrandy/eventcmd
event_command script for mcabber (fork from letsgetrandy)
View eventcmd
#! /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