: ) wonderful world ( :

the metasyntactic variable

Archive for December 2007

pragmatic linker

without comments

I decided to maintain a page with links good to know about. It’s like a simple html page with entries like

<a href="blah">blah</a>

It’s very annoying to type the whole skeleton every time a new entry comes. Better to store only the data in a file and generate the output page with a script as advised in e.g. The Pragmatic Programmer book. I prepared two solutions like this.

login08% cat links2html.sh
( echo "<html><body>" && \
  cat $1 | \
  sed -e 's/^\(.*\)$/\1 \1/' | \
  sed -e 's/^\([^\ ]*\)/<a href="\1">/' | \
  sed -e 's/$/<\/a><br \/>/' | \
  sed -e 's/>\ />/g' && \
  echo "</body></html>" \
) > $1.html

login08% cat links-to-html.el
(defun links-to-html ()
  (interactive)
  (let ((new (generate-new-buffer "*links-to-html*"))
        (lines (split-string (buffer-string) "[\n\r]+")))
    (with-current-buffer new
      (insert "<html><body>\n")
      (dolist (l lines)
        (insert "<a href=\"" l "\">" l "</a><br />\n"))
      (insert "</html></body>\n"))
    (switch-to-buffer new)))

login08%

Written by grault

December 25, 2007 - 1:51 pm at December 25, 2007 - 1:51 pm

Posted in command line, links, lisp

wallz

with one comment

I’ve never used any wallpaper on my desktop other than defaults. I search for the one and only : ) This is a nice little collection though.

Written by grault

December 22, 2007 - 11:05 pm at December 22, 2007 - 11:05 pm

Posted in links

cvs/ssh hell on Windowns

without comments

I’m on vacation until 7th of Jan. This time, I’m using a Windows machine. I decided to set up a cvs/ssh/slime environment to work a little on cl-bf. Only 1-11-21 (not 22) cvs worked with sourceforge.

set HOME=d:\z\bin
ssh-keygen.exe -C ""
set CVS_RSH=path\ssh.exe
cvs -z3 -d:ext:grault@cl-bf.cvs.sourceforge.net:/cvsroot/cl-bf com ...

Written by grault

December 22, 2007 - 10:39 pm at December 22, 2007 - 10:39 pm

multiple week’s tobacco

without comments

Goteborgs Rape No2 White doesn’t have this tobacco flavor. My first snus was General Portion which has a certain taste and this wasn’t present in former. However Skruf is kinda posh but good. I’m also finished with a little bit strong Nick & Johnny. It’s good.

Written by grault

December 22, 2007 - 7:40 pm at December 22, 2007 - 7:40 pm

Posted in snus, tobacco

this week’s tobacco

without comments

By the way, I found this too aromatic : (

Written by grault

December 1, 2007 - 9:59 am at December 1, 2007 - 9:59 am

Posted in snus, tobacco

ucw first attempt

with one comment

I hacked together a very basic application in ucw. It is kinda shopping list. One can add and remove strings by consequently submitting a form and using a link. It took a while to realize (again) that sort was destructive : ) After understanding the basics I mentioned earlier, it’s really straightforward to design simple dynamic pages like this.

Written by grault

December 1, 2007 - 9:48 am at December 1, 2007 - 9:48 am

Posted in lisp