parsed.org

Tips by tag: html

Add this to your .vimrc:

autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete

Try it out:

$ touch index.html
$ vim index.html
type: <ht[CTRL-X][CTRL-O]
autocompleteccsshtmljavascriptphppythonvimvimrcxml
Convert Imagesize and Output Html-Code by -Flo- on Feb 19, 2008 09:12 AM
I wrote a little Bash-script, that
  • Creates Thumbnails to a specific size
  • Converts original Images to a specific size
  • Creates Html-Code that will show the thumbnail and link to the image (Folders can be included)

Have fun with it:

#!/bin/bash

######################
# Set Variables
######################
ENDING=jpg;
IMG_SIZE=800;
THUMB_SIZE=150;
DIR=folder/folder/images/;
ID=/usr/bin/identify;

######################
# Create Thumbnail
######################
ls -1 *.$ENDING | grep -v thb |while read file;
do convert -thumbnail $THUMB_SIZEx$THUMB_SIZE "$file" "`basename _thb_"$file"`";
        echo "---> _thb_$file created";
done

######################
# Convert image
######################
ls -1 *.$ENDING | grep -v thb | while read file;
do convert -resize $IMG_SIZEx$IMG_SIZE "$file" "`basename "$file"`";
        echo "---> $file converted";
done

######################
# Output HTML-Code
######################
echo "######################";
echo "HTML-CODE:";
echo "######################";
ls -1 *.$ENDING | grep -v thb | while read file;
do
        h=$($ID -format \"%h\" "`basename _thb_"$file"`");
        w=$($ID -format \"%w\" "`basename _thb_"$file"`");
        echo "<a href=\""$DIR$file"\">";
        echo "<img alt=\"\" src=\""$DIR""`basename _thb_"$file"`"\" width=$w height=$h /></a>";
done
echo "######################";
bashconverthtmlimagethumbnail
Convert Man to HTML by xinu on Jan 12, 2005 11:00 AM

Convert a man page to HTML for easy viewing online:

$ gunzip < /usr/local/man/man8/lsof.8.gz | nroff -man | man2html -title "lsof" > otmp/lsof.html
commandsconvertfiltergunziphtmlman2htmlmanpagenroffonlineshell
RSS