<?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>Nerdpress.org &#187; Max Girkens</title>
	<atom:link href="http://www.nerdpress.org/author/max-girkens/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nerdpress.org</link>
	<description>^__^</description>
	<lastBuildDate>Thu, 03 May 2012 15:03:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Hosting multiple Express (node.js) apps on port 80</title>
		<link>http://www.nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/</link>
		<comments>http://www.nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 03:40:31 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[socket.io]]></category>
		<category><![CDATA[vServer]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[sockets]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=2144</guid>
		<description><![CDATA[In the last days, i was trying to find a solution hosting multiple Express apps on my vServer the same Server. Starting with Apache and mod_proxy, i ended up with a plain node solution, which i really like. Let&#8217;s take a quick look on some different approaches out there: &#8212;1&#8212; Using apache on port 80 [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>In the last days, i was trying to find a solution hosting multiple <a href="http://expressjs.com/">Express</a> apps on <del datetime="2012-04-19T00:40:35+00:00">my vServer </del>the same Server.</p>
<p>Starting with <a href="http://www.apache.org/">Apache</a> and <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html">mod_proxy</a>, i ended up with a plain node solution, which i really like.<span id="more-2144"></span></p>
<p><a href="http://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors.png" rel="lightbox[post-2144]" title=""><img class="alignnone size-full wp-image-2146" src="http://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors.png" alt="Node-http-proxy-haz-colors in " width="527" height="106" /></a></p>
<p>Let&#8217;s take a quick look on some different approaches out there:</p>
<p><strong>&#8212;1&#8212;</strong></p>
<p>Using apache on port 80 as a proxy</p>
<pre class="brush: bash; title: ; notranslate">
ProxyPass /nodeurls/ http://localhost:9000/
ProxyPassReverse /nodeurls/ http://localhost:9000/
</pre>
<p>via <a href="http://stackoverflow.com/questions/6109089/how-do-i-run-node-js-on-port-80">stackoverflow</a></p>
<p>&#8211; no websockets<br />
++ probably the easiest way to integrate with your running AMPP-stack</p>
<p><strong>&#8212;2&#8212;</strong></p>
<p>Using a node.js app on port 80 as a Wrapper for other node apps.</p>
<pre class="brush: jscript; title: ; notranslate">
express.createServer()
  .use(express.vhost('hostname1.com', require('/path/to/hostname1').app)
  .use(express.vhost('hostname2.com', require('/path/to/hostname2').app)
.listen(80)
</pre>
<p>via <a href="http://stackoverflow.com/questions/9332865/how-should-i-organize-multiple-express-servers-on-the-same-system">stackoverflow</a></p>
<p>++ you can use websockets on port 80<br />
&#8211; apps crash/restart/stop globally<br />
&#8211;what about your apache or the like?</p>
<p><strong>&#8212;3&#8212;</strong></p>
<p>Using node.js with node-http-proxy on port 80</p>
<pre class="brush: jscript; title: ; notranslate">
var http = require('http')
, httpProxy = require('http-proxy');

httpProxy.createServer({
  hostnameOnly: true,
  router: {
    //web-development.cc
    'www.my-domain.com': '127.0.0.1:3001',
    'www.my-other-domain.de' : '127.0.0.1:3002'
  }
}).listen(80);
</pre>
<p>++ proxy websockets to any port<br />
&#8211; you might need to move your old web server to another port</p>
<p>The really cool thing about using node-http-proxy is its capability of proxying websockets.<br />
So you can have your apps running independtly on different ports while serving everything to the user over port 80 and use stuff like <a href="http://socket.io/">socket.io</a>.</p>
<p>Since i&#8217;m new to node.js and miles away from beeing a admin, any feedback is highly appreciated :)</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to add placeholder attributes in Silverstripe Userforms Module</title>
		<link>http://www.nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/</link>
		<comments>http://www.nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 04:32:28 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Silverstripe]]></category>
		<category><![CDATA[placeholder]]></category>
		<category><![CDATA[UserForm]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=2160</guid>
		<description><![CDATA[to be honest i didn&#8217;t find a clean way yet, but i thought this workaround might be worth sharing. &#8230;since Silverstripes&#8216; Userforms Module Uses jQuery for Validation you can put these lines of code in your UserDefinedForm.ss Template: This will iterate over the labels in the form , build placeholder attributes from each one and [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>to be honest i didn&#8217;t find a clean way yet, but i thought this workaround might be worth sharing.</p>
<p>&#8230;since <a href="http://www.silverstripe.org/">Silverstripes</a>&#8216; <a href="http://www.silverstripe.org/user-forms-module/">Userforms Module</a> Uses jQuery for Validation you can put these lines of code in your UserDefinedForm.ss Template:<span id="more-2160"></span></p>
<pre class="brush: jscript; title: ; notranslate">
jQuery(document).ready(function(){
    jQuery('form label').each(function(){
      jQuery(this).parent().find('input, textarea').attr('placeholder', jQuery(this).html());
      jQuery(this).remove();
    })
  });
</pre>
<p>This will iterate over the labels in the form , build placeholder attributes from each one and then remove it.</p>
<p>If anyone knows a way how to do this in PHP, i&#8217;d appreciate a comment :)</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tools for jade template development</title>
		<link>http://www.nerdpress.org/2012/04/09/tools-for-jade-template-development/</link>
		<comments>http://www.nerdpress.org/2012/04/09/tools-for-jade-template-development/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 10:12:01 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[Express]]></category>
		<category><![CDATA[Jade]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[jade]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=2132</guid>
		<description><![CDATA[I recently started digging into node.js and the express framework. One thing i like about it is that it comes with the beautiful jade template engine by default. Here are some things that come real hany when you are working with jade. This one really saved my mental health in more than one case. Just [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>I recently started digging into <a href="http://nodejs.org/">node.js</a> and the <a href="http://expressjs.com/">express framework</a>.<br />
One thing i like about it is that it comes with the beautiful <a href="http://jade-lang.com/">jade template engine</a> by default.</p>
<p>Here are some things that come real hany when you are working with jade.<span id="more-2132"></span></p>
<p>This one really saved my mental health in more than one case.<br />
Just paste your HTML and you get nice and clean jade code:</p>
<p><a href="http://html2jade.aaron-powell.com/">http://html2jade.aaron-powell.com/</a></p>
<p>If you are using Netbeans, make sure you don&#8217;t miss to install the beautifully working plugin for .jade files.</p>
<p><a href="https://github.com/lumenlunae/jade-netbeans-syntax-highlighting">https://github.com/lumenlunae/jade-netbeans-syntax-highlighting</a></p>
<p>If you are developing in PHP and want to check out jade anyway, check this out:</p>
<p><a href="http://nerdpress.org/wp-content/uploads/2012/04/php_jade.jpg" rel="lightbox[post-2132]" title=""><img class="alignnone size-full wp-image-2135" src="http://nerdpress.org/wp-content/uploads/2012/04/php_jade.jpg" alt="Php Jade in " width="293" height="238" /></a></p>
<p>No seriously, check THIS:</p>
<p><a href="https://github.com/everzet/jade.php">https://github.com/everzet/jade.php</a></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2012/04/09/tools-for-jade-template-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>run JavaScript code in PHP 5.3 with the v8js extension</title>
		<link>http://www.nerdpress.org/2012/03/09/run-javascript-code-in-php-5-3-with-the-v8js-extension/</link>
		<comments>http://www.nerdpress.org/2012/03/09/run-javascript-code-in-php-5-3-with-the-v8js-extension/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 23:14:10 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[JS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[pecl]]></category>
		<category><![CDATA[v8js.so]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=2102</guid>
		<description><![CDATA[&#8230;for some reason i needed to get t h i s to work before going to sleep. I&#8217;m running OSX 10.7.3 with macports which usually does the job, but  Google&#8217;s V8 Javascript Engine is not available as a port yet. So&#8230; homebrew to the rescue: installed it: and installed v8 wait, this seems too easy. [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>&#8230;for some reason i needed to get <strong><a href="http://php.net/manual/en/book.v8js.php">t h i s</a></strong> to work before going to sleep.</p>
<p>I&#8217;m running OSX 10.7.3 with <a href="http://www.macports.org/">macports</a> which usually does the job, but  <a href="http://code.google.com/p/v8/">Google&#8217;s V8 Javascript Engine</a> is not available as a port yet.<span id="more-2102"></span></p>
<p>So&#8230; <a href="http://mxcl.github.com/homebrew/">homebrew</a> to the rescue:</p>
<p>installed it:</p>
<pre class="brush: bash; title: ; notranslate">
/usr/bin/ruby -e &quot;$(/usr/bin/curl -fsSL https://raw.github.com/gist/323731)&quot;
</pre>
<p>and installed v8</p>
<pre class="brush: bash; title: ; notranslate">
brew install v8
</pre>
<p>wait, this seems <a href="http://www.youtube.com/watch?v=jWI8w9kLAks">too easy</a>.</p>
<p>PECL installed some beta version of the PHP extension.</p>
<pre class="brush: bash; title: ; notranslate">
sudo pecl install channel://pecl.php.net/v8js-0.1.2
</pre>
<p>added</p>
<pre class="brush: bash; title: ; notranslate">extension=v8js.so</pre>
<p>to the php.ini file.</p>
<p>und bitteschön:</p>
<pre class="brush: php; title: ; notranslate">

$v8 = new V8Js();
var_dump($v8-&gt;executeString(&quot;

//hey i'm Javascript Code

//INSIDE PHP !

//wow.
var hello = 'Hallo';

function helloWorld( string ){
return hello + ' ' + string;
}

helloWorld('World');

&quot;));
</pre>
<p>Such things might come in handy one day, <a href="https://plus.google.com/115423703838305233565/posts/VtskgWhB3kV">you know</a>.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2012/03/09/run-javascript-code-in-php-5-3-with-the-v8js-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverstripe &#8211; has_many- and many_many-relations when duplicating pages</title>
		<link>http://www.nerdpress.org/2012/03/07/silverstripe-has-many-and-many-many-relations-when-duplicating-pages/</link>
		<comments>http://www.nerdpress.org/2012/03/07/silverstripe-has-many-and-many-many-relations-when-duplicating-pages/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 03:48:03 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Silverstripe]]></category>
		<category><![CDATA[duplicate pages]]></category>
		<category><![CDATA[has_many]]></category>
		<category><![CDATA[many_many]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=2087</guid>
		<description><![CDATA[When you duplicate a page in the Silverstripe Sitetree, related &#8220;has_one&#8221; Items are automatically copied, which is nice. But if you have, lets say, multiple related images on that Page, those are not copied when you duplicate that Page. After reading this discussion, i found out that it&#8217;s actually pretty easy to &#8220;fix&#8221; this. This [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>When you duplicate a page in the <a href="http://www.silverstripe.org/">Silverstripe</a> Sitetree, related &#8220;has_one&#8221; Items are automatically copied, which is nice.</p>
<p>But if you have, lets say, multiple related images on that Page, those are not copied when you duplicate that Page.<span id="more-2087"></span></p>
<p>After reading <a href="http://www.silverstripe.org/data-model-questions/show/17342?start=8">this discussion</a>, i found out that it&#8217;s actually pretty easy to &#8220;fix&#8221; this.</p>
<p>This what i ended up with and seems to be working fine:</p>
<pre class="brush: php; title: ; notranslate">
//assuming your page has the following related Dataobjects

public static $has_many = array(
'Images' =&gt; 'MyImageDataObject'
);

public static $many_many = array(
'Something' =&gt; 'AnotherPageTypeOrWhatever

);
</pre>
<p>The following code would automatically duplicate the has_many related DataObjects<br />
and just set the relation to the many_many Objects on the created page:</p>
<pre><div id="gist-2014023" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">&lt;?php</span> </div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="k">public</span> <span class="k">function</span> <span class="nf">duplicate</span><span class="p">()</span> <span class="p">{</span></div><div class='line' id='LC4'>&nbsp;</div><div class='line' id='LC5'>&nbsp;&nbsp;<span class="nv">$items_to_duplicate</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="s1">&#39;Images&#39;</span><span class="p">,</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="s1">&#39;Somehting&#39;</span></div><div class='line' id='LC8'>&nbsp;&nbsp;<span class="p">);</span></div><div class='line' id='LC9'>&nbsp;</div><div class='line' id='LC10'>&nbsp;&nbsp;<span class="nv">$page</span> <span class="o">=</span> <span class="k">parent</span><span class="o">::</span><span class="na">duplicate</span><span class="p">();</span></div><div class='line' id='LC11'>&nbsp;</div><div class='line' id='LC12'>&nbsp;&nbsp;<span class="c1">//duplicate has many items</span></div><div class='line' id='LC13'>&nbsp;&nbsp;<span class="k">foreach</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">has_many</span><span class="p">()</span> <span class="k">as</span> <span class="nv">$key</span> <span class="o">=&gt;</span> <span class="nv">$className</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nb">in_array</span><span class="p">(</span><span class="nv">$key</span><span class="p">,</span> <span class="nv">$items_to_duplicate</span><span class="p">))</span> <span class="p">{</span></div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">foreach</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-&gt;</span><span class="p">{</span><span class="nv">$key</span><span class="p">}()</span> <span class="k">as</span> <span class="nv">$item</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nv">$newField</span> <span class="o">=</span> <span class="nv">$item</span><span class="o">-&gt;</span><span class="na">duplicate</span><span class="p">();</span></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nv">$id</span> <span class="o">=</span> <span class="nb">get_class</span><span class="p">(</span><span class="nv">$this</span><span class="p">)</span> <span class="o">.</span> <span class="s1">&#39;ID&#39;</span><span class="p">;</span></div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nv">$newField</span><span class="o">-&gt;</span><span class="p">{</span><span class="nv">$id</span><span class="p">}</span> <span class="o">=</span> <span class="nv">$page</span><span class="o">-&gt;</span><span class="na">ID</span><span class="p">;</span></div><div class='line' id='LC19'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nv">$newField</span><span class="o">-&gt;</span><span class="na">write</span><span class="p">();</span></div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC21'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC22'>&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC23'>&nbsp;</div><div class='line' id='LC24'>&nbsp;&nbsp;<span class="c1">//set the relation to many_many items on created page</span></div><div class='line' id='LC25'>&nbsp;&nbsp;<span class="k">foreach</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">many_many</span><span class="p">()</span> <span class="k">as</span> <span class="nv">$key</span> <span class="o">=&gt;</span> <span class="nv">$className</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC26'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nb">in_array</span><span class="p">(</span><span class="nv">$key</span><span class="p">,</span> <span class="nv">$items_to_duplicate</span><span class="p">))</span> <span class="p">{</span></div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nv">$page</span><span class="o">-&gt;</span><span class="p">{</span><span class="nv">$key</span><span class="p">}()</span><span class="o">-&gt;</span><span class="na">addMany</span><span class="p">(</span><span class="nv">$this</span><span class="o">-&gt;</span><span class="p">{</span><span class="nv">$key</span><span class="p">}()</span><span class="o">-&gt;</span><span class="na">getIdList</span><span class="p">());</span></div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC29'>&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC30'>&nbsp;</div><div class='line' id='LC31'>&nbsp;&nbsp;<span class="k">return</span> <span class="nv">$page</span><span class="p">;</span></div><div class='line' id='LC32'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2014023/9d77984e4827c16032bcc39eb270ee8be5f69c90/silverstripe_duplicate_relations.php" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2014023#file_silverstripe_duplicate_relations.php" style="float:right;margin-right:10px;color:#666">silverstripe_duplicate_relations.php</a>
            <a href="https://gist.github.com/2014023">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>
</pre>
<p>..as already suggested <a href="http://www.silverstripe.org/data-model-questions/show/17342?start=8">in the forum</a>, i still think this would make a handy core feature, wouldn&#8217;t it?<br />
Would be cool to globally specify relations to duplicate in the page-config with something like</p>
<pre class="brush: php; title: ; notranslate">
public static $relations_to_copy = array(
 'Images',
 'Somehting'
);
</pre>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2012/03/07/silverstripe-has-many-and-many-many-relations-when-duplicating-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to not cache the footer in magento</title>
		<link>http://www.nerdpress.org/2011/10/04/how-to-not-cache-the-footer-in-magento/</link>
		<comments>http://www.nerdpress.org/2011/10/04/how-to-not-cache-the-footer-in-magento/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 03:10:45 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[footer]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=1823</guid>
		<description><![CDATA[With some advanced scheduled-post-voodoo i successfully managed to publish this post already yesterday with some completely unrelated queries and no text. this was not intended &#8211; please accept my apologies :P Anyway: In the footer of my magento shop we might have a summary of the shopping cart, which i simply put in the footer.phtml [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>With some advanced scheduled-post-voodoo i successfully managed to publish this post already yesterday with some completely unrelated queries and no text. this was not intended &#8211; please accept my apologies :P</p>
<p>Anyway: In the footer of my magento shop we might have a summary of the shopping cart,<br />
which i simply put in the footer.phtml template file:<br />
<span id="more-1823"></span></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if (Mage::getModel('checkout/cart')-&gt;getItemsCount() &gt; 0): ?&gt;
  &lt;div class=&quot;footer_cart_widget&quot;&gt;
    &lt;a href=&quot;/checkout/cart&quot; class=&quot;cart&quot;&gt;
      &lt;?php echo $this-&gt;__('Warenkorb') ?&gt;:&lt;br /&gt;
      &lt;span class=&quot;cart_meta&quot;&gt;
        &lt;?php echo Mage::getModel('checkout/cart')-&gt;getItemsCount() ?&gt;
        &lt;?php if (Mage::getModel('checkout/cart')-&gt;getItemsCount() == 1): ?&gt;
          Produkt:
        &lt;?php else: ?&gt;
          Produkte:
        &lt;?php endif; ?&gt;
        &lt;?php echo $this-&gt;helper('checkout')-&gt;formatPrice(Mage::getSingleton('checkout/cart')-&gt;getQuote()-&gt;getGrandTotal()); ?&gt;
      &lt;/span&gt;
    &lt;/a&gt;
  &lt;/div&gt;
&lt;?php endif; ?&gt;
</pre>
<p><a href="http://nerdpress.org/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-04-um-21.21.05.png" rel="lightbox[post-1823]" title=""><img src="http://nerdpress.org/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-04-um-21.21.05-300x146.png" alt="Bildschirmfoto-2011-10-04-um-21 21 05-300x146 in " width="300" height="146" class="alignnone size-medium wp-image-1846" /></a></p>
<p>This means we might need to disable the caching for the footer HTML block,<br />
so that my cart summary will stay dynamically generated.</p>
<p>This is how you can do it:</p>
<p>copy</p>
<pre class="brush: bash; title: ; notranslate">app/code/core/Mage/Page/Block/Html/Footer.php</pre>
<p>to</p>
<pre class="brush: bash; title: ; notranslate">app/code/local/Mage/Page/Block/Html/Footer.php</pre>
<p>and just comment out the following lines:</p>
<pre class="brush: php; title: ; notranslate">
//$this-&gt;addData(array(
//    'cache_lifetime'=&gt; false,
//    'cache_tags'    =&gt; array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG)
//));
</pre>
<p>you could also put the cart values in the getCacheKeyInfo() method, but as this would result in caching a footer for any state of the shopping cart from my understanding, i don&#8217;t think it&#8217;s necessarily a good idea.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2011/10/04/how-to-not-cache-the-footer-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>set up magento in multiple environments</title>
		<link>http://www.nerdpress.org/2011/09/27/set-up-magento-in-multiple-environments/</link>
		<comments>http://www.nerdpress.org/2011/09/27/set-up-magento-in-multiple-environments/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 03:29:47 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[environments]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=1667</guid>
		<description><![CDATA[I just started digging in the shop software magento for a project and set up the following development environment. In this scenario development is done on two local machines while products and pages beeing already edited on the &#8220;Live&#8221;-Web-Server. Git is used for version control and deployment. Also FTP SSH. Magento is quite nice when [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>I just started digging in the shop software <a href="http://www.magentocommerce.com">magento</a> for a project and set up the following development environment.</p>
<p>In this scenario development is done on two local machines while products and pages beeing already edited on the &#8220;Live&#8221;-Web-Server.<br />
Git is used for version control and deployment. Also <del>FTP</del> SSH.<span id="more-1667"></span></p>
<p><a href="http://nerdpress.org/wp-content/uploads/2011/09/magento_sync_multiple_environments.png" rel="lightbox[post-1667]" title=""><img class="alignnone size-medium wp-image-1761" src="http://nerdpress.org/wp-content/uploads/2011/09/magento_sync_multiple_environments-300x147.png" alt="Magento Sync Multiple Environments-300x147 in " width="300" height="147" /></a></p>
<p>Magento is quite nice when it comes to deployment, as most config stuff is stored in XML files.<br />
Those files are kept locally and ignored from version control.</p>
<p>So this is what my <a href="http://stackoverflow.com/questions/4564622/best-practices-for-using-git-with-magento">.gitignore</a> looks like:</p>
<pre class="brush: bash; title: ; notranslate">
#cache, sessions, logs
/var/cache/*
/var/session/*
/var/locks/*
/var/report/*
/var/log/*
#media folder - images etc...
/media/*

#local config files
/app/etc/local.xml
.htaccess

#database dump
/database.sql
</pre>
<p>So i got a copy of the repository in each environment with a local .htaccess and local.xml file.</p>
<p>Theres a few things stored in DB by magento, though.<br />
The most obvious is the &#8220;web/secure/base_url&#8221; and &#8220;web/unsecure/base_url&#8221; which both reside in the &#8220;core_config_data&#8221; table.<br />
Those have to be set to the name of the host you&#8217;re working on.</p>
<p>This can be done with a shell script like this:</p>
<pre class="brush: bash; title: ; notranslate">

#create a dupm of the live DB on the server
ssh user@server.com 'mysqldump -u[username] -p[password] &gt; ~/db_dump.sql'

#copy DB dump to local machine
scp user@server.com:~/db_dump.sql ./database.sql

#import SQL
mysql -u[local_mysql_user] -p[local_mysql_pw] [local_db_name] &lt; ./database.sql

#update config settings in the DB
mysql -u[local_mysql_user] -p[local_mysql_pw] [local_db_name]&lt;UPDATE
core_config_data
SET value='http://local.server.com/'
WHERE value ='http://server.com';
EOFMYSQL
</pre>
<p>This way all CMS and products  can be edited on the server, while the local machines can be easily synched.<br />
For me this works fine, as we are working only in the file system in the local environment.<br />
In case you can&#8217;t use the online Server as &#8220;database master&#8221; this might be not that simple.</p>
<p>As we most likely don&#8217;t want the whole /media folder under version control we might want to have another shell script to copy the media files to the local machine (via SCP in this case):</p>
<pre class="brush: bash; title: ; notranslate">

#remove local media folder
rm -rf ./media/*
#fetch media files
scp -r ssh_user@server.com:~/magento_folder/media/* ./media
</pre>
<p>I guess this could be done more efficiently with maybe ant or something.<br />
But for the moment this works fine for me.</p>
<p>So now i can update my local environment with one line on the console:</p>
<pre class="brush: bash; title: ; notranslate">

git pull; sh sync_db.sh; sh sync_media.sh
</pre>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2011/09/27/set-up-magento-in-multiple-environments/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tilt &#8211; 3D DOM visualization</title>
		<link>http://www.nerdpress.org/2011/09/23/tilt-3d-dom-visualization/</link>
		<comments>http://www.nerdpress.org/2011/09/23/tilt-3d-dom-visualization/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 06:00:57 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[Frontend Engineering]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Addon]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[tilt]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=1722</guid>
		<description><![CDATA[someone just +1&#8242;d this nice addon for firefox: (thanks, conrad :) Tilt visualizes the DOM in 3D and is a lot faster than i expected. Although it&#8217;s flagged experimental it&#8217;s easily installed and works like a charm on my macbook with Firefox 6. Definetly makes you think twice about your markup nesting level ;)]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>someone just +1&#8242;d this nice <a title="TILT firefox addon" href="https://addons.mozilla.org/de/firefox/addon/tilt/">addon</a> for firefox:<br />
(thanks, conrad :)</p>
<p><a href="http://nerdpress.org/wp-content/uploads/2011/09/tilt_firefox_3d_dom_addon1.png" rel="lightbox[post-1722]" title=""><img class="alignnone size-medium wp-image-1725" src="http://nerdpress.org/wp-content/uploads/2011/09/tilt_firefox_3d_dom_addon1-300x160.png" alt="Tilt Firefox 3d Dom Addon1-300x160 in " width="300" height="160" /></a></p>
<p><a href="https://addons.mozilla.org/de/firefox/addon/tilt/">Tilt</a> visualizes the DOM in 3D and is a lot faster than i expected.<br />
<span id="more-1722"></span><br />
Although it&#8217;s flagged experimental it&#8217;s easily installed and works like a charm on my macbook with Firefox 6.</p>
<p>Definetly makes you think twice about your markup nesting level ;)</p>
<p><object style="height: 390px; width: 640px;" width="640" height="360" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/dW2eAbr5FBw?version=3" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><embed style="height: 390px; width: 640px;" width="640" height="360" type="application/x-shockwave-flash" src="http://www.youtube.com/v/dW2eAbr5FBw?version=3" allowFullScreen="true" allowScriptAccess="always" allowfullscreen="true" allowscriptaccess="always" /></object></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2011/09/23/tilt-3d-dom-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>install silverstripe with some modules from GIT</title>
		<link>http://www.nerdpress.org/2011/09/11/install-silverstripe-with-some-modules-from-git/</link>
		<comments>http://www.nerdpress.org/2011/09/11/install-silverstripe-with-some-modules-from-git/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 12:53:22 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Silverstripe]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[installer]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=1634</guid>
		<description><![CDATA[This is a small shell script to set up silverstripe CMS along with some modules i often use (as seen in ivo&#8217;s post) The script has two parameters: - the folder to clone the whole thing into - the branch/tag to checkout afterwards As Silverstripe itself is split up in 3 repositories (the installer/base folder, [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>This is a small shell script to set up <a href="http://www.silverstripe.org/">silverstripe CMS</a><br />
along with some modules i often use (as seen in <a href="http://nerdpress.org/2011/06/06/silverstripe-image-gallery-installation/">ivo&#8217;s post</a>)</p>
<p>The script has two parameters:<br />
- the folder to clone the whole thing into<br />
- the branch/tag to checkout afterwards</p>
<pre class="brush: bash; title: ; notranslate">
# install silverstripe + common modules from github
# usage sh install_silverstripe.sh &lt;folder_name&gt; &lt;tag/branch&gt;
# examples:
# sh install_silverstripe.sh some_folder tags/2.4.5
# sh install_silverstripe.sh some_folder master
</pre>
<p><span id="more-1634"></span></p>
<p>As Silverstripe itself is split up in 3 repositories<br />
(the installer/base folder, the cms and the sapphire framework itself)<br />
we fetch the base folder first:</p>
<pre class="brush: bash; title: ; notranslate">
#set up project base folder
git clone git@github.com:silverstripe/silverstripe-installer.git $1
cd $1
git checkout $2
</pre>
<p>Get the cms</p>
<pre class="brush: bash; title: ; notranslate">
#setup cms
git clone git@github.com:silverstripe/silverstripe-cms.git cms
cd cms
git checkout $2
cd ..
</pre>
<p>Get sapphire &#8230;</p>
<pre class="brush: bash; title: ; notranslate">
#setup framework
git clone git@github.com:silverstripe/sapphire.git sapphire
cd sapphire
git checkout $2
cd ..
</pre>
<p>Setup some permissions for the web installer.</p>
<pre class="brush: bash; title: ; notranslate">
#set permissions for install
chmod 0777 assets assets/*
chmod 0666 .htaccess mysite/_config.php assets/*/*
</pre>
<p>Fetch the blackcandy theme from a fourth repository.<br />
Backup the tutorial theme in case we need it.</p>
<pre class="brush: bash; title: ; notranslate">
#install blackcandy theme
mv themes/tutorial ./
rm -rf themes
git clone https://github.com/silverstripe-themes/silverstripe-blackcandy.git themes
cd themes
git checkout $2
cd ..
mv tutorial themes
</pre>
<p>Install some modules</p>
<pre class="brush: bash; title: ; notranslate">
# install common modules
git clone https://github.com/unclecheese/Uploadify.git uploadify
git clone https://github.com/unclecheese/DataObjectManager.git dataobject_manager
git clone https://github.com/silverstripe/silverstripe-userforms.git userforms
</pre>
<p><strong>iIput the script <a href="https://gist.github.com/1209496">on github</a></strong><br />
&#8230;in case you might wanna use it or add something i&#8217;ve missed.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2011/09/11/install-silverstripe-with-some-modules-from-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>install lame on debian lenny</title>
		<link>http://www.nerdpress.org/2011/06/20/install-lame-on-debian-lenny/</link>
		<comments>http://www.nerdpress.org/2011/06/20/install-lame-on-debian-lenny/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 11:09:32 +0000</pubDate>
		<dc:creator>Max Girkens</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[vServer]]></category>
		<category><![CDATA[debian lenny]]></category>
		<category><![CDATA[lame]]></category>

		<guid isPermaLink="false">http://nerdpress.org/?p=1528</guid>
		<description><![CDATA[If you are going to install the mp3 en/decoder lame on debian lenny, this is how i got it done: choose your package: http://debian-multimedia.org/pool/main/l/lame/ yay!]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>If you are going to install the mp3 en/decoder lame on debian lenny,<br />
this is how i got it done:</p>
<p>choose your package: <a href="http://debian-multimedia.org/pool/main/l/lame/">http://debian-multimedia.org/pool/main/l/lame/</a></p>
<pre class="brush: bash; title: ; notranslate">
wget http://debian-multimedia.org/pool/main/l/lame/lame_3.98.2-0.4_i386.deb
dpkg -i lame_3.98.2-0.4_i386.deb
</pre>
<p>yay!</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.nerdpress.org/2011/06/20/install-lame-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

