Skip to content

Instantly share code, notes, and snippets.

@mikekwright
mikekwright / .vimrc
Created November 6, 2013 22:18
Simple example of my .vimrc file to share after discussion in bash-learning study group
" This is the custom vim file setup....
" Ctrl-J g - Generate a guid (insert mode only)
"
" May need to uncomment below line if pathogen isn't loading correctly
" set nocp
"
" This sets the pathogen startup
runtime bundle/vim-pathogen/autoload/pathogen.vim
call pathogen#infect()
call pathogen#helptags()
@mikekwright
mikekwright / setup-vim.sh
Created November 6, 2013 22:16
This is the setup-vim command that I use to install the different vim plugins I like to have.
#!/bin/bash
# Move to the vim directory for this
cd $HOME/.vim/bundle || echo "You need to create the directory ~/.vim/bundle"; exit 1;
function install_plugin()
{
if [ -d "$1" ]; then
echo "Updating $1"
cd $1
@mikekwright
mikekwright / .bashrc
Created November 6, 2013 22:11
Sample of the .bashrc file that I use for the bash-learning study group
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
#[ -z "$PS1" ] && return
[ "$PS1" ] || return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
@mikekwright
mikekwright / vimrc
Created November 5, 2013 21:23
This is the sample of a vimrc file that was using in Sort2013 tmux blog post.
set nocompatible
filetype on
filetype indent on
filetype plugin on
colorscheme xoria256 " This does require 256 term
set smartindent
set autoindent
set expandtab
@mikekwright
mikekwright / .tmux.conf
Created November 5, 2013 21:21
This is the sample of a tmux conf file that was using in Sort2013 tmux blog post.
# Setting my bindkey as a
set -g prefix C-a
unbind C-b
set -s escape-time 1
bind r source-file ~/.tmux.conf \; display "Reloaded."
bind C-a send-prefix
bind X kill-session
bind x kill-pane
# Vim Keys for Pane management
@mikekwright
mikekwright / configTests.sh
Created November 5, 2013 20:24
This is the final gist that demonstrates the testing that can be accomplished using shunit from post (Bash Testing)
#!/bin/bash
setUp()
{
originalPath=$PATH
PATH=$PWD:$PATH
}
tearDown()
{
@mikekwright
mikekwright / wget
Created November 5, 2013 20:21
This is the "mock" wget command to demonstrate mocking in post (Bash Testing)
#!/bin/bash
if [ -z "$TEST_WGET_FAILURE" ]
then
echo "Downloading $1"
else
echo "Failed to download file"
exit 1
fi
@mikekwright
mikekwright / configRetriever.sh
Created November 5, 2013 20:20
This is the more advanced script for testing dependencies using shunit from post (Bash Testing)
#!/bin/bash
if [ -z "$1" ]
then
echo "Missing required command line url"
exit 1
fi
wget http://s3.amazon.com/work/sharedconfig.txt
if [ ! $? -eq 0 ]
then
@mikekwright
mikekwright / my-first-test.sh
Created November 5, 2013 20:16
This is the first simple test using shunit2 for blog post (Bash Testing)
#!/bin/bash
#
# Description: This is a sample test using shunit2
#
testMyComparison()
{
assertTrue "This is the message if it fails" "[ 1 -eq 1 ]"
}
@mikekwright
mikekwright / input.cs
Created November 5, 2013 05:59
Sample use of double TryParse
public static double GetResponse()
{
double result;
do
{
Console.Write("Enter a double: ");
} while (double.TryParse(Console.ReadLine(), out result));
return result;
}