<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code and Life &#187; Web tips</title>
	<atom:link href="http://codeandlife.com/topics/web-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeandlife.com</link>
	<description>Tech and other visions from the liquid crystal tower</description>
	<lastBuildDate>Tue, 14 Jul 2009 07:47:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>www.Friendscribe.com launched</title>
		<link>http://codeandlife.com/2009/07/14/www-friendscribe-com-launched/</link>
		<comments>http://codeandlife.com/2009/07/14/www-friendscribe-com-launched/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 07:45:13 +0000</pubDate>
		<dc:creator>jokkebk</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Web tips]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[friendscribe]]></category>
		<category><![CDATA[irc]]></category>

		<guid isPermaLink="false">http://codeandlife.com/?p=14</guid>
		<description><![CDATA[I’ve just finished a “public beta” version of Friendscribe.com, which is a web-based chat for keeping in touch with your friends. The idea is that chat messages are stored in a database, so you don’t need to have your browser always open to see what’s going on – just log back in later and see [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve just finished a “public beta” version of Friendscribe.com, which is a web-based chat for keeping in touch with your friends. The idea is that chat messages are stored in a database, so you don’t need to have your browser always open to see what’s going on – just log back in later and see if someone has said anything while you were gone.</p>
<p>Try it yourself at <a href="http://www.friendscribe.com">http://www.friendscribe.com</a>.</p>
<p>By the way, the site is powered by <a href="http://codeigniter.com">CodeIgniter</a> &#8211; a PHP development framework you definitely should try out if you&#8217;re into PHP web development!</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandlife.com/2009/07/14/www-friendscribe-com-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nice hosting for Django and Rails nuts</title>
		<link>http://codeandlife.com/2008/01/15/nice-hosting-for-django-and-rails-nuts/</link>
		<comments>http://codeandlife.com/2008/01/15/nice-hosting-for-django-and-rails-nuts/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 20:17:14 +0000</pubDate>
		<dc:creator>jokkebk</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Web tips]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[realmenhosttheirownserver]]></category>
		<category><![CDATA[webfaction]]></category>

		<guid isPermaLink="false">http://codeandlife.com/2008/01/15/nice-hosting-for-django-and-rails-nuts/</guid>
		<description><![CDATA[Just thought to post a brief and shamelessly positive note on my current hosting provider, WebFaction. It was actually their one-click WordPress installation procedure that got me playing around with blogging, which then lead to founding this blog. I ran into it when searching for suitable site to host Django-powered software, which lead me to [...]]]></description>
			<content:encoded><![CDATA[<p>Just thought to post a brief and shamelessly positive note on my current hosting provider, <a href="http://www.webfaction.com?affiliate=jokkebk">WebFaction</a>. It was actually their one-click WordPress installation procedure that got me playing around with blogging, which then lead to founding this blog. I ran into it when searching for suitable site to host Django-powered software, which lead me to this comparison of <a href="http://www.statopia.com/corporate/blog/2007/aug/05/PopularDjangoHostingService/">Django-friendly web hosts</a>.</p>
<p>Now this probably wouldn&#8217;t be worth noting otherwise, but WebFaction is the only provider so far (leave a comment if you find others), that fulfilled all my stringent requirements for a hosting provider:</p>
<ol>
<li>Support for PHP, Ruby on Rails and Django (this alone is hard without virtual servers)</li>
<li>Support for MySQL <strong>and</strong> PostgreSQL (to suit the daily mood)</li>
<li>No arbitary limits on subdomains and domains within plans (it&#8217;s not like they cost anything to the provider)</li>
<li>Starting cost must be below $10 a month (I&#8217;d rather scale up when I actually have traffic, not beforehand)</li>
</ol>
<p><span id="more-7"></span><br />
Suffice to say, requirement for recent web platforms (Rails, Django) combined with relative freedom and low cost are almost impossible to find. Having said that, a brief look on <a href="http://www.webfaction.com/services/">what WebFaction was offering</a> did convince me to finally abandon the real-men-host-their-own-servers -approach, which had been causing me a headache lately (DSL line and a Linux box in the living room isn&#8217;t just meant for 24/7 services, if you know what I mean). In addition to my personal requirements, this provider sported additional, and in some points even exceptional benefits:</p>
<ul>
<li><strong>Unlimited</strong> domains and subdomains (I did say it already, did I?), e-mail addresses, mailboxes, and databases (yep, you heard it right)</li>
<li>Full shell access with SSH and SFTP</li>
<li>One-click installers for a dozen of most popular applications (most Python web frameworks, Rails, WordPress and others), which actually make what they are supposed to do</li>
<li>Database sizes count towards disc quota (instead of the outrageous &#8220;10MB per database&#8221; restrictions on many cheap hosting providers)</li>
</ul>
<p>Overall, the configurability and lack of any severe limitations on applications make the shared hosting plans feel much like a virtual server, without the hassle related to installing everything yourself. However, I do have some minor nags (its not a perfect world):</p>
<ul>
<li>The 60MB memory limit on the cheapest plan (this doesn&#8217;t count Apache running PHP and database servers, only Mongrel, the Apache running mod_python and the like) means that several Django/Rails instances cannot coexist (unless they are very, very basic). This can be fixed with Plan B, though. :)</li>
<li>Shell connection could be more responsive (it could also be that Finland is too far away from Texas, who knows)</li>
<li>Putting Rails behind HTTPS (they have one-click configuration option for that, too) caused a problem with redirects (which continue to point to http:// -addresses, making them not to work). Solutions do exist for this, but&#8230;</li>
</ul>
<p>Now that I&#8217;ve introduced the basic hardware powering this Blog, I may devote some posts detailing some of the forays I&#8217;ve made so far after settling with a hosting provider. But that is a story for another day.</p>
<p>As a disclaimer, aside from the hosting plan, I have no connection with WebFaction, I was just delighted enough of their service (and responsiveness of the staff, as I had a minor problem with my account setup in the start) to share this information. I do probably receive credits or something if you put me (jokkebk) as a referrer when you sign up, but that is actually your problem, not mine. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandlife.com/2008/01/15/nice-hosting-for-django-and-rails-nuts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widget-ready Wordpress sidebars without headlines</title>
		<link>http://codeandlife.com/2008/01/12/widget-ready-wordpress-sidebars-without-headlines/</link>
		<comments>http://codeandlife.com/2008/01/12/widget-ready-wordpress-sidebars-without-headlines/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 12:12:01 +0000</pubDate>
		<dc:creator>jokkebk</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Web tips]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://codeandlife.com/2008/01/12/widget-ready-wordpress-sidebars-without-headlines/</guid>
		<description><![CDATA[A lot of people are asking me (of course I have to make this stuff up because I don&#8217;t have any readers) how I&#8217;ve done the menu bar (the horizontal thing containing static pages and categories, just below the name of this blog). This is a good question, because the menu bar is actually widget-ready, [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of people are asking me (of course I have to make this stuff up because I don&#8217;t have any readers) how I&#8217;ve done the menu bar (the horizontal thing containing static pages and categories, just below the name of this blog). This is a good question, because the menu bar is actually widget-ready, so I don&#8217;t have to change it when I add new categories. &#8220;But how have you avoided the widget headers and still remained strictly XHTML compliant?&#8221;, I hear some of my imaginary readers say. Well, I&#8217;ll tell you how.<br />
<span id="more-6"></span><br />
First step is to understand how WordPress sidebars are done:</p>
<ol>
<li>Theme tells that it has sidebar(s) using either <code>register_sidebars(<em>n</em>)</code> or one to several calls to <code>register_sidebar(...)</code>. This is done in <code>functions.php</code>.</li>
<li>Where the sidebar should appear, you call <code>dynamic_sidebar()</code>, and if it returns <code>false</code>, you render some static stuff instead of widgets.</li>
</ol>
<p>All this is explained in excruciating detail in <a href="http://automattic.com/code/widgets/themes/">WordPress documentation</a>, so look it up in there, if you want to know exactly how it&#8217;s done. Now when all this is done, your call to <code>dynamic_sidebar()</code> (done inside <code>&lt;ul&gt;</code> and <code>&lt;/ul&gt;</code> tags) will output the widgets selected to this sidebar in the following manner:</p>
<pre>
&lt;li id="..." class="..."&gt;&lt;h2 class="widgettitle"&gt;Pages&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="..."&gt;Page 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="..."&gt;Page 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;&lt;li id="..." class="..."&gt;&lt;h2 class="widgettitle"&gt;AnotherWidget&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="..."&gt;Link 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="..."&gt;Link 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;</pre>
<p>Now any Google-aware reader will already know, that horizontal menus can be made from unordered lists using the following CSS definitions:</p>
<pre>
#menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#menu li {
  float: left;
}</pre>
<p>Now because the <code>ul</code> element doesn&#8217;t have margins or borders, and <code>li</code> elements float after each other, we could even have several unordered lists after each other, and still the result would look like one horizontal menu. Now the problem is how to get rid of the Widget names completely. Well, this can be done quite easily. If you look up the <code>register_sidebar()</code> function call from the <a href="http://automattic.com/code/widgets/api/">Widgets API</a>, you see that you can actually have an array of parameters governing the way widgets and their titles are outputted to the sidebar.</p>
<p>By setting <code>before_widget</code> and <code>after_widget</code> to empty strings, and not having <code>&lt;ul&gt;</code> and <code>&lt;/ul&gt;</code> around<br />
your call to <code>dynamic_sidebar()</code>, and setting <code>before_title</code> and <code>after_title</code> to beginning and end of a comment block, we achieve everything needed. So in your <code>functions.php</code>, you would have the following code (notice how I have named the sidebar &#8220;Topmenu&#8221; to make it easier to recognize that particular sidebar in WordPress widget configuration):</p>
<pre>
register_sidebar(array('name' =&gt; 'Topmenu',
		'before_widget' =&gt; '', 'after_widget' =&gt; '',
		'before_title' =&gt; '&lt;!--', 'after_title' =&gt; '--&gt;'));</pre>
<p>Which would reduce the widget code shown above to something like this:</p>
<pre>
&lt;!-- Pages --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="..."&gt;Page 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="..."&gt;Page 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- AnotherWidget --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="..."&gt;Link 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="..."&gt;Link 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>Now only thing you need to do is to put your menu-generating piece of code where you want it, in my case it was the <code>header.php</code> of my theme:</p>
<pre>
&lt;?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Topmenu') ) : ?&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.somesite.com"&gt;Static menu item 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://myblog.com"&gt;Static menu item 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;?php endif; ?&gt;</pre>
<p>Now all you need is to go into WordPress site admin, and select Presentation &gt; Widgets, and add the relevant widgets to your brand-new Topmenu (I use the Pages and Categories widgets). And you&#8217;re done!</p>
<p>Please leave comments if you have any questions or further suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandlife.com/2008/01/12/widget-ready-wordpress-sidebars-without-headlines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
