<?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>Welling Guzman</title>
	<atom:link href="http://wellingguzman.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wellingguzman.com</link>
	<description>Web &#38; Software Developer</description>
	<lastBuildDate>Sat, 06 Sep 2014 08:29:34 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.2</generator>
	<item>
		<title>Learn the proper names</title>
		<link>http://wellingguzman.com/writing/learn-proper-names/</link>
		<comments>http://wellingguzman.com/writing/learn-proper-names/#comments</comments>
		<pubDate>Tue, 02 Sep 2014 07:35:24 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[TIL]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=443</guid>
		<description><![CDATA[<p>Someone asked me if I knew what Lambdas was, and quickly I answered: “I’ve heard that word before, but really don’t know what it is”. It turned out that I do knew what it was, just didn’t know it was called Lambdas, for me Lambdas was a shiny Ruby only feature or something. But Lambdas [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/learn-proper-names/">Learn the proper names</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Someone asked me if I knew what Lambdas was, and quickly I answered: “I’ve heard that word before, but really don’t know what it is”.</p>

<p>It turned out that I do knew what it was, just didn’t know it was called Lambdas, for me Lambdas was a shiny Ruby only feature or something. But Lambdas are Anonymous functions, I use it everyday without knowing it was also called Lambdas.</p><p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/learn-proper-names/">Learn the proper names</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/learn-proper-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to type ß (Eszett) on Mac OS</title>
		<link>http://wellingguzman.com/writing/type-s-eszett-mac-os/</link>
		<comments>http://wellingguzman.com/writing/type-s-eszett-mac-os/#comments</comments>
		<pubDate>Tue, 02 Sep 2014 01:35:07 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Sin categoría]]></category>
		<category><![CDATA[German]]></category>
		<category><![CDATA[Language]]></category>
		<category><![CDATA[TIL]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=428</guid>
		<description><![CDATA[<p>How to type this ß (Eszett) or weird-looking &#8220;B&#8221; as I knew it before in Mac and iPhone. Mac OS the &#8220;s&#8221; needs to be lowercase alt/option/⌥ + s iOS Using the German Keyboard: here is how to add new keyboards hold down &#34;s&#34; and choose it from the list This is how it&#8217;s going [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/type-s-eszett-mac-os/">How to type ß (Eszett) on Mac OS</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>How to type this ß (Eszett) or weird-looking &#8220;B&#8221; as I knew it before in Mac and iPhone.</p>

<span id="more-428"></span>

<h2>Mac OS</h2>
<p>the &#8220;s&#8221; needs to be lowercase</p>
<div class="highlight highlight-text"><pre><code>alt/option/⌥ + s</code></pre></div>

<h2>iOS</h2>
<p>Using the German Keyboard: <a href="http://support.apple.com/kb/HT4509" target="_blank">here is how to add new keyboards</a></p>
<div class="highlight highlight-text"><pre><code>hold down &quot;s&quot; and choose it from the list
</code></pre></div>

<p>This is how it&#8217;s going to look if you hold down the key on a uppercase &#8220;S&#8221;</p>
<p><img src="http://wellingguzman.com/uploads/2014/09/Eszett-uppercase.jpg"></p>

<p>Here is if you hold down lowercase &#8220;s&#8221;</p>
<p><img src="http://wellingguzman.com/uploads/2014/09/Eszett-lowercase.jpg"></p>

<p>Why is this weird-looking &#8220;B&#8221; under &#8220;s&#8221; instead of &#8220;B&#8221;, well in fact it is because is an actual &#8220;long s&#8221; sound, also called sharp s.</p>


<h2>What am I doing with this?</h2>
<p>I started to seriously learn German, well, using Duolingo, Duolingo-serious, and while I have been using the app it never gave me a wrong answer using &#8220;u&#8221; instead of &#8220;ü&#8221; or &#8220;b/B&#8221; instead of &#8220;ß&#8221;, but it started to giving me this as a wrong answer.</p>

<p><img src="http://wellingguzman.com/uploads/2014/09/sub.jpg"><p>

<p><em>Notice the lowercase &#8220;s&#8221; in Schokolade.</em></p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/type-s-eszett-mac-os/">How to type ß (Eszett) on Mac OS</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/type-s-eszett-mac-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Post Slug collapse with Page Slug in WordPress</title>
		<link>http://wellingguzman.com/writing/custom-post-slug-collapse-page-slug-wordpress/</link>
		<comments>http://wellingguzman.com/writing/custom-post-slug-collapse-page-slug-wordpress/#comments</comments>
		<pubDate>Fri, 01 Aug 2014 07:37:32 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=408</guid>
		<description><![CDATA[<p>Changing permalink on WordPress it&#8217;s never, well at least it never gave me any headache, but when I change /blog/%postname%/ to just /%postname%/ some pages fell apart, and I was blaming the .htaccess, deleting it, recreating, let WordPress rebuild it, did a flush_rewrite_rules(); and nothing was fixed. Then I notice it was all the custom [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/custom-post-slug-collapse-page-slug-wordpress/">Custom Post Slug collapse with Page Slug in WordPress</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Changing permalink on WordPress it&#8217;s never, well at least it never gave me any headache, but when I change <code>/blog/%postname%/</code> to just <code>/%postname%/</code> some pages fell apart, and I was blaming the <code>.htaccess</code>, deleting it, recreating, let WordPress rebuild it, did a <code>flush_rewrite_rules();</code> and nothing was fixed. Then I notice it was all the custom post slug that matches the page slug.</p>

<p>The site had three custom post, <strong>Films</strong>, <strong>Stories</strong>, <strong>Galleries</strong>, also for each custom post there is a page with the same name and slug which had a custom template, but I enter to <code>thesite.com/films</code>, <code>thesite.com/stories</code> or <code>thesite.com/galleries</code> it did not serve the right template, so I change <code>thesite.com/films</code> to <code>thesite.com/filmz</code> and it did work and serve the right template.</p>

<p>By seeing this behavior it has to be the custom post and his rewrite fault, this is part of the custom post:</p>

<div class="highlight highlight-php"><pre><code><span class="s1">&#39;public&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">,</span>
<span class="s1">&#39;show_ui&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">,</span>
<span class="s1">&#39;has_archive&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">,</span>
<span class="s1">&#39;publicly_queryable&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">,</span>
<span class="s1">&#39;show_in_nav_menus&#39;</span> <span class="o">=&gt;</span> <span class="k">false</span><span class="p">,</span>
<span class="s1">&#39;exclude_from_search&#39;</span> <span class="o">=&gt;</span> <span class="k">false</span><span class="p">,</span>
<span class="s1">&#39;hierarchical&#39;</span> <span class="o">=&gt;</span> <span class="k">false</span><span class="p">,</span>
<span class="s1">&#39;menu_position&#39;</span> <span class="o">=&gt;</span> <span class="mi">20</span><span class="p">,</span>
<span class="s1">&#39;rewrite&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;slug&#39;</span><span class="o">=&gt;</span><span class="s1">&#39;films&#39;</span><span class="p">),</span>
<span class="s1">&#39;supports&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;title&#39;</span><span class="p">,</span> <span class="s1">&#39;thumbnail&#39;</span><span class="p">),</span>
<span class="s1">&#39;show_in_nav_menus&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span>
</code></pre></div>

<p>There is three solution to this:</p>

<h3>Solution #1</h3>
<p>Change the slug, but this is a wrong solution if you already had theses indexed.</p>

<h3>Solution #2</h3>
<p>Change <code>'has_archive'=> true</code> to <code>false</code> and the <code>/films</code> would be ignore by the custom post.</p>

<h3>Solution #3</h3>
<p>Do not use the custom page, and customize the <code>archive-{$post_type}.php</code> file and forget about the specific page for each one.</p><p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/custom-post-slug-collapse-page-slug-wordpress/">Custom Post Slug collapse with Page Slug in WordPress</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/custom-post-slug-collapse-page-slug-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAMP MySQL Problem</title>
		<link>http://wellingguzman.com/writing/mamp-mysql-problem/</link>
		<comments>http://wellingguzman.com/writing/mamp-mysql-problem/#comments</comments>
		<pubDate>Sat, 19 Jul 2014 19:47:19 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Node JS]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=401</guid>
		<description><![CDATA[<p>Using the library node-mysql I found myself with an error that refused my node app to connect to an MySQL Database or in fact the server itself. At first I blame the library, searching and searching and I didn&#8217;t find any solution that leads me to fix error. Every time I tried a connection I [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/mamp-mysql-problem/">MAMP MySQL Problem</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Using the library <a href="https://github.com/felixge/node-mysql" target="_blank">node-mysql</a> I found myself with an error that refused my node app to connect to an MySQL Database or in fact the server itself. At first I blame the library, searching and searching and I didn&#8217;t find any solution that leads me to fix error. Every time I tried a connection I always get the error : <code>Error: connect ECONNREFUSED</code>.</p>

<div class="highlight highlight-javascript"><pre><code><span class="kd">var</span> <span class="nx">mysql</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;mysql&#39;</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">connection</span> <span class="o">=</span> <span class="nx">mysql</span><span class="p">.</span><span class="nx">createConnection</span><span class="p">({</span>
  <span class="nx">host</span>     <span class="o">:</span> <span class="s1">&#39;localhost&#39;</span><span class="p">,</span>
  <span class="nx">user</span>     <span class="o">:</span> <span class="s1">&#39;root&#39;</span><span class="p">,</span>
  <span class="nx">password</span> <span class="o">:</span> <span class="s1">&#39;123&#39;</span>
<span class="p">});</span>

<span class="nx">connection</span><span class="p">.</span><span class="nx">connect</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
  <span class="k">if</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">&#39;error connecting: &#39;</span> <span class="o">+</span> <span class="nx">err</span><span class="p">.</span><span class="nx">stack</span><span class="p">);</span>
    <span class="k">return</span><span class="p">;</span>
  <span class="p">}</span>

  <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;connected as id &#39;</span> <span class="o">+</span> <span class="nx">connection</span><span class="p">.</span><span class="nx">threadId</span><span class="p">);</span>
<span class="p">});</span>
</code></pre></div>

<p>So I wrote and <a href="https://github.com/felixge/node-mysql/issues/874" target="_blank">issue</a> and it was not a library issue, it was MAMP&#8217;s MySQL bad configuration. There is two thing that can resolve this problem:</p>

<h2>Solution #1</h2>
<p>On MAMP disable <code>Allow local access only</code>.</p>

<h2>Solution #2</h2>
<p>run <code>mysql_config --socket</code> in the terminal and use the output as <code>socketPath</code> value
<div class="highlight highlight-sh"><pre><code><span class="nv">$ </span>mysql_config --socket
/tmp/mysql.sock
</code></pre></div>

<p>Probably when you run <code>mysql_config</code> it would says:
<div class="highlight highlight-guess"><pre><code><span class="o">-</span><span class="n">bash</span><span class="o">:</span> <span class="n">mysql_config</span><span class="o">:</span> <span class="n">command</span> <span class="n">not</span> <span class="n">found</span>
</code></pre></div>

<p>In MAMP is located in: <code>/Applications/MAMP/Library/bin/mysql_config</code> so it would be: </p>
<div class="highlight highlight-sh"><pre><code><span class="nv">$ </span>/Applications/MAMP/Library/bin/mysql_config --socket
/tmp/mysql.sock
</code></pre></div>

<p>You can use alias or export to make this long path short.</p>

<div class="highlight highlight-javascript"><pre><code><span class="kd">var</span> <span class="nx">connection</span> <span class="o">=</span> <span class="nx">mysql</span><span class="p">.</span><span class="nx">createConnection</span><span class="p">({</span>
  <span class="nx">socketPath</span> <span class="o">:</span> <span class="s1">&#39;/tmp/mysql.sock&#39;</span><span class="p">,</span>
  <span class="nx">host</span>     <span class="o">:</span> <span class="s1">&#39;localhost&#39;</span><span class="p">,</span>
  <span class="nx">user</span>       <span class="o">:</span> <span class="s1">&#39;root&#39;</span><span class="p">,</span>
  <span class="nx">password</span>   <span class="o">:</span> <span class="s1">&#39;123&#39;</span>
<span class="p">});</span>
</code></pre></div>

<p>Hope it solve you an issue or help you in anyway.</p><p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/mamp-mysql-problem/">MAMP MySQL Problem</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/mamp-mysql-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress functionality in another PHP Project</title>
		<link>http://wellingguzman.com/writing/wordpress-functionality-another-php-project/</link>
		<comments>http://wellingguzman.com/writing/wordpress-functionality-another-php-project/#comments</comments>
		<pubDate>Tue, 13 May 2014 16:58:01 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Sin categoría]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=343</guid>
		<description><![CDATA[<p>I&#8217;m working on a Project using Laravel and I need to pull all the blog post from a WordPress site that is already on the same server. To do this and have the power of WordPress into another project, add the WordPress wp-load.php file. $wordPressPath = &#39;/wordpress/path/wp-load.php&#39;; require $wordPressPath; $args = array( &#39;posts_per_page&#39; =&#62; 5, [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/wordpress-functionality-another-php-project/">WordPress functionality in another PHP Project</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m working on a Project using Laravel and I need to pull all the blog post from a WordPress site that is already on the same server.</p>
<span id="more-343"></span>

<p>To do this and have the power of  WordPress into another project, add the WordPress <code>wp-load.php</code> file.

<div class="highlight highlight-php"><pre><code><span class="nv">$wordPressPath</span> <span class="o">=</span> <span class="s1">&#39;/wordpress/path/wp-load.php&#39;</span><span class="p">;</span>
<span class="k">require</span> <span class="nv">$wordPressPath</span><span class="p">;</span>

<span class="nv">$args</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;posts_per_page&#39;</span>   <span class="o">=&gt;</span> <span class="mi">5</span><span class="p">,</span>
        <span class="s1">&#39;orderby&#39;</span>          <span class="o">=&gt;</span> <span class="s1">&#39;post_date&#39;</span><span class="p">,</span>
        <span class="s1">&#39;order&#39;</span>            <span class="o">=&gt;</span> <span class="s1">&#39;DESC&#39;</span><span class="p">,</span>
        <span class="s1">&#39;post_type&#39;</span>        <span class="o">=&gt;</span> <span class="s1">&#39;post&#39;</span><span class="p">,</span>
        <span class="s1">&#39;post_status&#39;</span>      <span class="o">=&gt;</span> <span class="s1">&#39;publish&#39;</span>
      <span class="p">);</span>

<span class="nv">$posts</span> <span class="o">=</span> <span class="nx">get_posts</span><span class="p">(</span> <span class="nv">$args</span> <span class="p">);</span>
</code></pre></div>

<p>Something that could happen is that you have a function/class with the same name as WordPress has and this would thrown a function/class redeclaration error.

<p>But aside from this, works perfect.</p><p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/wordpress-functionality-another-php-project/">WordPress functionality in another PHP Project</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/wordpress-functionality-another-php-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subdomain on a different server</title>
		<link>http://wellingguzman.com/writing/subdomain-different-server/</link>
		<comments>http://wellingguzman.com/writing/subdomain-different-server/#comments</comments>
		<pubDate>Tue, 13 May 2014 02:31:30 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Sin categoría]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=332</guid>
		<description><![CDATA[<p>I want to develop my first Node.js applications and host it as subdomain, but this server (shared on hostgator) does not support Node.js applications, and for a second I thought if I need to change server only for this?. But nope, there is a solution for this. What I want Host a Nodejs application in [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/subdomain-different-server/">Subdomain on a different server</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>I want to develop my first Node.js applications and host it as subdomain, but this server (shared on hostgator) does not support Node.js applications, and for a second I thought if I need to change server only for this?. But nope, there is a solution for this.</p>

<span id="more-332"></span>

<h2>What I want</h2>
<ul>
<li><p>Host a Nodejs application in subdomain (<em>subdomain.wellingguzman.com</em>) on a server that does not support nodejs.</p></li>
<li><p>Keep it like if it was hosted on the same server.</p></li>
</ul>


<h2>Solution</h2>

<ol>
<li><p>Go to your hosting provider, and look for <strong>DNS Zone</strong>, on <strong>hostgator</strong> is under domains tab.</p>
<p><img src="http://wellingguzman.com/uploads/2014/05/zonadns.jpg" alt="zonadns" class="alignnone size-full wp-image-335" /></p>
</li>

<li><p><strong>Add a Record</strong>, put the <strong>Name</strong> of the host, or subdomain (<em>subdomain.wellingguzman.com</em>), there is possible two types you would need, type <strong>A</strong> or <strong>CNAME</strong>. If you want to point to an IP you need a type <strong>A</strong>, but if you want to point to a domain/subdomain you need <strong>CNAME</strong>.</p>

<p>On <em>Address</em>/<em>CNAME</em> put the server&#8217;s IP or subdomain, in my case the app is hosted on <strong>OpenShift</strong> and the CNAME would be something like <em>nodejs-welling.rhcloud.com</em>. </p>

<p><strong>TTL</strong> is <em>Time to Live</em>, amount of seconds the record cache would last.</p>

<p><img src="http://wellingguzman.com/uploads/2014/05/dnszone-filled.jpg" alt="dnszone-filled" class="alignnone size-full wp-image-339" /></p>

</li>
</ol>

<p>This would do the trick, and every time <em>subdomain.wellingguzman.com</em> is typed it would request <em>nodejs-welling.rhcloud.com</em>.</p><p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/subdomain-different-server/">Subdomain on a different server</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/subdomain-different-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Control WordPress 404 Error</title>
		<link>http://wellingguzman.com/writing/control-wordpress-404-error/</link>
		<comments>http://wellingguzman.com/writing/control-wordpress-404-error/#comments</comments>
		<pubDate>Tue, 21 Jan 2014 04:56:04 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=177</guid>
		<description><![CDATA[<p>I have site built with WordPress and I wanted to catch all 404 page that WordPress try to display and make my own custom 404 page depending on the requested page, or in fact I just wanted to whether or not show a 404 page. If the user, let&#8217;s say, go to http://mysite.com/someword on mysite, [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/control-wordpress-404-error/">Control WordPress 404 Error</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>I have site built with WordPress and I wanted to catch all 404 page that WordPress try to display and make my own custom 404 page depending on the requested page, or in fact I just wanted to whether or not show a 404 page.</p>

<!-- more -->

<p>If the user, let&#8217;s say, go to <code>http://mysite.com/someword</code> on mysite, and if that is not a post/page it would probably display a 404 page, but I didn&#8217;t want that behavior I wanted to search if <code>someword</code> is a category slug or a tag and display posts in that category or tag, otherwise would show the normal 404 page.</p>

<p>So, this is what I did, I added a action to <code>template_redirect</code> hook, that is executed before WordPress determine which page is going to be loaded.</p>

<div class="highlight highlight-php"><pre><code><span class="nx">add_action</span><span class="p">(</span><span class="s1">&#39;template_redirect&#39;</span><span class="p">,</span> <span class="s1">&#39;_custom_redirect&#39;</span><span class="p">);</span>
<span class="k">function</span> <span class="nf">_custom_redirect</span><span class="p">()</span>
<span class="p">{</span>
  <span class="k">global</span> <span class="nv">$wp_query</span><span class="p">;</span>

  <span class="k">if</span> <span class="p">(</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_404</span><span class="p">()</span> <span class="p">)</span>
  <span class="p">{</span>
    <span class="c1">// Here I take over 404 page</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre></div>

<p>So now, I know when it&#8217;s a 404 page, I need to get the string it was passed on the url, in this case <code>someword</code>, so I can check if the string match a category or a tag name with that name.</p>

<p>This string is stored in a array named <code>query_vars</code> with the key <code>name</code>. <code>query_vars</code> is a variable member of <code>WP_Query</code> which WordPress uses to execute the main query.</p>

<p><div class="highlight highlight-php"><pre><code><span class="nx">add_action</span><span class="p">(</span><span class="s1">&#39;template_redirect&#39;</span><span class="p">,</span> <span class="s1">&#39;_custom_redirect&#39;</span><span class="p">);</span>
<span class="k">function</span> <span class="nf">_custom_redirect</span><span class="p">()</span>
<span class="p">{</span>
  <span class="k">global</span> <span class="nv">$wp_query</span><span class="p">;</span>

  <span class="k">if</span> <span class="p">(</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_404</span><span class="p">()</span> <span class="p">)</span>
  <span class="p">{</span>
    <span class="nv">$page_name</span> <span class="o">=</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">query_vars</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">];</span>

    <span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="nv">$page_name</span> <span class="p">)</span>
      <span class="k">return</span><span class="p">;</span>

    <span class="k">if</span> <span class="p">(</span> <span class="p">(</span><span class="nv">$category</span> <span class="o">=</span>  <span class="nx">get_category_by_slug</span><span class="p">(</span> <span class="nv">$page_name</span> <span class="p">))</span> <span class="p">)</span>
    <span class="p">{</span>
      <span class="c1">// Here it found a category</span>
    <span class="p">}</span>
    <span class="k">elseif</span> <span class="p">(</span> <span class="p">(</span><span class="nv">$tag</span> <span class="o">=</span> <span class="nx">get_term_by</span><span class="p">(</span><span class="s1">&#39;slug&#39;</span><span class="p">,</span> <span class="nv">$page_name</span><span class="p">,</span> <span class="s1">&#39;post_tag&#39;</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
    <span class="p">{</span>
      <span class="c1">// Here it found a tag</span>
    <span class="p">}</span>
    <span class="k">else</span>
    <span class="p">{</span>
      <span class="c1">// Is not a category or a tag</span>
      <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></p>

<p>After this code WordPress would still &#8220;believe&#8221; it&#8217;s a 404 page, I needed to add some more lines to changed this.</p>

<p><div class="highlight highlight-php"><pre><code><span class="nx">add_action</span><span class="p">(</span><span class="s1">&#39;template_redirect&#39;</span><span class="p">,</span> <span class="s1">&#39;_custom_redirect&#39;</span><span class="p">);</span>
<span class="k">function</span> <span class="nf">_custom_redirect</span><span class="p">()</span>
<span class="p">{</span>
  <span class="k">global</span> <span class="nv">$wp_query</span><span class="p">;</span>

  <span class="k">if</span> <span class="p">(</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_404</span><span class="p">()</span> <span class="p">)</span>
  <span class="p">{</span>
    <span class="nv">$page_name</span> <span class="o">=</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">query_vars</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">];</span>

    <span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="nv">$page_name</span> <span class="p">)</span>
      <span class="k">return</span><span class="p">;</span>

    <span class="k">if</span> <span class="p">(</span> <span class="p">(</span><span class="nv">$category</span> <span class="o">=</span>  <span class="nx">get_category_by_slug</span><span class="p">(</span> <span class="nv">$page_name</span> <span class="p">))</span> <span class="p">)</span>
    <span class="p">{</span>
      <span class="c1">// Here it found a category</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_category</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">elseif</span> <span class="p">(</span> <span class="p">(</span><span class="nv">$tag</span> <span class="o">=</span> <span class="nx">get_term_by</span><span class="p">(</span><span class="s1">&#39;slug&#39;</span><span class="p">,</span> <span class="nv">$page_name</span><span class="p">,</span> <span class="s1">&#39;post_tag&#39;</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
    <span class="p">{</span>
      <span class="c1">// Here it found a tag</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_tag</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">else</span>
    <span class="p">{</span>
      <span class="c1">// Is not a category or a tag</span>
      <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_404</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span>
    <span class="nx">status_header</span><span class="p">(</span> <span class="mi">200</span> <span class="p">);</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></p>

<p>This is pretty much what I wanted to do, now I can get a <em>tag</em> or a <em>category</em> object if one exists, otherwise WordPress will keep its own process and will display its normal 404 page.</p>

<p>If I actually got a tag or category object, I need to query all posts under it.</p>

<p><div class="highlight highlight-php"><pre><code><span class="nx">add_action</span><span class="p">(</span><span class="s1">&#39;template_redirect&#39;</span><span class="p">,</span> <span class="s1">&#39;_custom_redirect&#39;</span><span class="p">);</span>
<span class="k">function</span> <span class="nf">_custom_redirect</span><span class="p">()</span>
<span class="p">{</span>
  <span class="k">global</span> <span class="nv">$wp_query</span><span class="p">;</span>

  <span class="k">if</span> <span class="p">(</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_404</span><span class="p">()</span> <span class="p">)</span>
  <span class="p">{</span>
    <span class="nv">$page_name</span> <span class="o">=</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">query_vars</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">];</span>

    <span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="nv">$page_name</span> <span class="p">)</span>
      <span class="k">return</span><span class="p">;</span>

    <span class="nv">$query_args</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
    <span class="k">if</span> <span class="p">(</span> <span class="p">(</span><span class="nv">$category</span> <span class="o">=</span>  <span class="nx">get_category_by_slug</span><span class="p">(</span> <span class="nv">$page_name</span> <span class="p">))</span> <span class="p">)</span>
    <span class="p">{</span>
      <span class="c1">// Here we found a category</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_category</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
      <span class="nv">$query_args</span> <span class="o">=</span> <span class="s1">&#39;category_name=&#39;</span> <span class="o">.</span> <span class="nv">$category</span><span class="o">-&gt;</span><span class="na">slug</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">elseif</span> <span class="p">(</span> <span class="p">(</span><span class="nv">$tag</span> <span class="o">=</span> <span class="nx">get_term_by</span><span class="p">(</span><span class="s1">&#39;slug&#39;</span><span class="p">,</span> <span class="nv">$page_name</span><span class="p">,</span> <span class="s1">&#39;post_tag&#39;</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
    <span class="p">{</span>
      <span class="c1">// Here we found a tag</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_tag</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
      <span class="nv">$query_args</span> <span class="o">=</span> <span class="s1">&#39;tag=&#39;</span> <span class="o">.</span> <span class="nv">$tag</span><span class="o">-&gt;</span><span class="na">slug</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">else</span>
    <span class="p">{</span>
      <span class="c1">// Is not a category or a tag</span>
      <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_404</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span>
    <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_archive</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
    <span class="nx">status_header</span><span class="p">(</span> <span class="mi">200</span> <span class="p">);</span>

    <span class="nx">query_posts</span><span class="p">(</span> <span class="nv">$query_args</span> <span class="p">);</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></p>

<p>If <code>status_header( 200 );</code> isn&#8217;t added the HTTP status will always be a 404, so this line change the status code from 404 to 200.</p>

<p>This is about it, but I want a little bit more, I want if <code>is_category();</code> or <code>is_tag();</code> functions are used, it has to return true. In order to make this to happen I needed to set a couple of variables more.</p>

<p><div class="highlight highlight-php"><pre><code><span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;category_name&#39;</span><span class="p">,</span> <span class="nv">$category</span><span class="o">-&gt;</span><span class="na">slug</span><span class="p">);</span>
<span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;cat&#39;</span><span class="p">,</span> <span class="nv">$category</span><span class="o">-&gt;</span><span class="na">term_id</span><span class="p">);</span>

<span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;tag&#39;</span><span class="p">,</span> <span class="nv">$tag</span><span class="o">-&gt;</span><span class="na">slug</span><span class="p">);</span>
<span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;tag_id&#39;</span><span class="p">,</span> <span class="nv">$tag</span><span class="o">-&gt;</span><span class="na">term_id</span><span class="p">);</span>
</code></pre></div></p>

<p><code>$wp_query->set()</code> will set a variable to <code>query_vars</code> array, which as I mentioned before is used by WordPress main query. With this variables set, when WordPress executes <code>is_category();</code> or <code>is_tag();</code> would have category or tag specific variable values to check if is a category/tag or not. </p>

<h3>Final code</h3>

<p><div class="highlight highlight-php"><pre><code><span class="nx">add_action</span><span class="p">(</span><span class="s1">&#39;template_redirect&#39;</span><span class="p">,</span> <span class="s1">&#39;_custom_redirect&#39;</span><span class="p">);</span>
<span class="k">function</span> <span class="nf">_custom_redirect</span><span class="p">()</span>
<span class="p">{</span>
  <span class="k">global</span> <span class="nv">$wp_query</span><span class="p">;</span>

  <span class="k">if</span> <span class="p">(</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_404</span><span class="p">()</span> <span class="p">)</span>
  <span class="p">{</span>
    <span class="nv">$page_name</span> <span class="o">=</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">query_vars</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">];</span>

    <span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="nv">$page_name</span> <span class="p">)</span>
      <span class="k">return</span><span class="p">;</span>

    <span class="nv">$query_args</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
    <span class="k">if</span> <span class="p">(</span> <span class="p">(</span><span class="nv">$category</span> <span class="o">=</span>  <span class="nx">get_category_by_slug</span><span class="p">(</span> <span class="nv">$page_name</span> <span class="p">))</span> <span class="p">)</span>
    <span class="p">{</span>
      <span class="c1">// Here we found a category</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_category</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;category_name&#39;</span><span class="p">,</span> <span class="nv">$category</span><span class="o">-&gt;</span><span class="na">slug</span><span class="p">);</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;cat&#39;</span><span class="p">,</span> <span class="nv">$category</span><span class="o">-&gt;</span><span class="na">term_id</span><span class="p">);</span>

      <span class="nv">$query_args</span> <span class="o">=</span> <span class="s1">&#39;category_name=&#39;</span> <span class="o">.</span> <span class="nv">$category</span><span class="o">-&gt;</span><span class="na">slug</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">elseif</span> <span class="p">(</span> <span class="p">(</span><span class="nv">$tag</span> <span class="o">=</span> <span class="nx">get_term_by</span><span class="p">(</span><span class="s1">&#39;slug&#39;</span><span class="p">,</span> <span class="nv">$page_name</span><span class="p">,</span> <span class="s1">&#39;post_tag&#39;</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
    <span class="p">{</span>
      <span class="c1">// Here we found a tag</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_tag</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;tag&#39;</span><span class="p">,</span> <span class="nv">$tag</span><span class="o">-&gt;</span><span class="na">slug</span><span class="p">);</span>
      <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;tag_id&#39;</span><span class="p">,</span> <span class="nv">$tag</span><span class="o">-&gt;</span><span class="na">term_id</span><span class="p">);</span>

      <span class="nv">$query_args</span> <span class="o">=</span> <span class="s1">&#39;tag=&#39;</span> <span class="o">.</span> <span class="nv">$tag</span><span class="o">-&gt;</span><span class="na">slug</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">else</span>
    <span class="p">{</span>
      <span class="c1">// Is not a category or a tag</span>
      <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_404</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span>
    <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">is_archive</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
    <span class="nx">status_header</span><span class="p">(</span> <span class="mi">200</span> <span class="p">);</span>

    <span class="nx">query_posts</span><span class="p">(</span> <span class="nv">$query_args</span> <span class="p">);</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></p>

<p>This would be helpful too if you want to log/register/email requested pages that ends up being a 404 page.</p>

<p><strong>NOTE:</strong> if you don&#8217;t have any category or tag template page will returns a 404 page template, just take that in mind.</p><p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/control-wordpress-404-error/">Control WordPress 404 Error</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/control-wordpress-404-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2014 Goals</title>
		<link>http://wellingguzman.com/writing/2014-goals/</link>
		<comments>http://wellingguzman.com/writing/2014-goals/#comments</comments>
		<pubDate>Wed, 08 Jan 2014 21:58:30 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Sin categoría]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=167</guid>
		<description><![CDATA[<p>Late Happy New year to everybody who is not reading this and won&#8217;t be reading this until whoever knows how they get in here. This year I am going to propose myself a list of goals that I want to or would like to have done by the end of year 2014 at lease. This [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/2014-goals/">2014 Goals</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Late Happy New year to everybody who is not reading this and won&#8217;t be reading this until whoever knows how they get in here.</p>

<p>This year I am going to propose myself a list of goals that I want to or would like to have done by the end of year 2014 at lease.</p>

<p>This are the things I would want to do, but I probably won&#8217;t</p>

<!-- more -->


<h2>Examples/Portfolio</h2>

<p>The thing I want the most is example of the things I&#8217;ve done or I capable to do. I hate myself when someone ask me: &#8216;Do you know X?&#8217; and I say: &#8216;yes, I do&#8217;, and then they said: &#8216;Ok, cool send me some examples of work you have done in X&#8217;, I just draw a blank and start looking at old Hard Drives, Flash Memories, Old Mails, Dropbox, Google Drive and olds computer to find something and start to think: he/she won&#8217;t believe me if I said I don&#8217;t have anything to show, they will think I am lying. I don&#8217;t blame them, I understand, I won&#8217;t believe it either if someone tells me it knows something and doesn&#8217;t have anything to prove that, for me it just BS. So, I&#8217;m telling BS too.</p>

<p>That&#8217;s why I&#8217;m going to create a portfolio, a collection of examples to show my potencial and what I am capable of.</p>



<h2>Write more</h2>

<p>I like to write but I don&#8217;t do it well, so I would like to write more in order to improve my writing skills (english and spanish by the way).</p>

<p>I&#8217;m going to write more, about everything it won&#8217;t matter what, sometimes I don&#8217;t write something because it was already been wrote, or it&#8217;s a simple thing that everyone (I believe) knows.</p>

<p>I would turn this blog into a possible log of thing I&#8217;m working on or I&#8217;ve worked on and share my experiences.</p>


<h2>Work on a Big Project</h2>

<p>One thing that I would like to do, it&#8217;s been on a BIG project, where I am not the &#8220;expert&#8221; or &#8220;the master of universe of that project&#8221;, I just want to be part and learn from other leader and how to approach things, not the I want to be the one dude that doesn&#8217;t contribute to anything just code, but learn how other people with more experiencies handle things on a big project.</p>

<p>By a big project I mean a project who involves Back-end, front-end, tons of users and/or page request, fully web-based app and everything is created In house.</p>


<h2>Take JavaScript to another level</h2>

<p>So this mean I want to use JavaScript more and not just query some element and changed its style, so this could change if I got a change to work on a Big Project.</p>


<h2>Stay up to day on Web</h2>

<p>I spent couple of months outside the &#8216;Staying up to day&#8217; World due to work that had me busy and I was way behind already, the web is growing fast and I need to keep me updated.</p>

<p>I don&#8217;t know how am I going to mesure this, but anyways.</p>


<h2>Attend Conferences</h2>

<p>Yup, that. I want to attend to more conferences In order to learn and help me to stay up to day.</p>
<p>By the way I went to <a href="http://ultimatedeveloperevent.com/boston-2013/">The Ultimate Developer Event Boston 2013</a> it was an amazing Event, hope I can go next time.</p>


<h2>Make a game</h2>

<p>I am probably make the game Snake, but anyways I just want to do a complete game that can be play well, with menues and stuff.</p>


<h2>Contribute to Open Source Projects</h2>

<p>I would love to contribute or create open source projects.</p>


<h2>Use CodePen</h2>

<p>I&#8217;ve been looking at demos there since I don&#8217;t know, it&#8217;s been a while, and there some amazing example there that will blow your mind, anyways, so I am going to use <a href="http://codepen.io" target="new">CodePen</a> to publish anything, whatever cross my mind, it&#8217;s just to share some code and awesome example or weird stuff.</p>

<h2>Publish on GitHub</h2>

<p>When is something that is too big for CodePen or whatever, I will post it here, in GitHub</p>
<p>I would like to create some library or some code that would be useful for developer, so I hope I could write at least 2 cool new Repositories that would be helpful for many people.</p><p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/2014-goals/">2014 Goals</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/2014-goals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All I use as Web Developer</title>
		<link>http://wellingguzman.com/writing/all-i-use-as-web-developer/</link>
		<comments>http://wellingguzman.com/writing/all-i-use-as-web-developer/#comments</comments>
		<pubDate>Mon, 07 Oct 2013 18:30:27 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Sin categoría]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=151</guid>
		<description><![CDATA[<p>I recently did a Mac OS X clean install, now I&#8217;m just going to install only application I need and commonly use, I always say that and end up doing it again installing and downloading bunch of things I don&#8217;t need or even use, and full my computer of useless files that slow my machine [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/all-i-use-as-web-developer/">All I use as Web Developer</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>I recently did a Mac OS X clean install, now I&#8217;m just going to install only application I need and commonly use, I always say that and end up doing it again installing and downloading bunch of things I don&#8217;t need or even use, and full my computer of useless files that slow my machine down.</p>

<p>This post will also make me keep track of all I need/use.</p>

<!-- more -->

<h2>Browsers</h2>

<p>I always download all my browsers first.</p>

<h3>Safari</h3>

<p>Safari comes by default on Mac OS X.</p>

<h3>Google Chrome</h3>

<p>This is (by now) my favorite/default browser, is the first thing I downloaded on every new or new install machine, in other words if there not chrome installed, I install it right away. Go and <a href="http://google.com/chrome/" target="new">download Google Chrome</a>, just give it a try. If you are under linux you might want to check <a href="https://developers.google.com/chrome-developer-tools/" target="new">Chromium</a></p>

<p>So as a Web Developer I mostly use Chrome because of its DevTools. Chrome DevTools is an <em>amazing tool for debugging web applications</em>. Give <a href="https://developers.google.com/chrome-developer-tools/" target="new">Chrome Dev Tools</a> a try.</p>

<h3>Google Chrome Canary</h3>

<p>Is Google Chrome but <a href="http://wellingguzman.com/getting-hands-dirty-chrome-canary/" target="new">from the future</a>.</p>

<p>As a Web Developer this is a good thing because you can test new features before it came to the official Chrome Release (Stable), sometimes this features come on Chrome stable version as experimental but some are not.</p>

<h3>Firefox</h3>

<p>The next browser is <a href="https://www.mozilla.org/en-US/firefox/" target="new">Firefox</a> and as a Web Developer I use Firefox to check if the web app works on it, and <a href="http://youtu.be/tyO0_sV4cek" target="new">playing around with 3D View</a>.</p>

<h3>Opera</h3>

<p>I open up opera only for testing, so that as a Web Developer I use opera. <a href="http://www.opera.com/" target="new">Download Opera</a> you need it if you are going to bet for the web.</p>

<h3>Internet Explorer</h3>

<p>Wut?<br /><img src="http://wellingguzman.com/uploads/2013/10/JackSparrowConfused.jpg" alt="" width="300" height="155"></p>

<h2>Text Editors/IDE</h2>

<p>Well we need something to edit all our source code files, I use the following:</p>

<h3>Sublime Text</h3>
<p><a href="http://www.sublimetext.com/" target="new">Sublime Text</a>, is a multiplatform text editor and can be customizable, has a lot of plugins, themes and color schema and support a lot of programming languages.</p>

<h3>Coda</h3>
<p><a href="http://panic.com/coda/" target="new">Coda</a>, is a great IDE with a lot of built-in features including Full File Browser (FTP, SFTP, WebDAV, and S3) and MySQL Editor.</p>

<p>I used to Install <a href="http://www.barebones.com/products/textwrangler/" target="new">TextWrangler</a>, but sublime text fits all my needs.</p>


<h2>Tools</h2>

<h3>iTerm2</h3>

<p><a href="http://www.iterm2.com/" target="new">iTerm</a> is an alternative to Terminal, it supports split view that why love it the most.</p>

<h3>Git</h3>

<p>I use Git to control and manage all my source code. <a href="http://git-scm.com/" target="new">Read more and download Git</a>, also check <a href="http://github.com/" target="new">GitHub</a>.</p>

<h3>NodeJS</h3>

<p>I do not really use <a href="http://nodejs.org/" target="new">NodeJS</a>, but I need to install NodeJS in order to install some awesome tools like grunt.</p>

<h3>GruntJS</h3>

<p><a href="http://gruntjs.com/" target="new">Grunt</a> is a javascript task runner that helps us to automate task, like copying files, concatenating files, adding css prefixes, compiling sass and much much more.</p>

<h3>Bower</h3>

<p><a href="http://bower.io/" target="new">Bower</a> is a frontend package manager, as its name stated, manage all our frontend packages, one command and Bower will install all dependecies for us automatically.</p>

<h3>Yeoman</h3>

<p>I&#8217;ve just used <a href="http://yeoman.io/" target="new">Yeoman</a> couple of times, but this is a great tool/workflow that help us out creating new application boilerplates, Yeoman uses Grunt and Bower.</p>

<h3>CodeKit</h3>

<p><a href="http://incident57.com/codekit/" target="new">CodeKit</a> is an amazing tool for Mac OS X that make Web Developer lives a lot easier, it compiles everything sass, less, halm, stylus, coffeescript, compass and more, combine and minify files, optimizes images, live page reloads and much much more.

<h2>Local Environment</h2>

<h3>MAMP PRO</h3>

<p>This is a quick and easy way (click-next install) to set up on a <strong>M</strong>ac, <strong>A</strong>pache, <strong>M</strong>ySQL and <strong>P</strong>HP. I need this to use/create/test PHP/MySQL locally on my machine.</p>

<h3>phpMyAdmin</h3>

<p>Yup, this is the tool I used for MySQL Database Management. It&#8217;s written in PHP and comes with MAMP PRO.</p>

<h2>Collaboration/Comunication</h2>

<h3>Skype</h3>
<p><a href="http://skype.com" target="new">Skype</a>, if you work with remote clients/team-mate, you need something to talk to them, Google Hangout is an option.</p>

<h3>Wunderlist</h3>
<p><a href="https://www.wunderlist.com/" target="new">Wunderlist</a>, here is where I keep all my todo task, even outside Developing, like run out of Dr. Pepper. It also syncs in all my devices.</p>


<p><em>Oh have you not heard? It was my understanding that everyone had heard.</em></p><p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/all-i-use-as-web-developer/">All I use as Web Developer</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/all-i-use-as-web-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting my hands dirty on Chrome Canary</title>
		<link>http://wellingguzman.com/writing/getting-hands-dirty-chrome-canary/</link>
		<comments>http://wellingguzman.com/writing/getting-hands-dirty-chrome-canary/#comments</comments>
		<pubDate>Wed, 18 Sep 2013 21:13:30 +0000</pubDate>
		<dc:creator><![CDATA[Welling Guzman]]></dc:creator>
				<category><![CDATA[Sin categoría]]></category>
		<category><![CDATA[Canary]]></category>

		<guid isPermaLink="false">http://wellingguzman.com/?p=97</guid>
		<description><![CDATA[<p>If you want to have the newest features from Google Chrome, you must need to use Chrome Canary. Chrome Canary is updated almost everyday, it&#8217;s mean would be fresh builds. It can run side by side with Google Chrome stable version, so you don&#8217;t have to choose one of the two, one thing to know [&#8230;]</p>
<p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/getting-hands-dirty-chrome-canary/">Getting my hands dirty on Chrome Canary</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><img src="http://wellingguzman.com/uploads/2013/09/canarylogo.png" alt="" width="256" height="256" class="alignright">If you want to have the newest features from <strong>Google Chrome</strong>, you must need to use <strong>Chrome Canary</strong>. Chrome Canary is updated almost everyday, it&#8217;s mean would be fresh builds. It can run side by side with Google Chrome stable version, so you don&#8217;t have to choose one of the two, one thing to know is that you can&#8217;t use Canary as your default browser.</p>

<p>Although this is designed for Developers and early adopters, you should <strong>be aware</strong> this could crash sometimes even has more chances to if you are using experimental features.</p>

<!-- more -->

<p>This is a quick view of canary I did in a couple of hours to get my hands dirty, if you want to be ahead and test features that would be available later on Google Chrome check this out.</p>

<p>I have been seeing this Chrome gold icon for a while, wondering what it is, I just thought it was just kind a cool icon for Chrome and nothing else, but HEY! it&#8217;s not, is your Google Chrome Browser from the <strong>FUTURE!</strong>, so now let&#8217;s see what bring us.</p>

<p>First of all this is <em>Version 31.0.1632.0 canary</em>.</p>

<h2>Visually Stuff</h2>

<p>Now the first we notice when we open up <strong>Developer Tools</strong> is that now it organizes by tabs rather than grouped list-item, I do like this new way to handle this section now, you don&#8217;t have to scroll all the way down looking for an specific section, it&#8217;s worst when you have thousands of CSS declarations. Also metrics section was merged with styles section. We can see its difference in the image below.</p>

<figure>
<img src="http://wellingguzman.com/uploads/2013/09/image01.jpg" alt="" width="423" height="250" class="aligncenter">
</figure>

<p>In sources panel the paused exceptions buttons was moved from bottom bar to sidebar as you can see in the next image.</p>

<figure>
<img src="http://wellingguzman.com/uploads/2013/09/image02.jpeg" alt="" width="208" height="610" class="aligncenter">
</figure>

<p>They removed <strong>Collect CSS Selector Profile</strong> from Profile panel.</p>

<figure>
<img src="http://wellingguzman.com/uploads/2013/09/image03.jpeg" alt="" width="270" height="204" class="aligncenter">
</figure>

<p>DevTools Settings are now neat, it has smaller font size and more organized than before.</p>

<figure>
<img src="http://wellingguzman.com/uploads/2013/09/Image04.jpeg" alt="" width="900" height="154" class="aligncenter">
</figure>


<h2>Features</h2>

<p>Enough of visually things, now let&#8217;s see what features I found:</p>

<h3>Inspect DOM Element</h3>
<p>The first thing I check was the popup menu from DOM Inspector.</p>

<figure>
<img src="http://wellingguzman.com/uploads/2013/09/image05.jpeg" alt="" width="217" height="282" class="aligncenter">
<img src="http://wellingguzman.com/uploads/2013/09/image05.1.jpeg" alt="" width="279" height="246" class="aligncenter">
</figure>

<p><strong>Inspect DOM Element</strong> is a new option that come in handy when you want a quick access to a DOM element properties, this save us time because we don&#8217;t need to go to console and query that element using <code>jQuery</code> or <code>querySelector</code> or any of those anymore, now it&#8217;s just a click ahead.</p>

<h3>EventTarget</h3>
<p>In the properties tab of <strong>DOM inspector</strong> now included <code>EventTarget</code> which can tell us if the element can receive DOM events, even though the most common events targets are <code>window</code>, <code>Element</code>, and <code>document</code> which are the ones we commonly use.</p>

<figure>
<img src="http://wellingguzman.com/uploads/2013/09/Image06.jpeg" alt="Image0" width="428" height="194" class="aligncenter">
</figure>

<h3>Working with CSS Preprocessor</h3>
<p>Now in canary we have CSS and Javascript source maps enabled by default, we don&#8217;t need to enable Enable Developer Tools experiments to enabled this on the experiments tab.</p>

<figure>
<img src="http://wellingguzman.com/uploads/2013/09/Image071.jpeg" alt="" width="581" height="253" class="aligncenter">
</figure>

<p>This all I got, most of the features I was testing I later notice that it was already available to the current Google Chrome stable version, so all the new stuff on Canary or already available (on stable) I&#8217;m going to keep posting here.</p>

<p>Go and Download it <a href="https://www.google.com/intl/en/chrome/browser/canary.html" target="new">here</a>, it&#8217;s only available for Mac and Windows, but if you are on linux you can check <a href="http://www.chromium.org/getting-involved/dev-channel" target="new">Chromium Dev Channel</a> and have weekly updates.</p>

<p>Useful Links: </p>
<ul>
<li><a href="http://trac.webkit.org" target="new">http://trac.webkit.org</a></li>
<li><a href="http://peter.sh/data/web-inspector-rss.php" target="new">Web Inspector commits RSS feed</a></li>
<li><a href="http://www.youtube.com/playlist?list=PLM7CMPN8kQrKQdYtnG8qhubQHQmb6CHTw" target="new">The Breakpoint Episodes</a></li>
<li><a href="http://twitter.com/WellingGuzman" target="new">Follow me on Twitter</a></li>
<li><a href="https://plus.google.com/u/0/109985810023249441310/posts" target="new">Follow me on Google+</a></li>
</ul><p>La entrada <a rel="nofollow" href="http://wellingguzman.com/writing/getting-hands-dirty-chrome-canary/">Getting my hands dirty on Chrome Canary</a> aparece primero en <a rel="nofollow" href="http://wellingguzman.com">Welling Guzman</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wellingguzman.com/writing/getting-hands-dirty-chrome-canary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
