<?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>Kevin Deldycke &#187; HTML</title> <atom:link href="http://kevin.deldycke.com/tag/hypertext-markup-language/feed/" rel="self" type="application/rss+xml" /><link>http://kevin.deldycke.com</link> <description>Free software engineer &#38; wannabe videomaker</description> <lastBuildDate>Fri, 03 Feb 2012 19:08:27 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>WebPing Open-sourced !</title><link>http://kevin.deldycke.com/2011/08/webping-open-sourced/</link> <comments>http://kevin.deldycke.com/2011/08/webping-open-sourced/#comments</comments> <pubDate>Tue, 16 Aug 2011 10:10:06 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[email]]></category> <category><![CDATA[flot]]></category> <category><![CDATA[GitHub]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[HTTP]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[munin]]></category> <category><![CDATA[nagios]]></category> <category><![CDATA[plone]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[sqlite]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[webping]]></category> <category><![CDATA[yaml]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=3715</guid> <description><![CDATA[I&#8217;ve just released WebPing under a GPL license. It&#8217;s available right now on a GitHub repository. WebPing is a script I started to work on in 2009 while working at EDF. Back then, I needed a monitoring tool to keep &#8230; <a href="http://kevin.deldycke.com/2011/08/webping-open-sourced/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve just released WebPing under a GPL license. It&#8217;s available right now on a <a href="http://github.com/kdeldycke/webping">GitHub repository</a>.</p><p>WebPing is a script I started to work on in 2009 while working at <a href="http://www.edf.com/">EDF</a>. Back then, I needed a monitoring tool to keep an eye on the 80+ <a href="http://plone.org/">Plone</a> instances that my team managed. For several corporate reasons, I wasn&#8217;t allowed to use a proper monitoring tool like <a href="http://munin-monitoring.org/">Munin</a> or <a href="http://www.nagios.org/">Nagios</a>. So I created a small script to fill this need. That&#8217;s how WebPing came to be.</p><p>WebPing is just a stupid Python script that is designed to be ticked regularly by a cron job. It try to fetch a list of URLs and store response times in an SQLite database. Then it create a static HTML report you&#8217;re free to serve with any HTTP server (an <a href="http://github.com/kdeldycke/webping/blob/master/apache.conf">example Apache configuration</a> is provided). The configuration of WebPing and the list of URLs it monitor is stored in a YAML file.</p><p>The produced HTML report use the <a href="http://code.google.com/p/flot">Flot jQuery plugin</a> to render graphs. Here is how the dashboard looks like:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/08/webping-dashboard.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/08/webping-dashboard-271x300.png" alt="" title="webping-dashboard" width="271" height="300" class="aligncenter size-medium wp-image-3777" /></a></p><p>Finally, WebPing is able to send reports and alerts by emails. Here is how a mail alert looks like:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/08/webping-email-alert.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/08/webping-email-alert-300x293.png" alt="" title="webping-email-alert" width="300" height="293" class="aligncenter size-medium wp-image-3743" /></a></p><p>Since I created WebPing, I found several other projects more or less developed around the same idea. See <a href="http://github.com/ericholscher/django-kong">Kong</a>, which is based on Django and <a href="http://twill.idyll.org/">Twill</a>, a web-oriented <a href="http://en.wikipedia.org/wiki/Domain-specific_language">DSL</a>. Another project I spotted after the facts was <a href="http://code.google.com/p/multi-mechanize">multi-mechanize</a>. Like Kong, it&#8217;s written in Python. But I never played with one or the other.</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2011/08/webping-open-sourced/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Cool Cavemen WebDesign Retrospective</title><link>http://kevin.deldycke.com/2011/06/cool-cavemen-webdesign-retrospective/</link> <comments>http://kevin.deldycke.com/2011/06/cool-cavemen-webdesign-retrospective/#comments</comments> <pubDate>Tue, 14 Jun 2011 10:38:26 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Cool Cavemen]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[e107]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[Template]]></category> <category><![CDATA[Theme]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[webdesign]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=3302</guid> <description><![CDATA[Here is a collection of all themes I created for the Cool Cavemen website over the years. Before settling on its current name, the Cool Cavemen project was referred to by its members as The Ultimate Band (talk about rock-star &#8230; <a href="http://kevin.deldycke.com/2011/06/cool-cavemen-webdesign-retrospective/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Here is a collection of all themes I created for the <a href="http://coolcavemen.com">Cool Cavemen website</a> over the years.</p><p>Before settling on its current name, the Cool Cavemen project was referred to by its members as <em>The Ultimate Band</em> (talk about rock-star egos&#8230;). Here is a screenshot of the theme I did for e107:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/2004_11_13.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/2004_11_13-233x300.png" alt="" title="2004_11_13" width="233" height="300" class="aligncenter size-medium wp-image-3303" /></a></p><p>In fact the <a href="http://coolcavemen.com/2004_11_01-first-cavemen/index.html">original HTML mockup</a> this theme is based on still exists. It is dated back to November 1st, 2004, which is now the official <a href="http://coolcavemen.com/2005/joyeux-anniversaire-cool-cavemen-bientot-le-premier-cd/">Cool Cavemen anniversary</a>. The theme above was created two weeks later.</p><p>When I created the Cool Cavemen&#8217;s site, I choose e107. Back then I perceived it to be the only Open Source PHP-based CMS having the best balance between a clean and a powerful theme engine. That was my opinion before decided to <a href="http://kevin.deldycke.com/2006/08/e107-to-wordpress-migration-here-is-why/">switch to WordPress</a>.</p><p>At the end of November &#8217;04, our theme was updated to this:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/2004_11_28.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/2004_11_28-300x283.png" alt="" title="2004_11_28" width="300" height="283" class="aligncenter size-medium wp-image-3305" /></a></p><p>The header above is based on a photo of a green laser, that was taken by <a href="http://coolcavemen.com/biography/steve-canett/">Cool Cavemen&#8217;s guitarist</a>.</p><p>2005 started with an updated version of the theme, featuring a photo of Cool Cavemen&#8217;s first gig. They were only three on stage, <a href="http://coolcavemen.com/biography/guiguit/">our bass player</a> was still drumming at the time:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_01_021.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_01_021-300x275.png" alt="" title="2005_01_02" width="300" height="275" class="aligncenter size-medium wp-image-3308" /></a></p><p>In February we finally had our official photo featuring all members of the band ! But it was cold outside so we added some fur to keep our website warm:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_02_27.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_02_27-267x300.png" alt="" title="2005_02_27" width="267" height="300" class="aligncenter size-medium wp-image-3309" /></a></p><p>I spent the next months trying to build my own version of <a href="http://www.alistapart.com/articles/holygrail/">the Holy Grail</a>: a perfect CSS-based 3-columns fluid layout (with a middle column placed in the top of the HTML). This explain <a href="http://en.wikipedia.org/wiki/Eric_Meyer">Eric Mayer</a>&#8216;s quote in these mockups and the references to the <a href="http://ruthsarian.wordpress.com/2004/08/20/stgargoyles/">Skidoo Too template</a>:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_03_06.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_03_06-300x300.png" alt="" title="2005_03_06" width="300" height="300" class="aligncenter size-medium wp-image-3310" /></a></p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_04_01.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_04_01-300x291.png" alt="" title="2005_04_01" width="300" height="291" class="aligncenter size-medium wp-image-3311" /></a></p><p>I never found the Holy Grail, and the tests above remained unseen by the public. Tired by this journey, I never touched the theme again.</p><p>Until September 2005 when I updated it to this:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_09_06.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/2005_09_06-268x300.png" alt="" title="2005_09_06" width="268" height="300" class="aligncenter size-medium wp-image-3312" /></a></p><p>Notice the box in the top of the right column, which was designed to publish a new track every week. The <a href="http://kevin.deldycke.com/2007/02/delayed-cd-tracks-publishing-with-php/">code behind this box</a> is available in another article.</p><p>So that was the last major version of the theme. Basically our e107 site looked that way for most of its life.</p><p>In November 2005 I attempted to reboot the theme. I made these 3 propositions to the band:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/new_look_11.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/new_look_11-223x300.png" alt="" title="new_look_1" width="223" height="300" class="aligncenter size-medium wp-image-3315" /></a></p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/new_look_2.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/new_look_2-234x300.png" alt="" title="new_look_2" width="234" height="300" class="aligncenter size-medium wp-image-3316" /></a></p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/new_look_3.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/new_look_3-202x300.png" alt="" title="new_look_3" width="202" height="300" class="aligncenter size-medium wp-image-3317" /></a></p><p>The last one had an interactive header, with tiny sketches showing up on mouse over:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/new_look_3_mouseover.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/new_look_3_mouseover-300x73.png" alt="" title="new_look_3_mouseover" width="300" height="73" class="aligncenter size-medium wp-image-3329" /></a></p><p>Unfortunately we didn&#8217;t found any of these themes matching the Cool Cavemen spirit (whatever that is). If these <a href="http://coolcavemen.com/forums/topic/nouveaux-look-du-site/">alternatives were publicly discussed</a>, we decided that no one was going to replace our previous theme.</p><p>The final update we made was when our <a href="http://coolcavemen.com/discography/raw/">Raw EP</a> was released. We basically applied filters on the header to match Raw&#8217;s cover. We also updated our logo to use the one designed for us by <a href="http://qpx.coolcavemen.com">QPX</a>:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/06/coolcavemen.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/06/coolcavemen-284x300.png" alt="" title="coolcavemen" width="284" height="300" class="aligncenter size-medium wp-image-3313" /></a></p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2011/06/cool-cavemen-webdesign-retrospective/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Web commands</title><link>http://kevin.deldycke.com/2010/03/web-commands/</link> <comments>http://kevin.deldycke.com/2010/03/web-commands/#comments</comments> <pubDate>Fri, 26 Mar 2010 16:08:36 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[certificate]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[KDE]]></category> <category><![CDATA[konqueror]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[openssl]]></category> <category><![CDATA[RSA]]></category> <category><![CDATA[ssl]]></category> <category><![CDATA[wget]]></category> <category><![CDATA[x509]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=1257</guid> <description><![CDATA[Download a web page an all its requisites: Create a PNG image of a rendered html page: Search in all files malformed HTML entities (in this case non-breakable spaces that doesn&#8217;t end with a semicolon): Here is a one-liner I &#8230; <a href="http://kevin.deldycke.com/2010/03/web-commands/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<ul><li>Download a web page an all its requisites:<pre class="brush: bash; title: ; notranslate">
wget -r -p -nc -nH --level=1 http://pypi.python.org/simple/python-ldap/
</pre></li><li>Create a PNG image of a rendered html page:<pre class="brush: bash; title: ; notranslate">
kwebdesktop 1024 768 capture.png http://slashdot.org/
</pre></li><li>Search in all files malformed HTML entities (in this case non-breakable spaces that doesn&#8217;t end with a semicolon):<pre class="brush: bash; title: ; notranslate">
grep -RIi --extended-regexp '&amp;nbsp[^;]' ./
</pre></li><li>Here is a one-liner I use to ping some pages on internet to force our corporate proxy to refresh its internal cache:<pre class="brush: bash; title: ; notranslate">
for EGG in BeautifulSoup PIL Plone; do wget --server-response -O /dev/null http://pypi.python.org/simple/$EGG/; done
</pre></li><li>Create a minimal self-signed unencrypted SSL certificate without issuer information and a validity period of 10 years:<pre class="brush: bash; title: ; notranslate">
openssl req -x509 -nodes -subj '/' -days 3650 -newkey rsa:2048 -keyout self-signed.pem -out self-signed.pem
</pre></li><li>Create a pair of SSL self-signed certificate and (unencrypted) private key (<a href="http://devsec.org/info/ssl-cert.html">source</a>):<pre class="brush: bash; title: ; notranslate">
openssl genrsa -out private.key 2048
openssl req -new -subj '/' -key private.key -out certreq.csr
openssl x509 -req -days 3650 -in certreq.csr -signkey private.key -out self-signed.pem
rm certreq.csr
</pre></li><li>View certificate details:<pre class="brush: bash; title: ; notranslate">
openssl x509 -noout -text -in self-signed.pem
</pre></li></ul> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2010/03/web-commands/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Python ultimate regular expression to catch HTML tags</title><link>http://kevin.deldycke.com/2008/07/python-ultimate-regular-expression-to-catch-html-tags/</link> <comments>http://kevin.deldycke.com/2008/07/python-ultimate-regular-expression-to-catch-html-tags/#comments</comments> <pubDate>Mon, 07 Jul 2008 22:24:26 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[regexp]]></category> <category><![CDATA[Snippet]]></category> <category><![CDATA[software]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[xHTML]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=232</guid> <description><![CDATA[1 year and 3 months ago I&#8217;ve came with a PHP regexp to parse HTML tag soup. Here is an improved version, in Python (my favorite language so far), that is normally much prone to detect strange HTML tags. It &#8230; <a href="http://kevin.deldycke.com/2008/07/python-ultimate-regular-expression-to-catch-html-tags/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>1 year and 3 months ago I&#8217;ve came with a <a href="http://kevin.deldycke.com/2007/03/ultimate-regular-expression-for-html-tag-parsing-with-php/">PHP regexp to parse HTML tag soup</a>. Here is an improved version, in Python (my favorite language so far), that is normally much prone to detect strange HTML tags. It also support attributes without value so it&#8217;s closer to the <a href="http://www.w3.org/TR/REC-html40/">HTML specification</a>, but doesn&#8217;t strictly stick to it in order to catch <a href="http://en.wikipedia.org/wiki/Tag_soup">tag soup</a> and malformatted tags.</p><pre class="brush: python; title: ; notranslate">
ultimate_regexp = &quot;(?i)&lt;\/?\w+((\s+\w+(\s*=\s*(?:\&quot;.*?\&quot;|'.*?'|[^'\&quot;&gt;\s]+))?)+\s*|\s*)\/?&gt;&quot;
</pre><p>And here is it applied in a trivial example (in a python shell):</p><pre class="brush: python; title: ; notranslate">
&gt;&gt;&gt; import re
&gt;&gt;&gt;
&gt;&gt;&gt; content = &quot;&quot;&quot;This is the &lt;strong&gt;content&lt;/strong&gt; in which we want to
&lt;em&gt;find&lt;/em&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Html&quot;&gt;HTML&lt;/a&gt; tags.&quot;&quot;&quot;
&gt;&gt;&gt;
&gt;&gt;&gt; ultimate_regexp = &quot;(?i)&lt;\/?\w+((\s+\w+(\s*=\s*(?:\&quot;.*?\&quot;|'.*?'|[^'\&quot;&gt;\s]+))?)+\s*|\s*)\/?&gt;&quot;
&gt;&gt;&gt;
&gt;&gt;&gt; for match in re.finditer(ultimate_regexp, content):
...   print repr(match.group())
...
'&lt;strong&gt;'
'&lt;/strong&gt;'
'&lt;em&gt;'
'&lt;/em&gt;'
'&lt;a href=&quot;http://en.wikipedia.org/wiki/Html&quot;&gt;'
'&lt;/a&gt;'
&gt;&gt;&gt;
</pre>]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2008/07/python-ultimate-regular-expression-to-catch-html-tags/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>How-to add a corner banner to a K2 WordPress theme&#8217;s style</title><link>http://kevin.deldycke.com/2008/06/how-to-add-a-corner-banners-to-a-k2-wordpress-theme-style/</link> <comments>http://kevin.deldycke.com/2008/06/how-to-add-a-corner-banners-to-a-k2-wordpress-theme-style/#comments</comments> <pubDate>Sat, 07 Jun 2008 17:34:20 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[alpha]]></category> <category><![CDATA[banner]]></category> <category><![CDATA[corner]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[design]]></category> <category><![CDATA[Gimp]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[IE]]></category> <category><![CDATA[K2]]></category> <category><![CDATA[Photoshop]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[PNG]]></category> <category><![CDATA[qpx]]></category> <category><![CDATA[style]]></category> <category><![CDATA[Theme]]></category> <category><![CDATA[transparency]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=226</guid> <description><![CDATA[In this post I will give you all the technical details to create a corner banner for the wordpress K2 theme. This solution is uninstrusive as it can be bundled with a K2 style without modifying the K2 core theme. &#8230; <a href="http://kevin.deldycke.com/2008/06/how-to-add-a-corner-banners-to-a-k2-wordpress-theme-style/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><img src="http://kevin.deldycke.com/wp-content/uploads/2008/06/beta-version-illustration-150x150.png" alt="" title="beta-version-illustration" width="150" height="150" class="alignleft size-thumbnail wp-image-227" /></p><p>In this post I will give you all the technical details to create a corner banner for the wordpress K2 theme. This solution is uninstrusive as it can be bundled with a K2 style without modifying the K2 core theme.</p><p>We will use the new <a href="http://code.google.com/p/kaytwo/wiki/K2CSSandCustomCSS#PHP">hooks</a> from the brand new <a href="http://getk2.com/2008/04/k2-release-candidate-6-released/">K2 1.0RC6</a>. So first, we have to create a <code>functions.php</code> file in our style directory (example: <code>/wp-content/themes/k2/styles/my-style</code>). Then add the following PHP code in it:</p><pre class="brush: php; title: ; notranslate">
&lt;?php

// Add HTML code required by our corner banner
function add_corner_banner() {
  ?&gt;
  &lt;a id=&quot;cornerbanner&quot; href=&quot;http://coolcavemen.com/news/new-website-beta-released/&quot; title=&quot;New website released as beta version !&quot;&gt;&lt;/a&gt;
  &lt;?php
}

// Call add_corner_banner() method on each template_body_top hook
add_action(‘template_body_top’, ‘add_corner_banner’);

?&gt;
</pre><p>This code tell K2 to replace the <code>template_body_top</code> hook define in all K2 pages, by the result of the <code>add_corner_banner()</code> PHP function. This function is coded to return the HTML code we need for the corner banner.</p><p>Then we need to add the following CSS code to our style (<code>/wp-content/themes/k2/styles/my-style/my-style.css</code>):</p><pre class="brush: css; title: ; notranslate">
#cornerbanner {
  background: url(&quot;/wp-content/themes/k2/styles/my-style/corner-banner.png&quot;) no-repeat;
  display: block;
  height: 205px;
  width: 205px;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 999;
  text-decoration: none;
}
</pre><p>This CSS code refer to the <code><a href='http://kevin.deldycke.com/wp-content/uploads/2008/06/corner-banner.png'>corner-banner.png</a></code> which is a 205&#215;205 px PNG image with an alpha channel to simulate shadows and fine transparency. Here is the <a href="http://kevin.deldycke.com/wp-content/uploads/2008/06/corner-banner.xcf">Gimp <code>xcf</code> source file</a> I used to generate it.</p><p>This CSS code is designed for a top right banner. If you need a top left banner, replace:</p><pre class="brush: css; title: ; notranslate">
  right: 0;
</pre><p>by</p><pre class="brush: css; title: ; notranslate">
  left: 0;
</pre><p>This also work for horizontal positioning:</p><pre class="brush: css; title: ; notranslate">
  top: 0;
</pre><p>can be replaced by</p><pre class="brush: css; title: ; notranslate">
  bottom: 0;
</pre><p>That&#8217;s all ! My solution is not supposed to work (and was not tested) with Internet Explorer as the latter is known to have <a href="http://en.wikipedia.org/wiki/Portable_Network_Graphics#Web_browser_support_for_PNG">terrible PNG transparency support</a>. You can still apply fixes on my code using <a href="http://www.twinhelix.com/css/iepngfix/">iepngfix</a>, <a href="http://jquery.andreaseberhard.de/pngFix/">jquery</a> or <a href="http://www.sitepoint.com/blogs/2007/09/18/png8-the-clear-winner/">PNG8 images</a>.</p><p>I&#8217;ve provided you with all the technical details to create a corner banner and add it to your K2 style seamlessly. It&#8217;s now up to you to adapt it to your needs. Be Creative ! Oh, and by the way, when you&#8217;ll change the banner PNG file, do not forget to update the CSS code with your image width and height.</p><p><ins datetime="2008-06-14T12:29:47+00:00"><strong>Update</strong>: <a href="http://qpx.coolcavemen.com">my friend QPX</a> sent me an alternative banner made with photoshop: here is the <a href="http://kevin.deldycke.com/wp-content/uploads/2008/06/corner-banner-qpx.png">ready-to-use PNG file</a> and the <a href="http://kevin.deldycke.com/wp-content/uploads/2008/06/corner-banner-qpx.psd">photoshop source file</a>.</ins></p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2008/06/how-to-add-a-corner-banners-to-a-k2-wordpress-theme-style/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>How-to inherit CSS width attributes for Internet Explorer</title><link>http://kevin.deldycke.com/2008/06/how-to-inherit-css-width-attributes-for-internet-explorer/</link> <comments>http://kevin.deldycke.com/2008/06/how-to-inherit-css-width-attributes-for-internet-explorer/#comments</comments> <pubDate>Tue, 03 Jun 2008 19:56:03 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[design]]></category> <category><![CDATA[firefox]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[IE]]></category> <category><![CDATA[layout]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[webdesign]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=225</guid> <description><![CDATA[Let&#8217;s say you rely on a third party CSS framework that set the default layout of your content. The following CSS rule is part of the framework: This CSS directive tell all your images to use the full width available &#8230; <a href="http://kevin.deldycke.com/2008/06/how-to-inherit-css-width-attributes-for-internet-explorer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Let&#8217;s say you rely on a third party CSS framework that set the default layout of your content. The following CSS rule is part of the framework:</p><pre class="brush: css; title: ; notranslate">
img {
  width: 100%;
}
</pre><p>This CSS directive tell all your images to use the full width available to them.</p><p>Now, for any reason (aesthetic, layout, etc.), you want to reset this behaviour.</p><p>One solution (the laziest) is to remove those three lines from the original CSS file. But if you&#8217;re like me, this sound too dirty for you as you don&#8217;t want to modify the original CSS file (I like to avoid patches on third party tools and libraries I don&#8217;t maintain).</p><p>Another solution consist in overriding this <code>width</code> attribute in another CSS file that you will call after the original one. This case is covered by the <a href="http://www.w3.org/TR/CSS21/">CSS 2.1 specification</a> which define the <a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit"><code>inherit</code> value</a>:</p><pre class="brush: css; title: ; notranslate">
img {
  width: inherit;
}
</pre><p>This solution is perfect and work as expected in Firefox. Unfortunately, and without any surprise, it doesn&#8217;t with Microsoft&#8217;s browser as <a href="http://www.sitepoint.com/blogs/2007/11/22/in-all-fairness-%e2%80%a6-internet-explorer-still-stinks/">IE has anecdotical support of CSS&#8217;s <code>inherit</code></a>.</p><p>But today I found a trick to fix this in both Firefox and Internet Explorer. The workaround is to use the <code>auto</code> value instead of <code>inherit</code>:</p><pre class="brush: css; title: ; notranslate">
img {
  width: auto;
}
</pre><p>I&#8217;ve tested it with both <a href="http://blog.mozilla.com/blog/2008/05/20/firefox-3-release-candidate-now-available-for-download/">Firefox 3.0rc1</a> and Internet Explorer 6.0.2800.1106CO.</p><p>Of course this solution is not generic: it only work in my case because <code>img</code> html tags has <code>width</code> attributes that support the <code>auto</code> value.</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2008/06/how-to-inherit-css-width-attributes-for-internet-explorer/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Ultimate Regular Expression for HTML tag parsing with PHP</title><link>http://kevin.deldycke.com/2007/03/ultimate-regular-expression-for-html-tag-parsing-with-php/</link> <comments>http://kevin.deldycke.com/2007/03/ultimate-regular-expression-for-html-tag-parsing-with-php/#comments</comments> <pubDate>Fri, 23 Mar 2007 22:27:09 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[parsing]]></category> <category><![CDATA[PCRE]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[regexp]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2007/03/ultimate-regular-expression-for-html-tag-parsing-with-php/</guid> <description><![CDATA[Disclaimer: this is a dirty hack ! To parse HTML or XML, use a dedicated library. Tonight I found the ultimate regex to get HTML tags out of a string. It was written a year ago by Phil Haack on &#8230; <a href="http://kevin.deldycke.com/2007/03/ultimate-regular-expression-for-html-tag-parsing-with-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><em><strong>Disclaimer</strong>: this is a dirty hack ! To parse HTML or XML, <a href="#comment-4740">use a dedicated library</a>.</em></p><p>Tonight I found the ultimate <a href="http://en.wikipedia.org/wiki/Regular_expression">regex</a> to get HTML tags out of a string. It was <a href="http://haacked.com/archive/2005/04/22/Matching_HTML_With_Regex.aspx">written a year ago by Phil Haack on his blog</a>. His regex is quite bullet-proof: it&#8217;s able to parse HTML tags written on multiple lines which contain any sort of attributes (with or without a value, with single or double quotes).</p><p>Unfortunately his regular expression was designed for Microsoft .NET, so I&#8217;ve spend some time to convert it to PHP. Here is the result:</p><pre class="brush: php; title: ; notranslate">
$regex = &quot;/&lt;\/?\w+((\s+\w+(\s*=\s*(?:\&quot;.*?\&quot;|'.*?'|[^'\&quot;&gt;\s]+))?)+\s*|\s*)\/?&gt;/i&quot;;
</pre><p>And finally, my version based on the one above:</p><pre class="brush: php; title: ; notranslate">
$regex = &quot;/&lt;\/?\w+((\s+(\w|\w[\w-]*\w)(\s*=\s*(?:\&quot;.*?\&quot;|'.*?'|[^'\&quot;&gt;\s]+))?)+\s*|\s*)\/?&gt;/i&quot;;
</pre><p>The latter include the following enhancement:</p><ul><li>accept hyphens as attribute&#8217;s middle characters (<a href="http://kevin.deldycke.com/2007/03/ultimate-regular-expression-for-html-tag-parsing-with-php/#comment-3167">thanks Ged</a>)</li></ul> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2007/03/ultimate-regular-expression-for-html-tag-parsing-with-php/feed/</wfw:commentRss> <slash:comments>31</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/30 queries in 0.017 seconds using apc
Object Caching 928/1004 objects using apc

Served from: kevin.deldycke.com @ 2012-02-08 11:33:56 -->
