<?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>General Archives - Michael Soriano</title>
	<atom:link href="https://michaelsoriano.com/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>https://michaelsoriano.com/category/general/</link>
	<description>I turn code into captivating user experiences for the web</description>
	<lastBuildDate>Mon, 08 Jul 2024 18:28:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.4</generator>
	<item>
		<title>Laracasts.com: a gold mine of content for Web Developers</title>
		<link>https://michaelsoriano.com/laracasts-com-a-gold-mine-of-content-for-web-developers/</link>
					<comments>https://michaelsoriano.com/laracasts-com-a-gold-mine-of-content-for-web-developers/#respond</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Mon, 08 Jul 2024 18:26:44 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://michaelsoriano.com/?p=8127</guid>

					<description><![CDATA[<p>I&#8217;ve been a Software Engineer for many years. And for the past few, JavaScript has been emerging with newer, better and shinier things. But like many others, I&#8217;ve been having a little bit of JavaScript fatigue. Lately, I&#8217;ve been looking to other frameworks with more stability. Something that I rely on &#8211; that will work [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/laracasts-com-a-gold-mine-of-content-for-web-developers/">Laracasts.com: a gold mine of content for Web Developers</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;ve been a Software Engineer for many years. And for the past few, JavaScript has been emerging with newer, better and shinier things. But like many others, I&#8217;ve been having a little bit of <a href="https://auth0.com/blog/how-to-manage-javascript-fatigue/">JavaScript fatigue</a>. Lately, I&#8217;ve been looking to other frameworks with more stability. Something that I rely on &#8211; that will work for years to come. </p>



<h3 class="wp-block-heading">Back to Roots</h3>



<p>PHP was my first real programming language. And Laravel is built with PHP. I&#8217;ve always heard of Laravel, but never used it. I&#8217;ve watched many videos about how good it is, installed a sample application &#8211; and was sold. </p>



<p>I want to learn more &#8211; so I signed up for <a href="https://laracasts.com/referral/Michaelsoriano" rel="nofollow">Laracasts</a>. If you’re a web developer, suffering from JS Fatigue, and want to learn Laravel &#8211; Laracasts.com is like striking gold.</p>



<figure class="wp-block-image size-large"><a href="https://laracasts.com/referral/Michaelsoriano" rel="nofollow"><img fetchpriority="high" decoding="async" width="1024" height="584" src="https://michaelsoriano.com/wp-content/uploads/2024/07/image-1024x584.jpg" alt="Power to the modern developer" class="wp-image-8140" srcset="https://michaelsoriano.com/wp-content/uploads/2024/07/image-1024x584.jpg 1024w, https://michaelsoriano.com/wp-content/uploads/2024/07/image-300x171.jpg 300w, https://michaelsoriano.com/wp-content/uploads/2024/07/image-768x438.jpg 768w, https://michaelsoriano.com/wp-content/uploads/2024/07/image.jpg 1117w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Top-notch tutorials and lessons. I, for one have signed up on many premium bootcamps and tutorial websites. So far, Laracasts is the best I&#8217;ve seen. Let me explain. </p>



<h3 class="wp-block-heading"><strong>Talented Instructors &#8211; <strong>Jeffrey Way</strong></strong></h3>



<p>Jeffrey Way, the main instructor, has a unique gift for making complex topics easy to understand. His explanations are clear and straightforward, making even the most daunting subjects feel manageable. He has a way of teaching &#8211; that reminds me of how elementary school was &#8211; but for a modern, experienced developer. </p>



<p>Plus, he presents everything in such an engaging way that you’re hooked from the first video. I especially like how he organizes his content &#8211; from inception to conception. Jeffrey Way is as good as it gets.</p>



<p>In addition, I&#8217;ve seen a couple of series on Inertia, React and APIs &#8211; and the instructors were also pretty good. Not the same style as Jeffrey &#8211; but good nonetheless. </p>



<h3 class="wp-block-heading"><strong>Structured Learning Paths for Laravel and More</strong></h3>



<p>One of my favorite features is the structured learning paths. These pathways are like having a personal guide through the vast world of web development. They ensure you build a solid foundation before moving on to more advanced topics. This is incredibly helpful if you’re new to coding or trying to learn a new framework like Laravel.</p>



<p>There is also small bits of lessons called &#8220;<strong><a href="https://laracasts.com/referral/Michaelsoriano" rel="nofollow">Larabits</a></strong>&#8220;. These are quick how-to videos, that&#8217;s not necessarily tied to a learning path. Just fast paced watch and go type of tut. </p>



<h3 class="wp-block-heading"><strong>Supportive Community</strong></h3>



<p>The community at Laracasts is fantastic. The forums are buzzing with activity and full of people ready to help out with any questions you might have about Laravel tutorials or other topics. It&#8217;s great to be part of a community where you can share knowledge and get support from fellow learners. </p>



<p>Plus, Jeffrey Way is actively involved, which adds a personal touch to the experience.</p>



<p>In addition, each video has a comments area &#8211; where you can post comments &#8211; and the community is also very responsive. This helps when you&#8217;re stuck in part of the video, commenting will get you &#8220;unstuck&#8221; real quick.</p>



<h3 class="wp-block-heading"><strong>Diverse Range of Topics Beyond Laravel</strong></h3>



<p>While Laracasts is famous for its Laravel tutorials, it doesn’t stop there. The site offers in-depth tutorials on JavaScript, Vue, React, testing, and general web development practices. As mentioned above &#8211; the instructors and the way they teach the course is paramount. So the topics can vary &#8211; and you get the same high quality tutorial &#8211; which is a good deal.</p>



<figure class="wp-block-image size-full"><a href="https://laracasts.com/referral/Michaelsoriano" rel="nofollow"><img decoding="async" width="851" height="810" src="https://michaelsoriano.com/wp-content/uploads/2024/07/image-1.png" alt="Laracasts Topics" class="wp-image-8137" srcset="https://michaelsoriano.com/wp-content/uploads/2024/07/image-1.png 851w, https://michaelsoriano.com/wp-content/uploads/2024/07/image-1-300x286.png 300w, https://michaelsoriano.com/wp-content/uploads/2024/07/image-1-768x731.png 768w" sizes="(max-width: 851px) 100vw, 851px" /></a></figure>



<p>So whether you&#8217;re looking to dive deep into a specific framework or broaden your overall skill set, Laracasts has you covered. I was even surprised to see GraphQL, CSS and Webpack in there &#8211; its not just backend stuff!</p>



<h3 class="wp-block-heading"><strong>Final Thoughts</strong></h3>



<p>Laracasts.com is a must-have resource for anyone serious about web development, especially if you want to master Laravel tutorials. Its combination of excellent instructors that produce high-quality content. The strong community that you become part of &#8211; is truly indispensable. You get to learn everything about Laravel, but also other skills as well. In addition, the library is constantly updated, with new paths, technologies and lessons.  </p>



<p>Whether you’re aiming to become a Laravel expert, improve your JavaScript skills, or just become a better developer overall, <a href="https://laracasts.com/referral/Michaelsoriano" rel="nofollow">Laracasts</a> is an investment you won’t regret.</p>
<p>The post <a href="https://michaelsoriano.com/laracasts-com-a-gold-mine-of-content-for-web-developers/">Laracasts.com: a gold mine of content for Web Developers</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/laracasts-com-a-gold-mine-of-content-for-web-developers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A really good explanation of the inner workings of React</title>
		<link>https://michaelsoriano.com/a-really-good-explanation-of-the-inner-workings-of-react/</link>
					<comments>https://michaelsoriano.com/a-really-good-explanation-of-the-inner-workings-of-react/#respond</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Fri, 28 May 2021 22:43:19 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<guid isPermaLink="false">http://michaelsoriano.com/?p=7379</guid>

					<description><![CDATA[<p>React has become the premiere choice of frameworks for front end developers. I must say, having used it on and off since its early versions &#8211; it is quite the tool for building web pages and applications. This means that there is a whole lot of good articles out there about React. Such as this [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/a-really-good-explanation-of-the-inner-workings-of-react/">A really good explanation of the inner workings of React</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>React has become the premiere choice of frameworks for front end developers. I must say, having used it on and off  since its early versions &#8211; it is quite the tool for building web pages and applications. This means that there is a whole lot of good articles out there about React. </p>



<figure class="wp-block-image size-full"><img decoding="async" width="800" height="469" src="https://michaelsoriano.com/wp-content/uploads/2019/05/react_js.png" alt="react" class="wp-image-7770" srcset="https://michaelsoriano.com/wp-content/uploads/2019/05/react_js.png 800w, https://michaelsoriano.com/wp-content/uploads/2019/05/react_js-300x176.png 300w, https://michaelsoriano.com/wp-content/uploads/2019/05/react_js-768x450.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure>



<p>Such as this one that I found written by Obed Parliapano called <a href="https://obedparla.com/code/a-visual-guide-to-react-mental-models/">A Visual Guide to React Mental Models</a>. </p>



<p>Halfway through the article, I bookmarked and kept reading. Thought to myself, damn this is a really good explanation of React (as well as components, JSX and JavaScript itself). Not only with words, but with visual imagery as well. I agree with his approach of having &#8220;Mental Models&#8221; in trying to understand complicated things. React is one of those things. And yes, a mental model really helps.   </p>



<p>The author asks to share the article and since I enjoyed it so much I&#8217;m going to do a step further and write about it. Be sure to check it out. </p>
<p>The post <a href="https://michaelsoriano.com/a-really-good-explanation-of-the-inner-workings-of-react/">A really good explanation of the inner workings of React</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/a-really-good-explanation-of-the-inner-workings-of-react/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Solving the web file permissions problem once and for all [Repost]</title>
		<link>https://michaelsoriano.com/solving-the-web-file-permissions-problem-once-and-for-all-repost/</link>
					<comments>https://michaelsoriano.com/solving-the-web-file-permissions-problem-once-and-for-all-repost/#comments</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Fri, 06 Mar 2020 19:06:28 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<guid isPermaLink="false">http://michaelsoriano.com/?p=7100</guid>

					<description><![CDATA[<p>This article is originally from Jérôme Schneider &#8211; who&#8217;s solution helped me out a lot. For some reason, his website http://netgusto.com cannot be resolved and I had to grab this from waybackmachine &#8211; which I&#8217;m so glad I did. For those struggling with permissions in Ubuntu / Apache, continue reading below. If you&#8217;re like us, [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/solving-the-web-file-permissions-problem-once-and-for-all-repost/">Solving the web file permissions problem once and for all [Repost]</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This article is originally from Jérôme Schneider &#8211; who&#8217;s solution helped me out a lot. For some reason, his website <strong>http://netgusto.com</strong> cannot be resolved and I had to grab this from <a href="https://web.archive.org/">waybackmachine</a> &#8211; which I&#8217;m so glad I did. </p>



<p><strong>For those struggling with permissions in Ubuntu / Apache, continue reading below. </strong></p>



<hr class="wp-block-separator has-css-opacity"/>



<p>If you&#8217;re like us, you develop Web applications and deploy them on Linux servers (development or production environments), you might have wondered how to handle file permissions on the application files in a simple and fool-proof way.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="708" src="https://michaelsoriano.com/wp-content/uploads/2022/11/image-1-2-1024x708.jpg" alt="" class="wp-image-7883" srcset="https://michaelsoriano.com/wp-content/uploads/2022/11/image-1-2-1024x708.jpg 1024w, https://michaelsoriano.com/wp-content/uploads/2022/11/image-1-2-300x207.jpg 300w, https://michaelsoriano.com/wp-content/uploads/2022/11/image-1-2-768x531.jpg 768w, https://michaelsoriano.com/wp-content/uploads/2022/11/image-1-2.jpg 1368w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading" id="somefacts">Some facts</h3>



<p>Developers operating on the server require specific file permissions on the application files to be able to read and write them (for obvious reasons).</p>



<p>The web server (Apache, nginx, Lighttpd, etc.) also requires specific file permissions on the application files to be able to read them, and for some files (but not all files), to be able to write them (like for instance, when uploading a file, or creating a thumbnail, etc.)</p>



<h3 class="wp-block-heading" id="theproblem">The problem</h3>



<p><strong>Both the web server and the developpers require file permissions on the same files to operate properly, but they might need different permissions on the same files.</strong></p>



<p>Developers require the ability to read and write every file, while the web server might require only write permissions only on some files.</p>



<p>This constrained shared-resource problem can quickly become a nightmare for the person in charge of the server.</p>



<h3 class="wp-block-heading" id="theusertgroupflawedsolution">The user~group (flawed) solution</h3>



<p>One common solution is to give developers the same user group as the web server (something like&nbsp;<code>www-data</code>), and then to juggle on with ownership on files</p>



<p>While this works in some ways,&nbsp;<strong>it&#8217;s flawed</strong>&nbsp;in others:</p>



<ul class="wp-block-list">
<li><strong>concurrency problem:</strong>&nbsp;when a developer creates a file, the file is owned by the developer, and might not be readable (nor writable if needed) properly by the web server process (granted, one could use some ACL system on the FS, but who ever got this to work properly ?)</li>



<li><strong>impermeability problem</strong>: if you have several web applications running side-by-side on your web server, you&#8217;ll have to juggle a lot more with groups and sub-groups just to prevent Developer A to be able to see and modify Application B.</li>



<li><strong>stability problem</strong>&nbsp;over time, and accordingly with the&nbsp;<a href="https://web.archive.org/web/20180324000243/http://www.brighthubengineering.com/thermodynamics/4615-the-principle-of-increase-of-entropy/">principle of increase of entropy</a>, file permissions will become a mess and perms related bugs will occur.</li>
</ul>



<h3 class="wp-block-heading" id="ourawesomesolution">Our (awesome) solution</h3>



<p>Wouldn&#8217;t it be great if a developer could read and write files of an application with its own unshared user / group, while allowing the web server to have it&#8217;s own and&nbsp;<em>developer-unscrewable</em>&nbsp;permissions on the files of the said application ?</p>



<p>Well yes, it would, and that&#8217;s exactly what&nbsp;<strong>bindfs</strong>&nbsp;is meant for.</p>



<p>With&nbsp;<strong>bindfs</strong>, developers access applications via dedicated filesystem mountpoints (placed in their home dir), acting as file-permission filters, presenting files like they&#8217;re owned by themselves, whereas the files are really owned by the web server user (like&nbsp;<code>www-data</code>).</p>



<p><strong>Advantages:</strong></p>



<ul class="wp-block-list">
<li>it solves the&nbsp;<strong>concurrency problem</strong>, as every user in the equation (every developers and the web server) sees the permissions that he requires to operate properly and safely;</li>



<li>it solves the&nbsp;<strong>impermeability problem</strong>, as if you need one developer to access a particular application, you have to add a mountpoint in its home directory, but on the contrary, if the you need one developer to not access a particular application, you just have to&nbsp;<em>not</em>&nbsp;add such a mountpoint in it&#8217;s home directory.</li>



<li>it solves the&nbsp;<strong>stability problem</strong>, as developers will never be able to change the file permissions set on the application files, as required by the web server to operate properly and safely.</li>



<li>best of all, it&#8217;s simple to understand and to setup !</li>
</ul>



<h3 class="wp-block-heading" id="howtousethis">How to use this</h3>



<p><strong>For Ubuntu / Debian systems</strong></p>



<p>In the next example, we assume that the developer user is&nbsp;<code>devone</code>, the web server user is&nbsp;<code>www-data</code>&nbsp;and the application is stored at&nbsp;<code>/var/www/application1</code>.</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"># Installing bindfs (just the first time)
root@netgusto $ apt-get update
root@netgusto $ apt-get -y install bindfs
# Creating the application mountpoint
root@netgusto $ mkdir -p /home/devone/websites/application1
root@netgusto $ chown -Rf devone:devone /home/devone/websites
root@netgusto $ chmod -Rf 770 /home/devone/websites</code></pre>



<p>Then, edit the content of /etc/fstab and add this line (just one line, without line wraps):</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">bindfs#/var/www/application1 /home/devone/websites/application1 fuse force-user=devone,force-group=devone,create-for-user=www-data,create-for-group=www-data,create-with-perms=0770,chgrp-ignore,chown-ignore,chmod-ignore 0 0  </code></pre>



<p>Save the file, and proceed with mounting application (will mount automatically at system load):</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">root@netgusto $ mount /home/devone/websites/application1</code></pre>



<p>If your system yells about&nbsp;<code>force-user</code>&nbsp;or&nbsp;<code>force-group</code>&nbsp;not being defined:</p>



<ul class="wp-block-list">
<li>replace&nbsp;<code>force-user</code>&nbsp;by&nbsp;<code>owner</code></li>



<li>replace&nbsp;<code>force-group</code>&nbsp;by&nbsp;<code>group</code></li>
</ul>



<h3 class="wp-block-heading" id="testingthesolution">Testing the solution</h3>



<p>Once the application is mounted, you can test it by creating a file in the application mountpoint using the&nbsp;<code>devone</code>&nbsp;account, and verifying the file perms:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"># as root
root@netgusto $ su - devone
# as devone
devone@netgusto $ cd ~/websites/application1
devone@netgusto $ touch helloworld.txt
devone@netgusto $ ls -l helloworld.txt
-rwxrwx--- 1 devone devone 0 sept. 10 17:15 helloworld.txt
devone@netgusto $ exit
# as root again
root@netgusto $ cd /var/www/application1
root@netgusto $ ls -l helloworld.txt
-rwxrwx--- 1 www-data www-data 0 sept. 10 17:15 helloworld.txt</code></pre>



<p>The file is owned by&nbsp;<code>www-data:www-data</code>&nbsp;whereas we created it as&nbsp;<code>devone:devone</code>&nbsp;! It worked !</p>



<h3 class="wp-block-heading" id="onemorething">One more thing</h3>



<p>If you want to prevent developers to access&nbsp;<code>/var/www/application1</code>&nbsp;directly, you just have to execute this:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"># Attribute the /var/www root dir to www-data:www-data
root@netgusto $ chown www-data:www-data /var/www
# Change the permissions so that only the web server can enter this dir
root@netgusto $ chmod 770 /var/www</code></pre>



<p>Note that the web served directory&nbsp;<code>/var/www/application1</code>&nbsp;has nothing to do with&nbsp;<em>bindfs</em>, so it should not impact&nbsp;<strong>at all</strong>&nbsp;your web server.</p>



<p>How cool is that ? Tell us what you think !</p>



<hr class="wp-block-separator has-css-opacity"/>



<p>Here is where the original article ends. I would like to say thanks to  Jérôme and this  <a href="https://www.digitalocean.com/community/questions/should-i-enable-a-password-for-user-www-data">digital ocean article</a> (which lead me to it)</p>
<p>The post <a href="https://michaelsoriano.com/solving-the-web-file-permissions-problem-once-and-for-all-repost/">Solving the web file permissions problem once and for all [Repost]</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/solving-the-web-file-permissions-problem-once-and-for-all-repost/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Just Redux &#8211; a quick and high-level overview</title>
		<link>https://michaelsoriano.com/redux-a-quick-and-high-level-overview/</link>
					<comments>https://michaelsoriano.com/redux-a-quick-and-high-level-overview/#respond</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Thu, 06 Feb 2020 00:50:00 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<guid isPermaLink="false">http://michaelsoriano.com/?p=7155</guid>

					<description><![CDATA[<p>Let&#8217;s go over what this Redux technology is all about. It seems that if you use React, one can&#8217;t escape the fact that the application state will need to be properly managed. See, React is fine when they&#8217;re small. But once they get big &#8211; the state (where data lives) becomes a nightmare to work [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/redux-a-quick-and-high-level-overview/">Just Redux &#8211; a quick and high-level overview</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Let&#8217;s go over what this Redux technology is all about. It seems that if you use React, one can&#8217;t escape the fact that the application state will need to be properly managed. See, React is fine when they&#8217;re small. But once they get big &#8211; the state (where data lives) becomes a nightmare to work with. Dealing with many components &#8211; you want a way to centralize all of that state.  </p>


<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2020/07/redux.jpg" alt="redux" class="wp-image-7173"/>


<p>Enter Redux. Redux is an application that is built mainly to handle state.  Note that Redux can be used without React. It can be used alongside JavaScript applications that needs it. </p>


<p>By the way, I struggle with React and Redux. I couldn&#8217;t grasp working with the two technologies together. So I decided to take a step back &#8211; and learn just Redux.  I took <a href="https://codewithmosh.com/">Mosh Hamedani&#8217;s</a> course and here&#8217;s what I discovered.  </p>


<h2 class="wp-block-heading"><strong>Building Blocks</strong></h2>


<p>So for Redux to work, it needs these 3 building blocks 1) <em>Actions</em>, 2) <em>Store </em>and 3) <em>Reducers</em>. </p>


<h3 class="wp-block-heading"><strong>1) Actions</strong></h3>


<p>This is a JavaScript object that describes the CRUD operations for your store. It also contains the &#8220;payload&#8221; &#8211; which is data that is going to change the store. </p>


<p>It needs a &#8220;type&#8221; property which describes the action. An example type will be when an item is inserted, so a good &#8220;type&#8221; would be &#8220;ITEM_ADDED&#8221;.  There is also another property called &#8220;payload&#8221;, which is another object that contains the minimal information about what is getting updated or inserted or deleted. </p>


<p>Check out this example Action Object: </p>


<pre title="Action Ojbect" class="wp-block-code"><code lang="javascript" class="language-javascript line-numbers">[
	{
		type : 'ITEM_ADDED',
		payload : {
			id : 30,
			name : 'coffee'
			desc : 'drink'
		}
	},
	{
		type : 'ITEM_DELETED',
		payload : {
			id : 25
		}
	},
	{
		type : 'ITEM_UPDATED',
		payload : {
			id : 30,
			desc : 'warm clothing'
		}
	},
]</code></pre>


<p>You see how it contains only the minimal information in the payload. For example, when deleting an item, all you need is the ID. </p>


<p>So you create an action object each time you want to change the store. As mentioned, the action contains the type (what kind of change) and the payload (the actual changes) that you want.</p>


<p>But the Action alone doesn&#8217;t change the state. We&#8217;ll get to that.</p>


<p>Let&#8217;s move on the Store: </p>


<h3 class="wp-block-heading"><strong>2) Store</strong></h3>


<p>This is the single source of truth. It&#8217;s also a JavaScript object &#8211; and it&#8217;s immutable. Meaning we can&#8217;t edit it directly. In order for us to edit it, we need to call its dispatch() method, and pass in the action. </p>


<p>A store can be as simple as this:</p>


<pre title="Store" class="wp-block-code"><code lang="javascript" class="language-javascript">{
	User_data : {},
	Items : [],
	Categories : []
}</code></pre>


<p>But before we can even create a store, we have to have a reducer. Let&#8217;s move on to that.</p>


<h3 class="wp-block-heading"><strong>3) Reducers</strong></h3>


<p>So these are functions that mutate the store. Typically, you will have a reducer for each “slice” of the store. In the example store above, we should have 1 reducer for “<em>User_data</em>”, 1 reducer for “<em>Items</em>” and 1 reducer for &#8220;<em>Categories</em>&#8220;.  </p>


<p>Note that we don’t call the reducer directly. The store is responsible for calling the reducer, when we call the dispatch() method.</p>


<p>Here is a reducer for the &#8220;Items&#8221; in our store:  </p>


<pre title="Reducer" class="wp-block-code"><code lang="javascript" class="language-javascript">function ItemReducer(state, action){
	switch(action.type){
		case "ITEM_ADDED":
			return [
				...state,
				{
					id :lastId + 1,
					name : action.payload.name,
					description : action.payload.desc
				}
			]
		case "ITEM_DELETED"
		...
	}
}</code></pre>


<p>So think of the reducer as the blueprint on what should happen when you pass it an action. It looks at the action type, works with the action payload, and from this logic &#8211; returns a new state.  </p>


<p>So we now have a general idea of Redux&#8217;s building blocks, it&#8217;s time to put them together. Here are the steps on what you should do: </p>


<h2 class="wp-block-heading"><strong>Steps: </strong></h2>


<p>There is a strict way of putting together a Redux application. This is done to keep the integrity of the store. </p>


<ol class="wp-block-list"><li>Design store</li><li>Define actions</li><li>Create a reducer</li><li>Create the store and pass in the reducer <em>//by using createStore(reducer)</em></li></ol>


<p>Once you have the store, you should have access to it&#8217;s functions such as:</p>


<ul class="wp-block-list"><li>dispatch() <em>// function to mutate the store</em></li><li>getState() <em>// function go get the state</em></li><li>subscribe() <em>// listen to changes in the store</em></li></ul>


<p>Notice that there is only 1 method to mutate the store. It&#8217;s done this way to make things follow &#8220;pipeline&#8221; &#8211; all changes are done one way and one direction &#8211; to make things trackable and &#8220;subscribable&#8221;. </p>
<p>The post <a href="https://michaelsoriano.com/redux-a-quick-and-high-level-overview/">Just Redux &#8211; a quick and high-level overview</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/redux-a-quick-and-high-level-overview/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hello 2020! Plans, Goals and Forecasts</title>
		<link>https://michaelsoriano.com/hello-2020-plans-goals-and-forecasts/</link>
					<comments>https://michaelsoriano.com/hello-2020-plans-goals-and-forecasts/#comments</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Wed, 01 Jan 2020 00:01:57 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<guid isPermaLink="false">http://michaelsoriano.com/?p=7073</guid>

					<description><![CDATA[<p>I don&#8217;t normally do &#8220;goals for XXXX&#8221; type of posts. But looking back in my archive &#8211; I did one back in 2018. And the stuff that I listed as my goals &#8211; most of them I&#8217;ve achieved! So it just makes sense that I do one today (and today being the last day of [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/hello-2020-plans-goals-and-forecasts/">Hello 2020! Plans, Goals and Forecasts</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I don&#8217;t normally do &#8220;<em>goals for XXXX</em>&#8221; type of posts. But looking back in my archive &#8211; I did one back in <a href="https://michaelsoriano.com/goals-for-2018/">2018</a>. And the stuff that I listed as my goals &#8211; most of them I&#8217;ve achieved! So it just makes sense that I do one today (<em>and today being the last day of 2019</em>). Hopefully by then end of next year, I can look back and reflect. </p>


<p><img decoding="async" width="1370" height="869" src="https://michaelsoriano.com/wp-content/uploads/2020/08/undraw_new_decade_n4qd.png" alt="new year" class="wp-image-7231" srcset="https://michaelsoriano.com/wp-content/uploads/2020/08/undraw_new_decade_n4qd.png 1370w, https://michaelsoriano.com/wp-content/uploads/2020/08/undraw_new_decade_n4qd-300x190.png 300w, https://michaelsoriano.com/wp-content/uploads/2020/08/undraw_new_decade_n4qd-1024x650.png 1024w, https://michaelsoriano.com/wp-content/uploads/2020/08/undraw_new_decade_n4qd-768x487.png 768w" sizes="(max-width: 1370px) 100vw, 1370px" /></p>


<p>So here are my goals for 2020:</p>


<h3 class="wp-block-heading">Learn more AWS </h3>


<p>I&#8217;ve picked up a few technologies the past year. Salesforce being one, I got better with React and Node. I also dabbled with Python a little bit, along with a couple of frameworks such as Flask and Django. This year, it has to be more AWS. </p>


<p>AWS is not new to me. As a matter of fact, we use AWS heavily at work. But AWS is a beast. There&#8217;s so much that I don&#8217;t know. And I see AWS getting bigger than ever. </p>


<p>So my goal is to learn more AWS. Maybe even move my sites to it (if cost makes sense). And I could use more formal training &#8211; we use Pluralsight at work and they have a greate AWS track. I plan to learn services such as  Cognito, Lambda, API Gateways, EC2, Cloudformation etc.  </p>


<h3 class="wp-block-heading">Some Svelte</h3>


<p>This one is more a &#8220;good to have&#8221;. I am not so excited about learning just another front end framework, but Svelte JS is not &#8220;just another&#8221; framework. You see, unlike React or Vue &#8211; Svelte has a lot less boilerplate. It does not use a virtual DOM &#8211; and its more of a compiler &#8211; than a framework. </p>


<p>So writing Svelte apps seems to be more &#8220;natural&#8221; JavaScript apps. And I like the sound of that.</p>


<h3 class="wp-block-heading">Pickup Plant-based</h3>


<p>This one is obviously not a technology-based goal. But it&#8217;s probably the most important one on the list. I haven&#8217;t been the healthiest as far as my food choices. Matter of fact, I&#8217;ve been constantly gaining weight through the years. </p>


<p>Switching to a plant based diet is something that I&#8217;ve always wanted to do. It&#8217;s not going to be an easy task &#8211; coming from someone who&#8217;s been eating meat forever. I may not totally convert to a 100 percent plant based (at least not right away). But if I can do 4-5 days a week of no meat &#8211; that&#8217;s a big achievement for me.</p>


<h3 class="wp-block-heading">Write More Posts</h3>


<p>I&#8217;ve always written about web development, but this time around, I think I would like to talk about other things. </p>


<p>I don&#8217;t plan to ramble about things just to have new content. But things that I think is worth writing. I plan to have more categories such as health, food (I happen to cook) and maybe some business ideas. </p>


<p>So there you go. It&#8217;s not an extensive list, but rather a short and &#8220;doable&#8221; one. I also would like to do this yearly, so expect to see another one same time next year. </p>


<p>Good Bye 2019, you&#8217;ve been good to me. Happy New Year to all.</p>
<p>The post <a href="https://michaelsoriano.com/hello-2020-plans-goals-and-forecasts/">Hello 2020! Plans, Goals and Forecasts</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/hello-2020-plans-goals-and-forecasts/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Goals for 2018</title>
		<link>https://michaelsoriano.com/goals-for-2018/</link>
					<comments>https://michaelsoriano.com/goals-for-2018/#respond</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Wed, 03 Jan 2018 22:16:29 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<guid isPermaLink="false">http://michaelsoriano.com/?p=6367</guid>

					<description><![CDATA[<p>Setting goals for the year is something I do every year. The problem is, I keep it note of it all over the place. It&#8217;s in my calendar, Evernote, a Word doc, a Google doc! For 2018, I decided to publish it here. I&#8217;m hoping to not only that I meet all of them, but [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/goals-for-2018/">Goals for 2018</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Setting goals for the year is something I do every year. The problem is, I keep it note of it all over the place. It&#8217;s in my calendar, Evernote, a Word doc, a Google doc! For 2018,</p>
<p><img decoding="async" class="alignnone size-full wp-image-7765" src="https://michaelsoriano.com/wp-content/uploads/2022/07/goals.png" alt="goals" width="750" height="461" srcset="https://michaelsoriano.com/wp-content/uploads/2022/07/goals.png 750w, https://michaelsoriano.com/wp-content/uploads/2022/07/goals-300x184.png 300w" sizes="(max-width: 750px) 100vw, 750px" /></p>
<p>I decided to publish it here. I&#8217;m hoping to not only that I meet all of them, but also set a good track record in the years to come.</p>
<h4>Clean up Github repos</h4>
<p>This one has long been overdue. I have a lot of repositories in Github that need cleaning up. By this I mean fixing issues, upgrading documentation, moving files and even &#8211; deleting some of them. When Github started &#8211; it was all the rage. I started moving even my old code there. I never had the chance to look back and clean them up. This year, this will be one my top priorities. A leaner set of Github repos.</p>
<h4>Utilize GulpJS More</h4>
<p>I&#8217;ve used a couple of tooling technologies in the past. But I really like Gulp because of its simplicity. I realize some of my plug ins could really use Gulp. As part of the cleaning up (above), utilizing Gulp is going to be part of it. Not only that it will make the plug in easier to use &#8211; but it will also benefit me by learning more of this nifty tool.</p>
<h4>Adapt Bootstrap 4</h4>
<p>Bootstrap is the world&#8217;s mostly used responsive framework. At the time of writing &#8211; version 4 is still on beta, but it&#8217;s already widely adopted by many developers. Version 4 has a lot of rewrite, deprecated classes and components. One of the biggest differences is Flexbox. It also introduces the use of <em>ems</em> and <em>rems</em> in CSS as a form of measurement.  So by using Bootstrap 4 &#8211; I will also expose myself to both technologies.</p>
<h4>Finish WP-Vue Starter theme</h4>
<p>This one is almost done. I am a big proponent of VueJS, which I&#8217;ve used in a couple of small projects. This time, I wanted to combine it with WordPress. As many of you know, WordPress REST API has long been part of the core. It opens up many possibilities &#8211; especially in making WordPress an application framework. JavaScript and SPA&#8217;s is already big in the development community &#8211; so integrating it with WordPress is a good choice. Again, this is going to be out real soon so stay tuned.</p>
<h4>Learn OctoberCMS</h4>
<p>I saw a tutorial on OctoberCMS. I really liked it. It looks like its going to be a popular CMS &#8211; especially for developers. I am making it one of my goals to use it on a small site. And maybe create a theme for it. I have a friend who needs a portfolio for his photography &#8211; so I think this is a good time to use OctoberCMS.<br />
I&#8217;m keeping this list short so it&#8217;s more attainable. I might keep updating this post for my progress &#8211; if it becomes useful for myself or others.</p>
<p>The post <a href="https://michaelsoriano.com/goals-for-2018/">Goals for 2018</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/goals-for-2018/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>God Dangit Emmet! Where have you been all my life!</title>
		<link>https://michaelsoriano.com/god-dangit-emmet-where-have-you-been-all-my-life/</link>
					<comments>https://michaelsoriano.com/god-dangit-emmet-where-have-you-been-all-my-life/#respond</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Fri, 06 Jan 2017 19:14:41 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<guid isPermaLink="false">http://michaelsoriano.com/?p=6002</guid>

					<description><![CDATA[<p>HTML has always been one of the most cumbersome code to write. Open brackets, attributes, closing (or not closing) brackets &#8211; just tedious. Up until I was taking a small online course &#8211; and I see in the video, the developer was using these &#8220;shortcuts&#8221; to write HTML. This guy wasn&#8217;t doing opening nor closing [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/god-dangit-emmet-where-have-you-been-all-my-life/">God Dangit Emmet! Where have you been all my life!</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>HTML has always been one of the most cumbersome code to write. Open brackets, attributes, closing (or not closing) brackets &#8211; just tedious. Up until I was taking a small online course &#8211; and I see in the video, the developer was using these &#8220;shortcuts&#8221; to write HTML. This guy wasn&#8217;t doing opening nor closing tags. He wasn&#8217;t worried about attributes or classes. He was simply writing fast.<br />
I had to get this plugin.<br />
After some research &#8211; I discovered that he was using <a href="http://emmet.io/">Emmet</a>. What exactly is it? Well just like I&#8217;ve described, it&#8217;s a faster way of writing HTML and CSS. Significantly faster. It claims to be the &#8220;<em>the essential tool for web developers</em>&#8220;.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2017/01/emet-html.gif" alt="Emmet in HTML" width="595" height="306" class="alignnone size-full wp-image-6004" /><br />
As you can see, the number of characters I have to type is decreased by more than half.<br />
And that&#8217;s not all. Emmet supports things like multiplication:<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2017/01/emet-html-2.gif" alt="" width="595" height="306" class="alignnone size-full wp-image-6010" /><br />
You see how powerful that is!</p>
<h3>Enabling Emmet in Visual Studio Code:</h3>
<p>For VSCode, all you need is to activate this feature. Go to &#8220;<strong>File</strong>&#8221; > &#8220;<strong>Preferences</strong>&#8221; > &#8220;<strong>User Settings</strong>&#8220;. Under &#8220;<strong>Emmet</strong>&#8220;, you should see the following options:</p>
<pre language="javascript">
// When enabled, emmet abbreviations are expanded when pressing TAB.
"emmet.triggerExpansionOnTab": true,
// Preferences used to modify behavior of some actions and resolvers of Emmet.
"emmet.preferences": {},
// Define profile for specified syntax or use your own profile with specific rules.
"emmet.syntaxProfiles": {},
// An array of languages where emmet abbreviations should not be expanded.
"emmet.excludeLanguages": [],
</pre>
<p>Simply add a <strong>syntaxProfile</strong> &#8211; which associates a language id + an Emmet profile. I believe for HTML it&#8217;s already turned on by default. But by enabling it in JavaScript (such as using React), you have to take additional steps:</p>
<h3>Using Emmet in React:</h3>
<p>So first, add the syntaxProfiles like so:</p>
<pre language="javascript">
"emmet.syntaxProfiles": {
        "javascript": "html"
}
</pre>
<p>Now you have the ability to write HTML inside JavaScript files. But for React, there are certain words that reserved and you cannot use &#8211; such as &#8220;className&#8221; for &#8220;class&#8221;. You have to switch the language mode to &#8220;Javascript(React)&#8221;. Go to the bottom of the editor and click the language:<br />
The &#8220;<strong>Select Language Mode</strong>&#8221; will prompt &#8211; look for &#8220;Javascript(React)&#8221;, if it&#8217;s not there, you need to install the extension: <strong>Babel ES6/ES7</strong>.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2017/01/emmet-react.jpg" alt="" width="650" height="325" class="alignnone size-full wp-image-6013" srcset="https://michaelsoriano.com/wp-content/uploads/2017/01/emmet-react.jpg 650w, https://michaelsoriano.com/wp-content/uploads/2017/01/emmet-react-300x150.jpg 300w" sizes="(max-width: 650px) 100vw, 650px" /><br />
Now you can write HTML inside your components using Emmet. Remember, you can use this in any ES6 JavaScript files &#8211; not just React!<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2017/01/emet-react.gif" alt="Emmet in React" width="595" height="306" class="alignnone size-full wp-image-6003" /><br />
This is just the tip of what you can do with Emmet. Like I said, as soon as I used it &#8211; I became excited and wanted to share with the world!<br />
Don&#8217;t forget to checkout the <a href="http://docs.emmet.io/cheat-sheet/">Emmet Cheat Sheet</a> for a long list of what you can do with this tool. Happy Coding!</p>
<p>The post <a href="https://michaelsoriano.com/god-dangit-emmet-where-have-you-been-all-my-life/">God Dangit Emmet! Where have you been all my life!</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/god-dangit-emmet-where-have-you-been-all-my-life/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>JavaScript is eating the world of software&#8230;</title>
		<link>https://michaelsoriano.com/javascript-is-eating-the-world-of-software/</link>
					<comments>https://michaelsoriano.com/javascript-is-eating-the-world-of-software/#comments</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Fri, 13 May 2016 15:33:54 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<guid isPermaLink="false">http://michaelsoriano.com/?p=5717</guid>

					<description><![CDATA[<p>I was not always a big fan of Javascript. To me it was always just a &#8220;side&#8221; language that took care of the intricate details that server side languages couldn&#8217;t handle. Mostly DOM manipulations, browser events and such. Sending data back and forth client and server was always a GET and a POST &#8211; nothing [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/javascript-is-eating-the-world-of-software/">JavaScript is eating the world of software&#8230;</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I was not always a big fan of Javascript. To me it was always just a &#8220;side&#8221; language that took care of the intricate details that server side languages couldn&#8217;t handle. Mostly DOM manipulations, browser events and such. Sending data back and forth client and server was always a GET and a POST &#8211; nothing HTML and Server can&#8217;t handle.<br />
Until AJAX came along. Now we can grab, send data without refresh. Then JSON. Way easier to handle than XML.<br />
<img decoding="async" class="alignnone size-full wp-image-5729" src="https://michaelsoriano.com/wp-content/uploads/2016/05/jsfw.jpg" alt="jsfw" width="651" height="350" srcset="https://michaelsoriano.com/wp-content/uploads/2016/05/jsfw.jpg 651w, https://michaelsoriano.com/wp-content/uploads/2016/05/jsfw-300x161.jpg 300w" sizes="(max-width: 651px) 100vw, 651px" /><br />
Then we have jQuery &#8211; now browser inconsistencies are easy to fix. Animations &#8211; sure, no problem.<br />
I started seeing a pattern. All new technology revolving around JavaScript.<br />
It doesn&#8217;t stop there. Anyone heard of Node? Meteor? React?<br />
So now there is JavaScript running on the server. Big companies are using Node: <a href="http://techblog.netflix.com/2014/11/nodejs-in-flames.html">Netflix</a>​, <a href="https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/">Paypal</a>​, <a href="http://highscalability.com/blog/2012/10/4/linkedin-moved-from-rails-to-node-27-servers-cut-and-up-to-2.html">LinkedIn</a>​ (read the LinkedIn article with staggering performance results)<br />
Isomorphic JavaScript is rapidly evolving as the future of web app development. Naturally, this architecture makes a lot of sense. One language for client and server: JavaScript. I suggest reading the following articles:</p>
<ul>
<li><a href="https://www.lullabot.com/articles/what-is-an-isomorphic-application">What is an isomorphic application</a>?</li>
<li><a href="http://nerds.airbnb.com/isomorphic-javascript-future-web-apps/">Isomorphic JavaScript: the Future of Web Apps</a>​</li>
</ul>
<p>Destkop applications? The IDE that I use to write code for our SharePoint apps (<a href="http://electron.atom.io/">Atom</a>) is written in guess what? JavaScript! Yes, even Microsoft is on board with JavaScript &#8211; their new IDE called <strong>Visual Studio Code</strong> is built using <a href="http://electron.atom.io/">Electron </a>&#8211; the same Javascript framework that Atom was built on.<br />
<a href="https://www.meteor.com/">Meteor.js</a> is a powerful platform using the &#8220;<a href="http://mean.io/">MEAN</a>&#8221; stack. Yes &#8211; Angular folks!<br />
As for Databases? MongoDB (The &#8220;M&#8221; in MEAN) uses a type of data structure like &#8220;JSON&#8221; &#8211; which is JavaScript influenced.<br />
What about WordPress? Yes even WordPress is focusing heavily on Javascript. The built in REST API is in the works and will bring in a whole mass of possibilities for JavaScript Developers. Watch Matt Mullenweg&#8217;s <a href="http://wptavern.com/state-of-the-word-2015-javascript-and-api-driven-interfaces-are-the-future-of-wordpress">State of the Word 2015</a> speech where he emphasized loudly &#8220;Learn JavaScript&#8221;.<br />
<a href="https://facebook.github.io/react/">React </a>is a JS library that let&#8217;s you write web components for dynamic applications. Components that you build all inside JavaScript (without templating or string concat).<br />
<img decoding="async" class="alignnone size-full wp-image-5722" src="https://michaelsoriano.com/wp-content/uploads/2016/05/CE0Jp9_WMAI6eZB.jpg" alt="CE0Jp9_WMAI6eZB" width="515" height="656" srcset="https://michaelsoriano.com/wp-content/uploads/2016/05/CE0Jp9_WMAI6eZB.jpg 515w, https://michaelsoriano.com/wp-content/uploads/2016/05/CE0Jp9_WMAI6eZB-236x300.jpg 236w" sizes="(max-width: 515px) 100vw, 515px" /><br />
So where am I heading with all of this?<br />
The more I write JavaScript, the more I&#8217;m realizing how powerful this misunderstood language is. Lambdas, closures, higher order functions, prototypes &#8211; many concepts that are still tough to grasp &#8211; but really worth learning.<br />
JavaScript is now the language of my choice. And I see it eat the web (if it hasn&#8217;t already). A quote from one of my favorite programmers: <a href="https://ericelliottjs.com/">Eric Elliott</a>:</p>
<blockquote style="margin-top: 35px; margin-bottom: 35px;"><p>Software is eating the world, the web is eating software, and JavaScript rules the web</p></blockquote>
<p>Let me know your thoughts below.</p>
<p>The post <a href="https://michaelsoriano.com/javascript-is-eating-the-world-of-software/">JavaScript is eating the world of software&#8230;</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/javascript-is-eating-the-world-of-software/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Working with LESS, Atom and Chrome Developer Tools</title>
		<link>https://michaelsoriano.com/working-with-less-atom-and-chrome-developer-tools/</link>
					<comments>https://michaelsoriano.com/working-with-less-atom-and-chrome-developer-tools/#comments</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Mon, 26 Oct 2015 04:45:52 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Atom]]></category>
		<category><![CDATA[LESS]]></category>
		<guid isPermaLink="false">http://michaelsoriano.com/?p=5276</guid>

					<description><![CDATA[<p>One of the many ways to increase a developer&#8217;s productivity is to utilize tools such as LESS. LESS is a CSS pre-compiler that extends the capabilities of the CSS language. You can use variables, functions as well as nested rules &#8211; things that you cannot do in plain CSS. I&#8217;m not going to dig deep [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/working-with-less-atom-and-chrome-developer-tools/">Working with LESS, Atom and Chrome Developer Tools</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>One of the many ways to increase a developer&#8217;s productivity is to utilize tools such as LESS. <a href="http://lesscss.org/">LESS</a> is a CSS pre-compiler that extends the capabilities of the CSS language. You can use variables, functions as well as nested rules &#8211; things that you cannot do in plain CSS. I&#8217;m not going to dig deep into LESS &#8211; I suggest you go their website and find out more for yourself. Just trust me in saying &#8211; it will save you countless hours of writing CSS.<br />
<img decoding="async" class="alignnone size-full wp-image-5291" src="https://michaelsoriano.com/wp-content/uploads/2015/10/less-atom.jpg" alt="less-atom" width="700" height="278" srcset="https://michaelsoriano.com/wp-content/uploads/2015/10/less-atom.jpg 700w, https://michaelsoriano.com/wp-content/uploads/2015/10/less-atom-300x119.jpg 300w" sizes="(max-width: 700px) 100vw, 700px" /><br />
Now there is a couple of drawbacks to using LESS. One &#8211; you have to compile your .less files so it becomes .css. The other, is debugging. Since your CSS files are now a compiled version of your original code &#8211; debugging it in the browser can be a pain. The line numbers and and file names referenced are all in <strong>.css</strong> &#8211; not your <strong>.less</strong> files.</p>
<h6>Compiling</h6>
<p>Let&#8217;s tackle the first drawback: compiling less. Yes it&#8217;s a pain in the butt having to write your code, then going to the command line to compile. Since I use Atom for my editor, there is a plugin called <a href="https://atom.io/packages/less-autocompile">less-autocompile</a> which compiles our less files each time you save.<br />
First, start Atom, and download the package. Go to &#8220;<strong>File</strong>&#8220;, &#8220;<strong>Settings</strong>&#8220;, &#8220;<strong>Packages</strong>&#8220;.<br />
<img decoding="async" class="alignnone size-full wp-image-5282" src="https://michaelsoriano.com/wp-content/uploads/2015/10/less-0.jpg" alt="less-0" width="700" height="404" srcset="https://michaelsoriano.com/wp-content/uploads/2015/10/less-0.jpg 700w, https://michaelsoriano.com/wp-content/uploads/2015/10/less-0-300x173.jpg 300w" sizes="(max-width: 700px) 100vw, 700px" /><br />
Once installed, you can start writing your LESS code right away. Make sure you write a comment on the first line: &#8220;<strong>//out: styles.css</strong>&#8221; &#8211; so the plugin can know what and where to output your CSS file. Once you hit &#8220;<strong>Save</strong>&#8220;, you should see your new <strong>.css</strong> file created.<br />
<img decoding="async" class="alignnone size-full wp-image-5280" src="https://michaelsoriano.com/wp-content/uploads/2015/10/less-2.jpg" alt="less-2" width="700" height="404" srcset="https://michaelsoriano.com/wp-content/uploads/2015/10/less-2.jpg 700w, https://michaelsoriano.com/wp-content/uploads/2015/10/less-2-300x173.jpg 300w" sizes="(max-width: 700px) 100vw, 700px" /><br />
So how easy is that? No command line, no other software &#8211; just compile right in your editor. Note that you should check your IDE for a plugin that&#8217;s similar. I&#8217;m sure there are plenty out there.</p>
<h6>Debugging</h6>
<p>The second drawback is debugging. Let&#8217;s inspect our HTML and see the debugging problem that I was talking about previously.<br />
<img decoding="async" class="alignnone size-full wp-image-5285" src="https://michaelsoriano.com/wp-content/uploads/2015/10/chrome-tools.gif" alt="chrome-tools" width="671" height="489" /><br />
You see that the rule referenced goes back to our <strong>.css</strong> file! We need it to look into our <strong>.less</strong> file!<br />
Luckily, we have <a href="http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/">Sourcemaps</a> to the rescue. <strong>Sourcemaps</strong> is a way to map compiled / minified code back to its original source. This is especially useful for debugging and tracing code.<br />
Make sure in Chrome, that the &#8220;<strong>Enable CSS source maps</strong>&#8221; option is checked.<br />
<img decoding="async" class="alignnone size-full wp-image-5287" src="https://michaelsoriano.com/wp-content/uploads/2015/10/sourcemap-chrome1.jpg" alt="sourcemap-chrome1" width="598" height="478" srcset="https://michaelsoriano.com/wp-content/uploads/2015/10/sourcemap-chrome1.jpg 598w, https://michaelsoriano.com/wp-content/uploads/2015/10/sourcemap-chrome1-300x240.jpg 300w" sizes="(max-width: 598px) 100vw, 598px" /><br />
Now back to our Atom IDE, our plugin less-autompile also supports outputting sourcemaps on save. So back to the first line of comment in our <strong>.less</strong> file, add &#8220;<strong>sourcemap: true</strong>&#8220;. Now save the your .less file and a sourcemap file will be added.<br />
One thing I noticed though that I had to manually add another comment in the bottom of my .less file: &#8220;<strong>/*# sourceMappingURL=styles.css.map */</strong>&#8220;. This is to tell Chrome Developer tools where our .map file is.<br />
Now refresh the page that you&#8217;re inspecting and see the file it&#8217;s referencing to. Notice that its now pointing to our <strong>.less</strong> file! Problem solved.<br />
<img decoding="async" class="alignnone size-full wp-image-5288" src="https://michaelsoriano.com/wp-content/uploads/2015/10/sourcemap-chrome2.jpg" alt="sourcemap-chrome2" width="598" height="385" srcset="https://michaelsoriano.com/wp-content/uploads/2015/10/sourcemap-chrome2.jpg 598w, https://michaelsoriano.com/wp-content/uploads/2015/10/sourcemap-chrome2-300x193.jpg 300w" sizes="(max-width: 598px) 100vw, 598px" /><br />
In closing, knowing the right tools for doing your job is key to increased productivity. Web development is no different. Thanks to LESS, Atom and plugins such as less-autocompile, we are well on our way to CSS success.</p>
<p>The post <a href="https://michaelsoriano.com/working-with-less-atom-and-chrome-developer-tools/">Working with LESS, Atom and Chrome Developer Tools</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/working-with-less-atom-and-chrome-developer-tools/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
