Skip to content

Instantly share code, notes, and snippets.

View kshenk1's full-sized avatar
💭
Making things happen with other things

Kyle Shenk kshenk1

💭
Making things happen with other things
View GitHub Profile
@kshenk1
kshenk1 / bash_slice_array.sh
Last active November 8, 2016 21:42
Cut an array in bash in half, resulting in two arrays of equal size (based on the number of indexes)
#!/bin/bash
array=(one two three four five six seven eight nine ten eleven)
len="${#array[@]}"
half="$((len/2))"
ar_one=("${array[@]:0:$half}")
ar_two=("${array[@]:$half:$len}")
@kshenk1
kshenk1 / gist:5a215a78a568ca7f4923
Last active August 29, 2015 14:18
Vim Code Completion

Vim Completion on MACOSX

This is just a place for me to dump how this worked for me. All this information was gathered starting here: Valloric/YouCompleteMe

So first. If you don't have homebrew, install it. If you do, update it.

which brew && {
    brew update
} || {
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
}
#!/bin/bash
CURRENT_TIME="$(date +%y-%m-%d)"
HOSTNAME="$HOSTNAME"
FILE_BASE="/mnt/log/httpd"
[ -z "$HOSTNAME" ] && HOSTNAME="$(hostname)"
FILE_NAME="$CURRENT_TIME-$HOSTNAME"
ZIPPED_FILE="$FILE_BASE/$FILE_NAME.gz"