Archive for April, 2007

Redesign

Tuesday, April 24th, 2007 / Ruby/Ruby on Rails, Web / View blog reactions

RedesignRedesign

Yes, I felt that a little redesign was in order.

I wrote a little Ruby script the other weekend to scrape my Digg RSS feed so that recently Dugg links could be listed on my blog. All it does is read in the XML, cut-out the titles and links and writes them out to a dugg.php file as list items. The file is then included in the sidebar. This is done, more or less, every hour for the hours in the day that I’m awake and could be Digging. All done on the web-server with a cron job. Of course Digg have now released an API which I will no doubt tinker with at some time. For the moment this way works fine.

This is the first time that I’ve written the stylesheet from scratch. The last one was based on Kubrick, the Wordpress default and so had lots of elements that I didn’t need or use.

A sidebar has been added which either has a double or single column based on the content. That was to make it easier to navigate without scrolling down to the links in the footer.

Each theme is still generated by a little Ruby program that I wrote. The switching is done with a change to the Wordpress stylesheet selector which switches the theme based on the current week.

TextMate

Sunday, April 22nd, 2007 / Apple, Book Review / View blog reactions

TextMateTextMate

  • Power Editing for the Mac
  • James Edward Gray II
  • Programming

When I started to learn about Ruby On Rails I watched the screen casts and was amazed at how the HTML tags and code would magically appear. Of course when I was reading through the first Rails book I thought that it would okay to just use vim to edit the files. I mean I use vim at work, but then again our source code isn’t split into sub-directories.

So I bought TextMate and haven’t used anything else since.

TextMate looks really clean and simple. The usual menu items and some information on the footer line of each window and that’s it. You kind of expect multiple toolbars and icons galore but there aren’t any. It’s only when you start to dig around and open the Bundle Editor that you realise the power that’s under the hood.

To really get the most out of the software you need a good book. A book that will teach you all the tips, tricks and shortcuts that will save you time and make you more productive. That’s what this book will do. I’ve read through it once away from my iMac but it’s certainly a book that you’ll need to work with at the keyboard.

A Lesson In Futility…

Friday, April 13th, 2007 / Inane Drivel, Web / View blog reactions

I have an idea for a Rails application. After reading countless books I feel that I have to make some attempt at getting my hands dirty. Capistrano is something that I’ve heard of and, from the looks of things, would be good to know and would make depolying and updates easier in the long run. But, from what I’ve read, it can only use a remote Subversion code repository and not a local one. That was a problem. Should I pay for webhosting, my current provider doesn’t supply Subversion as an option, or should I use an external company who would host the code, like we use at work. There was a plan B, or C in this case, and that was to switch webhosts. So I signed up for an account with Textdrive. Everything went great I moved my domains over, except this one, and setup FTP and email accounts. I didn’t move this, my main domain, because I wanted to move from Wordpress to Mephisto as a blogging engine. Mephisto is written using Rails, which I of course know a bit about now and Wordpress is based on PHP. I made a few little tweaks to the Wordpress code but nothing major.

In the meantime I started a little fansite for my uncle, Sir Les Patterson, which I wrote using PHP but only so that I could include things like the navigation and the footer into each page. So I decided to convert SirLesPatterson.com to Mephisto. There was only about 6 pages to the entire site but at least it would be a good test to get used to the liquid templates, the software and setting it up in a hosted environment. This all went very well and it is still running fine as I write. The week after I set it all up it stopped working, yet I could access the site using the port number that I had been given. There must have just been a problem with the proxy. A month after I was adding content to the site when every admininistration page and every web page started to return 500 errors. At the time I couldn’t figure out what the problem was. The lighttpd webserver process was running but thinking about it now it could have been because the Rails process itself wasn’t running. So the site was down for a day or two. Textdrive didn’t reply to my support ticket, which didn’t fill me with much confidence. At least if I controlled my own server I would be more in control.

So, I have put my name down for a VPS at Slicehost. Not knowing all that much about how a hosting server is setup this will be a learning experience if nothing else.

It was at this time that I heard about Google Apps for domains. You could setup your domains to use Gmail instead of setting up mail software on your server. Brilliant! So I registered, setup the domains, changed the MX records and waited. And waited. Then Google Apps returned an error saying that the setup wasn’t correct and that I should check the setup instructions again. Which I did. What I hadn’t seen was that at the top of the DNS page it said that I needed to switch nameservers for these changes to work. This would mean moving them from my current hosts back to 123-reg and loosing my current email and web traffic. Luckily I have a domain that I’m not currently using so I tried it. Yes, the Gmail account for the domain worked perfectly but the web traffic was just pointing back to a 123-reg holding page. Far from ideal. I scanned through the Google Groups posts and promptly gave up. It would have been perfect having Google handle the email traffic so that I could tinker with the web server to my hearts content without loosing correspondence.

So I still have this site to move from Bluehost to Textdrive. And from Wordpress to Mephisto.

I spent a couple of days over the weekend adding extra bits and pieces to the Wordpress conversion script. I created a liquid template similar to the current theme but with a sidebar on the right. Running everything locally it worked fine. I had to change some of the content because it still contained some HTML tags that was confusing Markdown. Redirects to the sections in Pages worked fine and I tinkered with the layout and the style a little bit more. I copied it all to Textdrive, setup the database, setup the Rails process, setup lighttpd and added another backup script to the cron job. Accessed a couple of the pages and it all worked well… until it started to display an error page. The page is the standard Mephisto one which is shown to hide the full log trace from the surfer. With the terminal window open the cause was apparent. I could browse some of the pages but occasionally an ‘Out of memory’ error would be displayed in the window. Running two Rails processes on one shared host seemed like a feasible setup at the time. But not in practice. One of them had to go.

This blog is now back to running Wordpress. SirLesPatterson.com is still running on Mephisto. If that gives me any trouble I’ll switch that back to static PHP pages instead.

To be honest I would of had to change, or create plugins for Mephisto to get it to do what I already have in Wordpress :- automatic stylesheet switching and sitemap generation being the main ones. I could have written Ruby code to do things like that and added extra sections to the site using API’s.

Time spent… days and days. Progress made… zero. But at least I know more about setting up Rails and lighttpd than when I started.

CSS Mastery

Sunday, April 8th, 2007 / Book Review, Web / View blog reactions

CSS MasteryCSS Mastery

  • Advanced Web Standards Solutions
  • Andy Budd with Cameron Moll & Simon Collison
  • CSS / Web Design

So you’ve read Zeldman and you’ve been sucked into the whole ‘web standards’ vortex. You’ve worked through Meyer and you have seen how powerful CSS can be. You surf the web and keep seeing cunning little CSS tricks and you think ‘how the bloody hell did they manage that’. You open the source code, and the stylesheet, and another stylesheet, hoping to be enlightened but after half an hour you give up trying to track that little nugget down. You have RSS feeds from all the cool web-design sites but you start to spend over an hour a day reading it all.

This all happened to me.

I heard Paul Boag on the Boagworld Podcast recommend this book and at the time I thought, “surely I don’t need another web-design book”. Apparently I did.

Andy’s book covers every CSS styling trick you could possibly want to use :- layouts, links, nav bars, forms, data tables and background images. I never really understood how “sliding doors” navigation tabs worked, but I do now. And how you can have boxes with rounded corners stretch when the font size increases. All good stuff.

I started to use some the techniques in the book almost immediately while I was working on a site for my dear uncle Sir Les Patterson.

If you just dabble with web-sites and are looking to improve your CSS skills, or if you think you know it all, this book should always be within reach.