<?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>StuntCoders</title>
	<atom:link href="http://stuntsnippets.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuntsnippets.com</link>
	<description></description>
	<lastBuildDate>Mon, 15 Apr 2013 16:04:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Magento: force redirect to 404</title>
		<link>http://stuntsnippets.com/magento/magento-force-redirect-to-404/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=magento-force-redirect-to-404</link>
		<comments>http://stuntsnippets.com/magento/magento-force-redirect-to-404/#comments</comments>
		<pubDate>Mon, 15 Apr 2013 16:04:18 +0000</pubDate>
		<dc:creator>storm.earth.fire</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1227</guid>
		<description><![CDATA[If you ever find a need to, as a result of your custom action, display the 404 page to customer, you can do it by using the following code inside your controller class 1 2 3 $this-&#62;getResponse&#40;&#41;-&#62;setHeader&#40;'HTTP/1.1','404 Not Found'&#41;; $this-&#62;getResponse&#40;&#41;-&#62;setHeader&#40;'Status','404 File not found'&#41;; $this-&#62;_forward&#40;'defaultNoRoute'&#41;; This way you&#8217;ll be calling the default Magento dispatcher and it [...]]]></description>
				<content:encoded><![CDATA[<p>If you ever find a need to, as a result of your custom action, display the 404 page to customer, you can do it by using the following code inside your controller class</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HTTP/1.1'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'404 Not Found'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Status'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'404 File not found'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_forward<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'defaultNoRoute'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This way you&#8217;ll be calling the default Magento dispatcher and it will set the 404 headers and display the 404 page you set as a default 404 page in your Magento admin.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/magento/magento-force-redirect-to-404/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/magento/magento-force-redirect-to-404/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if process is running on Linux</title>
		<link>http://stuntsnippets.com/ssh-linux/check-if-process-is-running-on-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=check-if-process-is-running-on-linux</link>
		<comments>http://stuntsnippets.com/ssh-linux/check-if-process-is-running-on-linux/#comments</comments>
		<pubDate>Sat, 02 Mar 2013 12:02:39 +0000</pubDate>
		<dc:creator>dejan.jacimovic</dc:creator>
				<category><![CDATA[SSH/Linux]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1216</guid>
		<description><![CDATA[If you&#8217;d like to check if process is running on Linux OS, you can do it by using code from following snippet: command = &#34;sidekiq&#34; running = `ps ax &#124; grep -v grep &#124; grep $command &#124; wc -l` &#160; if &#91;running -gt 0&#93;; then echo &#34;Sidekiq is running!&#34; else echo &#34;Sidekiq is not running...&#34; [...]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;d like to <strong>check if process is running on Linux</strong> OS, you can do it by using code from following snippet:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">command</span> = <span style="color: #ff0000;">&quot;sidekiq&quot;</span>
running = <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ps</span> ax <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #007800;">$command</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>running <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Sidekiq is running!&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Sidekiq is not running...&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/ssh-linux/check-if-process-is-running-on-linux/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/ssh-linux/check-if-process-is-running-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Registry check if key exists</title>
		<link>http://stuntsnippets.com/php/zend-registry-check-if-key-exists/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zend-registry-check-if-key-exists</link>
		<comments>http://stuntsnippets.com/php/zend-registry-check-if-key-exists/#comments</comments>
		<pubDate>Sat, 16 Feb 2013 21:39:51 +0000</pubDate>
		<dc:creator>dejan.jacimovic</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1209</guid>
		<description><![CDATA[To check if Zend_Registry key exists, you should simply use following snippet: 1 2 3 4 5 if&#40;Zend_Registry::isRegistered&#40;'my_key'&#41;&#41; &#123; echo 'Zend Registry key exists, and value is: ' . Zend_Registry::get&#40;'my_key'&#41;; &#125; else &#123; echo 'Zend Registry key does not exist.'; &#125;]]></description>
				<content:encoded><![CDATA[<p>To check if Zend_Registry key exists, you should simply use following snippet:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>Zend_Registry<span style="color: #339933;">::</span><span style="color: #004000;">isRegistered</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'my_key'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Zend Registry key exists, and value is: '</span> <span style="color: #339933;">.</span> Zend_Registry<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'my_key'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Zend Registry key does not exist.'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/php/zend-registry-check-if-key-exists/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/php/zend-registry-check-if-key-exists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Run Rails server in production mode</title>
		<link>http://stuntsnippets.com/rails/run-rails-server-in-production-mode/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=run-rails-server-in-production-mode</link>
		<comments>http://stuntsnippets.com/rails/run-rails-server-in-production-mode/#comments</comments>
		<pubDate>Thu, 18 Oct 2012 09:00:09 +0000</pubDate>
		<dc:creator>dejan.jacimovic</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1194</guid>
		<description><![CDATA[In order to run Rails server in production mode, you need to use following line: 1 rails s -e production However, please notice that Rails assumes that you have your files precompiled for production environment. If you want to change this and have compiling during runtime in production you must change config.assets.compile in config/environments/production.rb to [...]]]></description>
				<content:encoded><![CDATA[<p>In order to run Rails server in production mode, you need to use following line:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">rails s <span style="color:#006600; font-weight:bold;">-</span>e production</pre></td></tr></table></div>

<p>However, please notice that Rails assumes that you have your files precompiled for production environment. If you want to change this and have compiling during runtime in production you must change config.assets.compile in config/environments/production.rb to following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">config.<span style="color:#9900CC;">assets</span>.<span style="color:#9900CC;">compile</span> = <span style="color:#0000FF; font-weight:bold;">true</span></pre></td></tr></table></div>

<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/rails/run-rails-server-in-production-mode/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/rails/run-rails-server-in-production-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrate production</title>
		<link>http://stuntsnippets.com/rails/rake-migrate-production/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rake-migrate-production</link>
		<comments>http://stuntsnippets.com/rails/rake-migrate-production/#comments</comments>
		<pubDate>Wed, 17 Oct 2012 19:04:15 +0000</pubDate>
		<dc:creator>dejan.jacimovic</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[migrate]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1192</guid>
		<description><![CDATA[Rake migrate doesn’t detect the current environment once you setup app on your production server, so in order to run it with proper profile, you can do following: rake db:migrate RAILS_ENV=&#34;production&#34;]]></description>
				<content:encoded><![CDATA[<p>Rake migrate doesn’t detect the current environment once you setup app on your production server, so in order to run it with proper profile, you can do following:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">rake db:migrate RAILS_ENV=<span style="color:#996600;">&quot;production&quot;</span></pre></td></tr></table></div>

<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/rails/rake-migrate-production/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/rails/rake-migrate-production/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the array of all attribute options in Magento</title>
		<link>http://stuntsnippets.com/magento/get-the-array-of-all-attribute-options-in-magento/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-the-array-of-all-attribute-options-in-magento</link>
		<comments>http://stuntsnippets.com/magento/get-the-array-of-all-attribute-options-in-magento/#comments</comments>
		<pubDate>Thu, 11 Oct 2012 09:00:30 +0000</pubDate>
		<dc:creator>storm.earth.fire</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[fetch]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1058</guid>
		<description><![CDATA[Suppose you want to display all the attributes of one product. You can easily get the id of the value by call the unversal method 1 $attributeValueId = $_product-&#62;getResource&#40;&#41;-&#62;getColor&#40;&#41;; where color is the name of the attribute. If you&#8217;ve already loaded the whole product into the variable $_product then you don&#8217;t need the getResource() part. [...]]]></description>
				<content:encoded><![CDATA[<p>Suppose you want to display all the attributes of one product. You can easily get the id of the value by call the unversal method</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$attributeValueId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResource</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getColor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>where <b>color</b> is the name of the attribute. If you&#8217;ve already loaded the whole product into the variable $_product then you don&#8217;t need the getResource() part. Also, attributes should be named with lowcase letters, and their respectful methods are formed with the prefix get and capital first letter, but if you have two-word named attribute (for example <b>my_attribute</b> &#8211; remember, no whitespaces in the object names in Magento!) then you could get it with the method getMyAttribute() which follows the standard Zend naming convention.</p>
<p>Now, in order to display je value meaningful to the user, and not just the id, you can fetch all the values into the associative array</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$attribute</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'eav/config'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog_product'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'color'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$attribute</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSource</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAllOptions</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$instance</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$myArray</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'label'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>and simply use it in your display!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$idOfTheProduct</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$attributeValueId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getColor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'This shirt is '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$myArray</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$attributeValueId</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/magento/get-the-array-of-all-attribute-options-in-magento/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/magento/get-the-array-of-all-attribute-options-in-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BitNami restart Apache</title>
		<link>http://stuntsnippets.com/ssh-linux/bitnami-restart-apache/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bitnami-restart-apache</link>
		<comments>http://stuntsnippets.com/ssh-linux/bitnami-restart-apache/#comments</comments>
		<pubDate>Wed, 10 Oct 2012 08:09:41 +0000</pubDate>
		<dc:creator>dejan.jacimovic</dc:creator>
				<category><![CDATA[SSH/Linux]]></category>
		<category><![CDATA[BitNami]]></category>
		<category><![CDATA[restart Apache]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1182</guid>
		<description><![CDATA[So &#8211; you have a BitNami stack on your server, and would like to restart Apache? There is a simple way to restart apache on your BitNami installation. Just use a following snippet. BitNami restart Apache: sudo /opt/bitnami/ctlscript.sh restart apache]]></description>
				<content:encoded><![CDATA[<p>So &#8211; you have a BitNami stack on your server, and would like to restart Apache?</p>
<p>There is a simple way to restart apache on your BitNami installation. Just use a following snippet.</p>
<p><strong>BitNami restart Apache</strong>:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ssh" style="font-family:monospace;">sudo /opt/bitnami/ctlscript.sh restart apache</pre></td></tr></table></div>

<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/ssh-linux/bitnami-restart-apache/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/ssh-linux/bitnami-restart-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento load product by SKU</title>
		<link>http://stuntsnippets.com/magento/magento-load-product-by-sku/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=magento-load-product-by-sku</link>
		<comments>http://stuntsnippets.com/magento/magento-load-product-by-sku/#comments</comments>
		<pubDate>Sun, 02 Sep 2012 09:00:45 +0000</pubDate>
		<dc:creator>dejan.jacimovic</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[load product]]></category>
		<category><![CDATA[magento load product by sku]]></category>
		<category><![CDATA[sku]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1179</guid>
		<description><![CDATA[Sometimes you need to get product by its attribute SKU. To do this, you can simply use following snippet and you will have Magento to load product by SKU. $productSku = 'my-product-sku'; $_product = Mage::getModel&#40;'catalog/product'&#41;-&#62;load&#40;$productSku, 'sku'&#41;;]]></description>
				<content:encoded><![CDATA[<p>Sometimes you need to get product by its attribute SKU. To do this, you can simply use following snippet and you will have <strong>Magento</strong> to <strong>load product by SKU</strong>.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$productSku</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'my-product-sku'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_product</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/product'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$productSku</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sku'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/magento/magento-load-product-by-sku/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/magento/magento-load-product-by-sku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento reset admin password</title>
		<link>http://stuntsnippets.com/magento/magento-reset-admin-password/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=magento-reset-admin-password</link>
		<comments>http://stuntsnippets.com/magento/magento-reset-admin-password/#comments</comments>
		<pubDate>Sat, 04 Aug 2012 15:49:54 +0000</pubDate>
		<dc:creator>dejan.jacimovic</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Magento reset admin password]]></category>
		<category><![CDATA[reset admin password]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1172</guid>
		<description><![CDATA[It happens from time to time to forget Magento admin password. When it happens you should be able to recover from it with no problems. Use this simple MySQL script to reset admin password in Magento. Magento reset admin password: UPDATE admin_user SET password=CONCAT&#40;MD5&#40;'random_stringyour_new_password'&#41;, ':random_string'&#41; WHERE username='admin';]]></description>
				<content:encoded><![CDATA[<p>It happens from time to time to forget Magento admin password. When it happens you should be able to recover from it with no problems. Use this simple MySQL script to <strong>reset admin password</strong> in Magento.</p>
<p><strong>Magento reset admin password</strong>:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> admin_user
<span style="color: #990099; font-weight: bold;">SET</span> <span style="color: #000099;">password</span><span style="color: #CC0099;">=</span><span style="color: #000099;">CONCAT</span><span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">MD5</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'random<span style="color: #008080; font-weight: bold;">_</span>stringyour<span style="color: #008080; font-weight: bold;">_</span>new<span style="color: #008080; font-weight: bold;">_</span>password'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> <span style="color: #008000;">':random<span style="color: #008080; font-weight: bold;">_</span>string'</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">WHERE</span> username<span style="color: #CC0099;">=</span><span style="color: #008000;">'admin'</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/magento/magento-reset-admin-password/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/magento/magento-reset-admin-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Display template path hints in admin</title>
		<link>http://stuntsnippets.com/magento/magento-display-template-path-hints-in-admin/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=magento-display-template-path-hints-in-admin</link>
		<comments>http://stuntsnippets.com/magento/magento-display-template-path-hints-in-admin/#comments</comments>
		<pubDate>Thu, 14 Jun 2012 12:35:30 +0000</pubDate>
		<dc:creator>storm.earth.fire</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[hints]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://stuntsnippets.com/?p=1165</guid>
		<description><![CDATA[Can be easily activated through couple of SQL queries. First time you can enable it by running INSERT INTO core_config_data &#40;scope, scope_id, path, value&#41; VALUES &#40;'default', 0, 'dev/debug/template_hints', 1&#41;, &#40;'default', 0, 'dev/debug/template_hints_blocks', 1&#41;; If you want to disable it, just run UPDATE core_config_data SET value = 0 WHERE scope = 'default' AND scope_id = 0 [...]]]></description>
				<content:encoded><![CDATA[<p>Can be easily activated through couple of SQL queries.</p>
<p>First time you can enable it by running</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">INTO</span> core_config_data <span style="color: #FF00FF;">&#40;</span>scope<span style="color: #000033;">,</span> scope_id<span style="color: #000033;">,</span> path<span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">value</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">VALUES</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'default'</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span> <span style="color: #008000;">'dev/debug/template<span style="color: #008080; font-weight: bold;">_</span>hints'</span><span style="color: #000033;">,</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
<span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'default'</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span> <span style="color: #008000;">'dev/debug/template<span style="color: #008080; font-weight: bold;">_</span>hints<span style="color: #008080; font-weight: bold;">_</span>blocks'</span><span style="color: #000033;">,</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>If you want to disable it, just run</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> core_config_data <span style="color: #990099; font-weight: bold;">SET</span> <span style="color: #990099; font-weight: bold;">value</span> <span style="color: #CC0099;">=</span> <span style="color: #008080;">0</span> <span style="color: #990099; font-weight: bold;">WHERE</span> scope <span style="color: #CC0099;">=</span> <span style="color: #008000;">'default'</span> <span style="color: #CC0099; font-weight: bold;">AND</span> scope_id <span style="color: #CC0099;">=</span> <span style="color: #008080;">0</span> <span style="color: #CC0099; font-weight: bold;">AND</span> path <span style="color: #990099; font-weight: bold;">in</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'dev/debug/template<span style="color: #008080; font-weight: bold;">_</span>hints'</span><span style="color: #000033;">,</span><span style="color: #008000;">'dev/debug/template<span style="color: #008080; font-weight: bold;">_</span>hints<span style="color: #008080; font-weight: bold;">_</span>blocks'</span><span style="color: #FF00FF;">&#41;</span></pre></td></tr></table></div>

<p>And if you want to enable it again, run</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> core_config_data <span style="color: #990099; font-weight: bold;">SET</span> <span style="color: #990099; font-weight: bold;">value</span> <span style="color: #CC0099;">=</span> <span style="color: #008080;">1</span> <span style="color: #990099; font-weight: bold;">WHERE</span> scope <span style="color: #CC0099;">=</span> <span style="color: #008000;">'default'</span> <span style="color: #CC0099; font-weight: bold;">AND</span> scope_id <span style="color: #CC0099;">=</span> <span style="color: #008080;">0</span> <span style="color: #CC0099; font-weight: bold;">AND</span> path <span style="color: #990099; font-weight: bold;">in</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'dev/debug/template<span style="color: #008080; font-weight: bold;">_</span>hints'</span><span style="color: #000033;">,</span><span style="color: #008000;">'dev/debug/template<span style="color: #008080; font-weight: bold;">_</span>hints<span style="color: #008080; font-weight: bold;">_</span>blocks'</span><span style="color: #FF00FF;">&#41;</span></pre></td></tr></table></div>

<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://stuntsnippets.com/magento/magento-display-template-path-hints-in-admin/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://stuntsnippets.com/magento/magento-display-template-path-hints-in-admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
