www.hutsky.cz / blog / twitter /

Archive for the ‘General thoughts’ Category

Half-life 2: Episode Two

Wednesday, June 2nd, 2010

To my great delight, I discovered that Half-life 2 is now available for something like 10 € nowadays. I know the game is quite old now, but I only played Episode One back then so I couldn’t resist to learn more about Episode Two. Even though it’s old, the graphics is still damn good when you use the highest details, and most importantly, it’s loads of fun. (more…)

Change all tags to lowercase in VIM

Sunday, May 30th, 2010

Sometimes, you’ve got a whole chunk of HTML code that needs cleaning up a bit before you can use it. This week I got some materials in .doc format that had to be put on a website. There was so much of it that simple cut and paste was not possible. It would have been be particularly tiresome to try to get all the tables to HTML. On the other hand, it’s quite easy to save a word document as an html file. However, the generated HTML code is not very clean and definitely doesn’t comply with XHTML standards (though it seems to me that the result is much better when you use OpenOffice rather than MS Office).

Now that you have a very messy piece of HTML code, making it look better would mean even more toil than the copy and paste process. This is where a little bit of Vim magic comes handy.

1. First we change all tags to lowercase:

:%s/<\/\?\zs\(\a\+\)\ze[ >]/\L\1/g

2. Note that this will change tag names only. To change tag attributes to lowercase as well, use this command:

:%s/\(<[^>]*\)\@<=\<\(\a*\)\ze=['"]/\L\2/g

3. The above two expressions were found using google. Now I needed something that would wipe out all attributes to get rid of unnecessary styles attached to tags so I came up with this search and replace expression:

:%s/<\([a-z]*\)\s\([^>]*\)/<\1/g

Flexibee accounting package

Saturday, May 15th, 2010

One of the few things I really do miss in Linux environment is a proper accounting software.

About a year ago, I managed to convince a friend of mine who owns this local store to try Linux on his office computer. He took to the idea gladly because the computer in his office was used by many various users, his father, part-time workers etc. Every one of them installed an icq toolbar here, a small application there and as a result, we had to re-install Windows quite often since the computer was constantly overloaded with unnecessary applications, spyware and viruses. Yes, we could have set up a Windows account with more restrictive rules, but Linux simply seemed a safer choice. At first I was worried about how people who don’t know much about computers, people who use computers just for browsing, e-mails or editing excel documents would react to a completely different operating system.

(more…)

Lands of Lore

Tuesday, April 13th, 2010

This has nothing to do with my work, but it’s related to computers anyway and life’s not work all the time, is it.

(more…)

Hello world!

Sunday, January 10th, 2010

Just started a new blog, my first one. I’d like to focus on topics related to my work like jQuery or mobile web content development that are not necessarily what I get paid for but that I like discovering. I don’t expect my posts to be very frequent (nor particularly enlightening), but at the very least it will keep me updated on Wordpress development, it was version 2.5 last time I installed WP and built custom plugins for someone, it’s 2.9 today.