<?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>Roman Barczyński &#187; hack</title>
	<atom:link href="http://www.romke.net/priv/blog/en/tag/hack/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.romke.net/priv/blog/en/</link>
	<description>romke blog</description>
	<lastBuildDate>Thu, 05 Aug 2010 23:53:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Chrome New Tab Favorites and little hack</title>
		<link>http://www.romke.net/priv/blog/en/2010/03/chrome-new-tab-favorites-and-little-hack/</link>
		<comments>http://www.romke.net/priv/blog/en/2010/03/chrome-new-tab-favorites-and-little-hack/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 01:44:06 +0000</pubDate>
		<dc:creator>Roman Barczyński</dc:creator>
				<category><![CDATA[Lifehacks]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[tabs]]></category>

		<guid isPermaLink="false">http://www.romke.net/priv/blog/?p=228</guid>
		<description><![CDATA[This is my new tab page in Chrome: When you open new tab in most browsers you got plenty space wasted on automated pages like most frequently visited. Well, what if I visit some pages 3-4 times a month but I&#8217;d really like to have them quickly accessible. Bookmark toolbars times are gone&#8230; they stick [...]]]></description>
			<content:encoded><![CDATA[<p>This is my new tab page in Chrome:<br />
<a href="http://www.romke.net/priv/blog/wp-content/uploads/2010/03/new-tab.jpg"><img class="aligncenter size-full wp-image-229" title="chrome-new-tab" src="http://www.romke.net/priv/blog/wp-content/uploads/2010/03/new-tab.jpg" alt="" width="600" height="443" /></a></p>
<p>When you open new tab in most browsers you got plenty space wasted on automated pages like most frequently visited. Well, what if I visit some pages 3-4 times a month but I&#8217;d really like to have them quickly accessible. Bookmark toolbars times are gone&#8230; they stick on screen, they&#8217;re awful to manage (4 clicks to get to ONE &#8220;well categorized&#8221; bookmark???).</p>
<p>This single screen replaces 3-click deep bookmark tree.</p>
<p>Now how it&#8217;s done.</p>
<p>1. Get &#8220;New Tab Favorites&#8221;* Google Chrome Extension,<br />
2. find it&#8217;s files and replace newtab.html with your own file.<br />
3. Voila!</p>
<p>*) other new tab extensions will do as well but this one leaves address bar EMPTY so it&#8217;s faster to paste or search on new tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.romke.net/priv/blog/en/2010/03/chrome-new-tab-favorites-and-little-hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django smartspaceless</title>
		<link>http://www.romke.net/priv/blog/en/2010/02/django-smartspaceless/</link>
		<comments>http://www.romke.net/priv/blog/en/2010/02/django-smartspaceless/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 11:43:36 +0000</pubDate>
		<dc:creator>Roman Barczyński</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.romke.net/priv/blog/?p=128</guid>
		<description><![CDATA[Default django spaceless tag is weird, it consumes all spaces between tags and none inside of them. It&#8217;s good for small parts of site but&#8230; &#8230;But I like my html to be cleared of all unnecessary mess which in many cases end up like this: &#60;a href="..."&#62;link1&#60;/a&#62; &#60;a href="..."&#62;link2&#60;/a&#62; generates awful: link1link2 In addition if [...]]]></description>
			<content:encoded><![CDATA[<p>Default django spaceless tag is weird, it consumes all spaces between tags and none inside of them. It&#8217;s good for small parts of site but&#8230;</p>
<p><span id="more-128"></span>&#8230;But I like my html to be cleared of all unnecessary mess which in many cases end up like this:</p>
<pre>&lt;a href="..."&gt;link1&lt;/a&gt; &lt;a href="..."&gt;link2&lt;/a&gt;</pre>
<p>generates awful:</p>
<pre><span style="text-decoration: underline;">link1link2</span></pre>
<p>In addition if you like having your templates indented it leaves awful things like:</p>
<pre>&lt;div&gt;
                                Test text testt
                             &lt;/div&gt;</pre>
<p>Here&#8217;s my &#8220;smart&#8221; version of strip_spaces_between_tags which can be used with overrided spaceless template tag:</p>
<pre>def strip_multiple_spaces_between_tags(value):
    """Returns the given HTML with multiple spaces between tags removed."""
    def tagcheck(obj, prefix='', sufix=''):
        tag = obj.group(1).lower()
        if tag[0] == '/':
            tag = tag[1:]
        if tag != 'pre':
            return '%s&lt;%s&gt;%s' % (prefix, ''.join(obj.groups('')), sufix)
        return obj.group(0)
    def tagprecheck(obj):
        return tagcheck(obj, sufix=' ')
    def tagpostcheck(obj):
        return tagcheck(obj, prefix=' ')

    value = force_unicode(value)
    value = re.sub(r'&lt;(/?[\w]+)([^&gt;]*)&gt;\s{2,}', tagprecheck, value);
    value = re.sub(r'\s{2,}&lt;(/?[\w]+)([^&gt;]*)&gt;', tagpostcheck, value)
    value = re.sub(r'&gt;\s{2,}&lt;', '&gt; &lt;', value)
    return value
strip_multiple_spaces_between_tags = allow_lazy(strip_multiple_spaces_between_tags, unicode)</pre>
<p>This does few things:</p>
<ul>
<li>it removes all multiple spaces between tags,</li>
<li>it removes all multiple spaces at from &#8220;&lt;tag&gt; HERE text HERE &lt;/tag&gt;&#8221; on all tags <strong>except</strong> pre.</li>
</ul>
<p>If you find it useful or you have fix/extension to it (any other tag I should think of?) please feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.romke.net/priv/blog/en/2010/02/django-smartspaceless/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
