Skip to content

Instantly share code, notes, and snippets.

View robertpateii's full-sized avatar
❤️

Robert Pate II robertpateii

❤️
View GitHub Profile
@robertpateii
robertpateii / _vimrc
Last active September 26, 2015 03:38
my typical vimrc file
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
@robertpateii
robertpateii / checkboxesarechecked.js
Last active September 25, 2015 17:38
a little javascript used to check if a set of checkboxes on your form are checked
// Used to check through an array of checkboxes or radio buttons with the same name attribute.
// max is an integer and is optional. it defaults to 1 if left empty.
function checkBoxesAreChecked(checkboxarray, max) {
var arraymax = max || 1;
var checkedcount = 0;
for (var i=0; i < checkboxarray.length; i++) {
if (checkboxarray[i].checked) {
checkedcount++;
}
}