Objective C W.I.P
anything preceeded with an @ is a compiler directive. keywords have specific meanings too numerous to list.
@"a string"
an immutable/constant string.
@32
an immutable/constant int.
Labels: objective-c
Brain Dump
@"a string"
@32
Labels: objective-c
#!/bin/bash
EMAIL="me@myemailhost.com"
HOSTNAME="fileserver"
LOCAL_PATH="/mnt/data/photos/"
REMOTE_PATH="/Users/lucas/Pictures/iPhoto\ Library"
REMOTE_HOST="hackintosh"
WHAT="photos"
#if we've said to delete files that are missing in the remote copy, do so and exit
if [ $# -eq 1 ]; then
if [ $1 == delete ];then
rsync -ai --delete "$REMOTE_HOST":"$REMOTE_PATH" "$LOCAL_PATH"
exit
fi
fi
#otherwise backup changes
rsync -ai "$REMOTE_HOME":"$REMOTE_PATH" "$LOCAL_PATH" |mail -e -s "$HOSTNAME: $WHAT backed-up" $EMAIL
#and make a list of files that have been deleted in the remote copy
rsync -ain --delete "$REMOTE_HOME":"$REMOTE_PATH" "$LOCAL_PATH" |mail -e -s "$HOSTNAME: $WHAT to delete" $EMAIL
find -name "*.rar" -exec unrar e {} \;
export EDITIOR=vim
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
alias ls='ls -FG'
alias ll='ls -FGl'
alias la='ls -aFGl'
alias h='history'
alias hg='history|grep'
alias cp='cp -v'
alias df='df -H'
alias du='du -H'
alias rm='rm -i'
alias curl-easy="curl -C - -O "
:%s/find/replace/g
:%s/find/replace/gi
:%s/find/replace/gc
:%g/search/s/find/replace
:s/\(\d\d\)-\(\d\d\)-\(\d\d\d\d\)/\3-\1-\2
:let i=10 | 'a,'bg/abc/s/def/\=i/ |let i=i+1
C^p
z=
zg
C^w, n
:sp filename.txt
:vsp filename.txt
C^w, w
C^w, down arrow
C^w, up arrow
C^w, =
C^w, +
C^w, -
^
$
C^v + C^m
:map <F5> :setlocal spell! spelllang=en_au
:imap <F5> <ESC>:setlocal spell! spelllang=en_au
:map <C-a> 0
:map <C-e> $
:cmap <C-a> <home>
:cmap <C-e> <end>
:imap <C-e> <ESC>$i<right>
:imap <C-a> <ESC>0i
set background=dark
set backspace=indent,eol,start
set backup
set backupdir=~/tmp/vim
set hlsearch
set ignorecase
set infercase
set number
set showmatch
set cursorcolumn
set cursorline
hi cursorcolumn ctermbg=red
set expandtab
set tabstop=2
Labels: vim