Merge branch 'master' of git://majnematic.com/davesdots

This commit is contained in:
David Majnemer 2010-07-09 00:21:24 -07:00
commit e4abdb3459
8 changed files with 200 additions and 2955 deletions

View file

@ -100,6 +100,4 @@ alias du='du -h'
alias ping='ping -c4'
alias maketex="make -f ${HOME}/.latex/Makefile"
( command -v time >/dev/null 2>&1 ) && alias time='command time'

View file

@ -4,22 +4,71 @@
unkey_host ()
{
[ ${#} -ne 1 ] && return 1
[ $# -ne 1 ] && return 1
sed -i -e "/$1/d" $HOME/.ssh/known_hosts
}
err ()
{
if ( command -v ruby > /dev/null 2>&1 ); then
ruby -e "puts Errno.constants.find_all{|err| eval('Errno::' + err + '::Errno') == $@ }"
elif [ -e /usr/include/errno.h ] ; then
cpp -dM /usr/include/errno.h | grep -w "E.* $@"
case $1 in
E*)
errconst=$1
unset errno
if [ "${errno}" = "" ] && ( command -v python > /dev/null 2>&1 ); then
errno=`python -c "import errno;print(errno.${errconst})" 2>/dev/null`
fi
if [ "${errno}" = "" ] && ( command -v perl > /dev/null 2>&1 ); then
errno=`perl -MErrno -e "print &Errno::${errconst}.\"\n\";" 2>/dev/null`
fi
if [ "${errno}" = "" ] && ( command -v ruby > /dev/null 2>&1 ); then
errno=`ruby -e "puts Errno::${errconst}::Errno" 2>/dev/null`
fi
if [ "${errno}" = "" ] && [ -e /usr/include/errno.h ] ; then
errno=`cpp -dM /usr/include/errno.h | grep -E "${errconst}[[:space:]]+[0-9]+$" | grep -oE '[0-9]+' 2>/dev/null`
fi
if [ "${errno}" ] ; then
echo "${errconst} = ${errno}"
else
return 1
fi
;;
*)
errno=$1
unset errconst
if [ "${errconst}" = "" ] && ( command -v ruby > /dev/null 2>&1 ); then
errconst=`ruby -e "puts Errno.constants.find_all{|err| eval('Errno::' + err + '::Errno') == ${errno} }" 2>/dev/null`
fi
if [ "${errconst}" = "" ] && ( command -v python > /dev/null 2>&1 ); then
errconst=`python -c "import errno;print(errno.errorcode[${errno}])" 2>/dev/null`
fi
if [ "${errconst}" ] ; then
errconst="${errconst} = ${errno}"
fi
if [ "${errconst}" = "" ] && [ -e /usr/include/errno.h ] ; then
errconst=`cpp -dM /usr/include/errno.h | grep -E "E[[:alnum:]]+[[:space:]]+${errno}$"`
fi
if [ "${errconst}" ] ; then
echo $errconst
else
return 1
fi
;;
esac
unset errstr
if [ "${errstr}" = "" ] && ( command -v perl > /dev/null 2>&1 ) ; then
errstr=`perl -MPOSIX -e 'print strerror($ARGV[0])."\n";' $errno`
fi
if [ "${errstr}" = "" ] && ( command -v python > /dev/null 2>&1 ) ; then
errstr=`python -c "import os;print(os.strerror($errno))" 2>/dev/null`
fi
if ( command -v perl > /dev/null 2>&1 ) ; then
perl -MPOSIX -e 'print strerror($ARGV[0])."\n";' $@
elif ( command -v python > /dev/null 2>&1 ) ; then
python -c "import os;print(os.strerror($@))"
if [ "${errstr}" ] ; then
echo $errstr
else
return 2
fi
}
@ -35,13 +84,13 @@ mkcd ()
extract ()
{
if ( command -v aunpack > /dev/null 2>&1 ) ; then
aunpack "${1}"
if [ ! -f "$1" ] ; then
echo "The file ("$1") does not exist!"
return
fi
if [ ! -f "$1" ] ; then
echo "The file ("$1") does not exist!"
if ( command -v aunpack > /dev/null 2>&1 ) ; then
aunpack "${1}"
return
fi
@ -51,42 +100,27 @@ extract ()
*.tar)
tar xf "${1}"
;;
*.gz|*.z)
gzip -dc "${1}" > `basename "${1%.*}"`
*.tar.bz2|*.tbz2|*.tbz)
bzip2 -dc "${1}" | tar xf -
;;
*.tar.gz|*.tgz|*.tz)
gzip -dc "${1}" | tar xf -
;;
*.Z)
uncompress -c "${1}" > `basename "${1%.*}"`
*.tar.lzma|*.tlz)
lzma -dc "${1}" | tar xf -
;;
*.tar.xz|*.txz)
xz -dc "${1}" | tar xf -
;;
*.tar.z|*.tar.Z|*.taz)
uncompress -c "${1}" | tar xf -
;;
*.bz2|*.bz)
bzip2 -dc "${1}" > `basename "${1%.*}"`
;;
*.tar.bz2|*.tbz2|*.tbz)
bzip2 -dc "${1}" | tar xf -
;;
*.7z)
7zr x "${1}"
;;
*.tar.7z|*.t7z)
7zr x -so "${1}" | tar xf -
;;
*.lzma)
lzma -dc "${1}" > `basename "${1%.*}"`
;;
*.tar.lzma|*.tlz)
lzma -dc "${1}" | tar xf -
;;
*.xz)
xz -dc "${1}" > `basename "${1%.*}"`
;;
*.tar.xz|*.txz)
xz -dc "${1}" | tar xf -
;;
*.a|*.deb)
ar x "${1}"
;;
@ -105,6 +139,12 @@ extract ()
*.lha|*.lzh)
lha xqf "${1}"
;;
*.pax)
pax -rf "${1}"
;;
*.pax.bz2)
bzip2 -dc "${1}" | pax -rf -
;;
*.rar)
unrar x -idq "${1}"
;;
@ -117,6 +157,21 @@ extract ()
*.zoo)
zoo x "${1}"
;;
*.bz2|*.bz)
bzip2 -dc "${1}" > `basename "${1%.*}"`
;;
*.gz|*.z)
gzip -dc "${1}" > `basename "${1%.*}"`
;;
*.xz)
xz -dc "${1}" > `basename "${1%.*}"`
;;
*.Z)
uncompress -c "${1}" > `basename "${1%.*}"`
;;
*.7z)
7zr x "${1}"
;;
*)
echo "Unable to extract '"$1"'"
return 1

View file

@ -1,5 +1,6 @@
*.o
cscope.*
ctags
.DS_Store
*~
tags
@ -11,3 +12,4 @@ tags
*.aux
*.log
*.dvi
*.mode*v*

View file

@ -81,8 +81,6 @@ my %links = (
'git-untrack-ignored' => 'bin/git-untracked-ignored',
latex => '.latex',
gdbinit => '.gdbinit',
);

File diff suppressed because it is too large Load diff

View file

@ -1,21 +0,0 @@
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage[margin=1in]{geometry}
\usepackage{tikz}
\pagestyle{fancy}
%some commands for convenience
\newcommand{\DFA}{\textsf{DFA} }
\newcommand{\NFA}{\textsf{NFA} }
\newcommand{\CFG}{\textsf{CFG} }
%sets
\newcommand{\Reals}{\mathbb{R}}
\newcommand{\Naturals}{\mathbb{N}}
\newcommand{\Rationals}{\mathbb{Q}}
\newcommand{\Integers}{\mathbb{Z}}
\newcommand{\set}[1]{\{#1\}}

33
vimrc
View file

@ -109,7 +109,7 @@ endif
set laststatus=2
set shortmess=atI
if has('statusline')
set statusline=%<%F\ %r[%{&ff}]%y%m\ %=\ Line\ %l\/%L\ Col:\ %c\ (%P)
set statusline=%<%F\ %r[%{&ff}]%y%m\ %=\ Line\ %l\/%L\ Col:\ %v\ (%P)
endif
" Enable modelines only on secure vim
@ -297,10 +297,13 @@ endif
" some emacs-isms are OK
map! <C-a> <Home>
map <C-a> <Home>
map <C-a> <Home>
map! <C-e> <End>
map <C-e> <End>
map <C-k> d$
map <C-e> <End>
imap <C-f> <Right>
imap <C-b> <Left>
map! <M-BS> <C-w>
map <C-k> d$
if has('eval')
inoremap <buffer> <C-K> <C-R>=EmacsKill()<CR>
endif
@ -321,13 +324,13 @@ inoremap # X<BS>#
" Both interix and cons use C-? as forward delete,
" besides those two exceptions, always set it to backspace
" Also let interix use ^[[U for end and ^[[H for home
map <C-h> <BS>
map <C-h> <BS>
map! <C-h> <BS>
if (&term =~ "interix")
map <C-?> <DEL>
map! <C-?> <DEL>
map  <Home>
map  <End>
map <C-[>[H <Home>
map <C-[>[U <End>
elseif (&term =~ "^sun")
map <C-?> <DEL>
map! <C-?> <DEL>
@ -337,14 +340,14 @@ elseif (&term !~ "cons")
endif
if (&term =~ "^xterm")
map  <Home>
map!  <Home>
map  <End>
map!  <End>
map  <C-Left>
map!  <C-Left>
map  <C-Right>
map!  <C-Right>
map <C-[>[H <Home>
map! <C-[>[H <Home>
map <C-[>[F <End>
map! <C-[>[F <End>
map <C-[>[5D <C-Left>
map! <C-[>[5D <C-Left>
map <C-[>[5C <C-Right>
map! <C-[>[5C <C-Right>
endif
" Python specific stuff

90
wombat.xccolortheme Normal file
View file

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Colors</key>
<dict>
<key>Background</key>
<string>0.141 0.141 0.141</string>
<key>InsertionPoint</key>
<string>0.396 0.396 0.396</string>
<key>Selection</key>
<string>0.267 0.267 0.267</string>
<key>xcode.syntax.attribute</key>
<string>0.906 0.965 0.855</string>
<key>xcode.syntax.character</key>
<string>0.584 0.894 0.329</string>
<key>xcode.syntax.comment</key>
<string>0.600 0.588 0.545</string>
<key>xcode.syntax.comment.doc</key>
<string>0.600 0.588 0.545</string>
<key>xcode.syntax.comment.doc.keyword</key>
<string>0.600 0.588 0.545</string>
<key>xcode.syntax.identifier.class</key>
<string>0.792 0.902 0.510</string>
<key>xcode.syntax.identifier.class.system</key>
<string>0.792 0.902 0.510</string>
<key>xcode.syntax.identifier.constant</key>
<string>0.898 0.471 0.427</string>
<key>xcode.syntax.identifier.constant.system</key>
<string>0.898 0.471 0.427</string>
<key>xcode.syntax.identifier.function</key>
<string>0.792 0.902 0.510</string>
<key>xcode.syntax.identifier.function.system</key>
<string>0.792 0.902 0.510</string>
<key>xcode.syntax.identifier.macro</key>
<string>0.898 0.471 0.427</string>
<key>xcode.syntax.identifier.macro.system</key>
<string>0.898 0.471 0.427</string>
<key>xcode.syntax.identifier.type</key>
<string>0.792 0.902 0.510</string>
<key>xcode.syntax.identifier.type.system</key>
<string>0.792 0.902 0.510</string>
<key>xcode.syntax.identifier.variable</key>
<string>0.792 0.902 0.510</string>
<key>xcode.syntax.identifier.variable.system</key>
<string>0.792 0.902 0.510</string>
<key>xcode.syntax.keyword</key>
<string>0.541 0.776 0.949</string>
<key>xcode.syntax.mark</key>
<string>1.000 0.500 0.000</string>
<key>xcode.syntax.number</key>
<string>0.898 0.471 0.427</string>
<key>xcode.syntax.plain</key>
<string>1.000 1.000 1.000</string>
<key>xcode.syntax.preprocessor</key>
<string>0.894 0.471 0.427</string>
<key>xcode.syntax.string</key>
<string>0.584 0.894 0.329</string>
<key>xcode.syntax.url</key>
<string>0.906 0.965 0.855</string>
<key>xcode.syntax.url.mail</key>
<string>0.100 0.100 1.000</string>
</dict>
<key>Fonts</key>
<dict>
<key>xcode.syntax.attribute</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.character</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.comment</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.comment.doc</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.comment.doc.keyword</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.keyword</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.number</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.plain</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.preprocessor</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.string</key>
<string>Menlo Regular - 11.0</string>
<key>xcode.syntax.url</key>
<string>Menlo Regular - 11.0</string>
</dict>
</dict>
</plist>