Skip to content

Instantly share code, notes, and snippets.

View brockers's full-sized avatar

Bobby Rockers brockers

View GitHub Profile
@brockers
brockers / .vimrc
Created June 3, 2015 22:44
vimrc function to enable/disable color column on 80 using the leader key l (for line)
" Enable and disable color column
set colorcolumn=0
function! ToggleColorColumn()
if &colorcolumn == 0
windo let &colorcolumn = 80
else
windo let &colorcolumn = 0
endif
endfunction
command! -nargs=? -range=% ToggleColumn call ToggleColorColumn()
@brockers
brockers / gist:9f314b228ac4ad6fe2bc
Last active August 29, 2015 14:19
.bashrc pathings for different programming enviroments.
# GO bins if they exist
GOPATH="$HOME/Projects/go"
if [ -d "$GOPATH" ]; then
export GOPATH
PATH=$PATH:$GOPATH/bin
fi
# Node & NPM bin if they exist
NODEPATH="$HOME/.node/bin"
if type "npm" > /dev/null; then
@brockers
brockers / download_couch_data.sh
Last active February 5, 2016 19:20
Download Couchdb Data from into json formatted file
#!/bin/bash
DBADDR='localhost:5984'
DEBUG=0
DATABASE=""
LOGFILE="/dev/null"
REMREV=0
FIXQUOTES=0
REMIMG=0
@brockers
brockers / upload_couch_data.sh
Created March 3, 2015 23:30
Upload Couchdb Data from json formatted file
#!/bin/bash
DBADDR='localhost:5984'
DEBUG=0
DATABASE=""
JSONFILE=""
LOGFILE="/dev/null"
usage () {
echo ""
platforms/
plugins/
@brockers
brockers / transfer
Created October 8, 2014 21:03
A brash script to upload, encrpyt, and track your www.transfer.sh files.
#!/bin/bash
set -o nounset
set -o errexit
OPTION=""
HISTORYFILE="${HOME}/.transfer_history"
testfile() {
FILETOTEST=$1
@brockers
brockers / configuredebug
Created September 17, 2014 18:05
A bash alias to run configure with full debug messages and un-optimized for gdb
alias configuredebug='CPPFLAGS=-DDEBUG CFLAGS="-g -O0" CXXFLAGS="-g -O0" ./configure'
@brockers
brockers / find_shp_duplicate.sh
Last active August 29, 2015 14:05
Find duplicate shapefiles and other ArcGIS support files in a given project folder.
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
# Set some global variables
installLocation='./FINAL-PLACE'
logFiles='./log'
md5Cache="$logFiles/md5Cache.txt"
duplicateFile="$logFiles/dupFiles.txt"
@brockers
brockers / fedora-setup.sh
Last active March 25, 2016 17:16
Fedora 20 KDE Spin default setup
#!/bin/bash
# This is meant to be run on a newly install computer
# and can be done remotely by something like this:
#
# ssh username@ipaddress 'bash -s' < local_script.sh
#
# Enable/Start SSHD
#######################################
@brockers
brockers / .bash_profile
Created August 5, 2014 17:25
bash .bash_profile git branch in PS1
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
function git-track {
CURRENT_BRANCH=$(parse_git_branch)
git-config branch.$CURRENT_BRANCH.remote $1
git-config branch.$CURRENT_BRANCH.merge refs/heads/$CURRENT_BRANCH
}