Mon Feb 4 23:18:19 PST 2013
permalink stackoverflow answers
Beneath all answers you'll see a link called "share". That's your permalink. For example, the permalink to this answer is http://meta.stackoverflow.com/a/25107/21960.
Mon Feb 4 23:15:38 PST 2013
prompt for input and case switch statement
case $doit in y|Y) echo "converting..." convert $1 -scale $3 $2 ;; *) echo skip ;; esac
Mon Feb 4 23:12:30 PST 2013
arithmetic logic
if [ $width -gt $MAX_WIDTH -a $height -gt $MAX_HEIGHT ]; # whatever fi
Mon Feb 4 23:10:35 PST 2013
gather flags
while getopts u:d:p:f: option do case "${option}" in u) USER=${OPTARG};; d) DATE=${OPTARG};; p) PRODUCT=${OPTARG};; f) FORMAT=$OPTARG;; esac done
Sun Feb 3 20:25:33 PST 2013
print nth column of text
| awk '{ print $n }'
Mon Dec 31 13:42:59 PST 2012
make vim search non-greedy
Instead of .* use .\{-}.
:help non-greedy
via stack overflow
Mon May 21 14:14:54 PDT 2012
facebook, shhh
document.getElementsByClassName('ego_column')[0].style.display = 'none';
Mon May 21 12:11:57 PDT 2012
how to find the size of a file. duh!
du -h file_name
Wed May 9 20:55:49 PDT 2012
SSH login without password
cat .ssh/id_rsa.pub | ssh user@host 'cat >> ~/.ssh/authorized_keys'
via linuxproblem.org
src vs href
We use src for replaced elements while href for establishing a relationship between the referencing document and an external resource.