<?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>AMY HAYWOOD &#187; Programming</title>
	<atom:link href="http://www.amyhaywood.com/category/content-category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.amyhaywood.com</link>
	<description>Dreamer. Doer. Designer. Programmer.</description>
	<lastBuildDate>Tue, 12 Nov 2019 13:13:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>A Modular Approach to WordPress Theming, Using Flexible Content</title>
		<link>http://www.amyhaywood.com/modular-wordpress-theming-flexible-content/</link>
		<comments>http://www.amyhaywood.com/modular-wordpress-theming-flexible-content/#comments</comments>
		<pubDate>Fri, 20 Feb 2015 14:00:00 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>

		<guid isPermaLink="false">http://www.amyhaywood.com/?p=3943</guid>
		<description><![CDATA[<p>I do a lot of WordPress Development. I wouldn&#8217;t necessarily consider myself a WordPress developer, I have experience on other platforms, but I use whatever tool will meet the client&#8217;s needs best. Recently, that means WordPress.</p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/modular-wordpress-theming-flexible-content/">A Modular Approach to WordPress Theming, Using Flexible Content</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>I do a lot of <a href="http://www.wordpress.org" title="Wordpress.org">WordPress</a> Development. I wouldn&#8217;t necessarily consider myself a WordPress developer, I have experience on other platforms, but I use whatever tool will meet the client&#8217;s needs best. Recently, that means WordPress.</p


<p>One of the things I&#8217;ve started doing is coding custom themes so they&#8217;re modular. What does this mean?</p>
<p>I just launched <a href="http://www.billseaver.com" title="Bill Seaver">billseaver.com</a>. On the home page, each &#8220;stripe&#8221; is considered a module. This gives Bill the freedom to rearrange the elements on the home page on the fly. If he has a podcast release that day, he can move the podcast stripe to the top, increasing its visibility.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/acf_flexible_content_demo.gif" alt="ACF Flexible Content Demo" class="alignnone size-full wp-image-3977" /><br />
<br clear="both" /></p>
<p>As a designer, I don&#8217;t feel like the design of the site is being compromised because I&#8217;ve designed how each section should look. It&#8217;s just providing more flexibility and more value to my customers accommodating their digital strategy.</p>
<hr class="space" />
<h3>So, how did I pull this off?<br /></h3>
<p>The trick is the <a href="http://www.advancedcustomfields.com/" title="Advanced Custom Fields">Advanced Custom Fields</a> (ACF) plugin. — It&#8217;s one of <a href="http://amyhaywood.com/8-wordpress-plugins-i-put-on-all-my-sites/" title="8 WordPress Plugins I Put on all my Sites">those WordPress Plug Ins I could not live without.</a> </p>
<p>Let&#8217;s walk through the setup.</p>
<hr class="space" />
<h3>Within WordPress</h3>
<p>I have the <a href="http://www.advancedcustomfields.com/pro" title="Advanced Custom Fields Pro Plugin">ACF Pro Plugin</a> installed. Once it&#8217;s activated, it gives you a <strong>Custom Fields</strong> nav item in the left sidebar. Click on that and then the <strong>Add a New Field</strong> button.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/new_field_in_acf.png" alt="Add a New Field within the Advanced Custom Fields plugin" class="alignnone size-full wp-image-3982" /></p>
<p>Let&#8217;s call this field group &#8220;Home Page&#8221; but you can really call it anything you like. This label is will be displayed on the &#8220;Edit Home Page&#8221; above our form fields.</p>
<div class="break-out">
<div class="large-6 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/field_group_name.png" alt="Naming the Field Group within ACF" class="alignnone size-full wp-image-3984" />
<div class="caption">On the new Field Group screen</div>
</p></div>
<div class="large-6 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/naming_flexible_content.png" alt="Naming Flexible Content Field" class="alignnone size-full wp-image-3998" /></p>
<div class="caption">How the field will be displayed on the Edit Home Page screen</div>
</p></div>
</div>
<hr class="space" />
<p>Before we start adding fields, let&#8217;s adjust our <strong>Location</strong> rules. I want this field group to display on the home page only. Meaning, Bill will have to click on <strong>Pages</strong> and then find the <strong>Home</strong> page to edit. There are several ways I could set the rules. </p>
<p>I could say if the <strong>Page is equal to Home</strong>.</p>
<div class="break-out">
<div class="large-12 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/options_location_page.png" alt="Locations within ACF" class="alignnone size-full wp-image-3986" />
	</div>
</div>
<p>or I could say if the <strong>Page Template is equal to Home</strong>.</p>
<div class="break-out">
<div class="large-12 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/options_location_page_template.png" alt="Locations Options within ACF" class="alignnone size-full wp-image-3987" />
	</div>
</div>
<p>Personally, I prefer the second option since the template itself is really dependent on these fields.</p>
<p>Then, in the <strong>Options</strong> box, below that, we can control the display and the other elements on the page. I try and hide all the elements I don&#8217;t need to minimize confusion:</p>
<ul>
<li>Content Editor (all content is within the stripes, no need for body copy which all means, no need for an Excerpt)</li>
<li>Excerpt</li>
<li>Comments</li>
<li>Author (don&#8217;t need to set an author for the home page)</li>
<li>Featured Image</li>
<li>Send Trackbacks</li>
<li>Custom Fields (this refers to the WordPress built in Custom Fields, not the Advanced Custom Fields we&#8217;re creating)</li>
<li>Format</li>
<li>Categories</li>
<li>Discussion</li>
<li>Tags</li>
</ul>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/acf_options.png" alt="Options within the Advanced Custom Fields" class="alignnone size-full wp-image-3988" /></p>
<p>Now for the fun part, the actual fields. Click the <strong>Add Field</strong> button. I&#8217;m going to name this &#8220;Home Page Content&#8221;, but call it whatever you like. </p>
<div class="break-out">
<div class="large-6 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/flexible_content_on_edit_screen.png" alt="The Flexible Content label within the Edit Page Screen" class="alignnone size-full wp-image-3983" /></p>
<div class="caption">On the new Field Group screen</div>
</p></div>
<div class="large-6 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/Screen_Shot_2015-02-19_at_9_12_45_PM.png" alt="Label on the Edit Home Page" class="alignnone size-full wp-image-4003" /></p>
<div class="caption">How the field will be displayed on the Edit Home Page screen</div>
</p></div>
</div>
<p><br clear="both" /></p>
<div class="box">
<h4>NOTE</h4>
<p>If you&#8217;re looking at my screenshots, I have a few other fields on the home page (background, subheading, and tertiary heading), in addition to the flexible content fields we&#8217;re creating. I don&#8217;t go into details about those fields, here, since our focus is on the flexible content.</p>
</div>
<p>You can see that the <strong>Field Name</strong> gets filled in automatically based on how you name the label field. I usually keep the default name unless it adds in dashes (&#8220;Home &#8211; Page&#8221; becomes home_-_page).</p>
<p>Select <strong>Flexible Content</strong> from the <strong>Field Type</strong> dropdown menu. </p>
<p>You can add instructions if you&#8217;d like. I usually leave this blank unless it&#8217;s a link (I&#8217;ll remind people to include the http://) or an image (I&#8217;ll include the image dimensions).</p>
<p>Within the <strong>Layout Row</strong> let&#8217;s start naming our stripes. We have 5.</p>
<p>Let&#8217;s name the first one &#8220;Receive Email Updates.&#8221; We don&#8217;t need any additional fields here since it&#8217;s simply a MailChimp Signup Form.</p>
<p>Click on the <strong>Add New</strong> link under Layout to add another row.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/acf_add_new_row.png" alt="Add New Layout Row" class="alignnone size-full wp-image-3991" /></p>
<p>Name this one &#8220;New Podcast&#8221;. It will automatically pull in the most recent podcast. The only additional fields we might need is a background image. Click on the <strong>Add Field</strong> button. Name it (Podcast Background Image) and select <strong>Image</strong> from the <strong>Field Type</strong> dropdown menu. In this particular case, I&#8217;m going to select the <strong>Image URL</strong> radio button, but the <strong>Image Array</strong> option is useful when you want to grab a particular size and include the alt text.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/podcast_background_image1.png" alt="Podcast Background Image within ACF" class="alignnone size-full wp-image-4005" /></p>
<p>Click on the <strong>Add New</strong> link under Layout to add another row. You get the idea. I went through the same process for the &#8220;Testimonials&#8221; (no input fields), &#8220;From the Blog&#8221; (no input fields), and the &#8220;Services&#8221; stripe with the following input fields:</p>
<ul>
<li>Column 1 Heading</li>
<li>Column 1 Content</li>
<li>Column 2 Heading</li>
<li>Column 2 Content</li>
<li>Column 3 Heading</li>
<li>Column 3 Content</li>
</ul>
<hr class="space" />
<h3>Within the Code</h3>
<p>Within my WordPress theme folder, I have a subfolder called <strong>partials</strong>. This includes smaller elements that I can reuse in other places on the site. In the case of Bill&#8217;s site, that folder contains a file for every stripe: </p>
<ul>
<li>stripe-email.php</li>
<li>stripe-podcast.php</li>
<li>stripe-services.php</li>
<li>stripe-testimonial.php</li>
<li>blog-excerpt.php</li>
</ul>
<div class="break-out">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/wordpress_theme_folder_structure.png" alt="Wordpress Theme Folder Structure" class="alignnone size-full wp-image-3993" /></p>
<div class="caption">
<p>You&#8217;ll see the folder structure in the left pane and the code for the services stripe on the right.</p>
</div>
</div>
<hr class="space" />
<div class="box">
<h4>NOTE</h4>
<p>You&#8217;ll notice the &#8220;From the Blog&#8221; stripe is not prepended with &#8220;stripe&#8221;, that&#8217;s because that element is not only used on the home page, it&#8217;s also used to display a blog excerpt on the archives, categories, and tags pages.</p>
</div>
<p>My <strong>page-home.php</strong> template has this code. I tried to include comments, explaining what each section does:</p>
<pre class="language-php"><code class="language-php">&lt;main class=&quot;main&quot; role=&quot;main&quot;&gt;
&lt;?php // open the WordPress loop
if (have_posts()) : while (have_posts()) : the_post();

	// are there any rows within within our flexible content?
	if( have_rows(&#39;home_page_content&#39;) ): 

		// loop through all the rows of flexible content
		while ( have_rows(&#39;home_page_content&#39;) ) : the_row();

		// EMAIL UPDATES
		if( get_row_layout() == &#39;receive_email_updates&#39; )
			get_template_part(&#39;partials/stripe&#39;, &#39;email&#39;);

		// NEW PODCAST
		if( get_row_layout() == &#39;new_podcast&#39; )
			get_template_part(&#39;partials/stripe&#39;, &#39;podcast&#39;);

		// SERVICES STRIPE
		if( get_row_layout() == &#39;services&#39; )
			get_template_part(&#39;partials/stripe&#39;, &#39;services&#39;);

		// TESTIMONIAL
		if( get_row_layout() == &#39;testimonials&#39; )
			get_template_part(&#39;partials/stripe&#39;, &#39;testimonial&#39;);

		// FROM THE BLOG
		if( get_row_layout() == &#39;from_the_blog&#39; )
			get_template_part(&#39;partials/blog&#39;, &#39;excerpt&#39;);

		endwhile; // close the loop of flexible content
	endif; // close flexible content conditional

endwhile; endif; // close the WordPress loop ?&gt;
&lt;/main&gt;
</code></pre>
<hr class="space" />
<div class="box">
<h4>NOTE</h4>
<p>You&#8217;ll notice that my <code>if</code> statements do not have brackets (<code>{</code> and <code>}</code>). They&#8217;re not needed since there&#8217;s only one line of code after the condition. However, if you need to add additional lines within the statement, be sure to insert those brackets!</p>
</div>
<p>If you see the <code>have_rows()</code> and <code>get_row_layout()</code> functions, that&#8217;s all ACF. You can get additional documentation for <a href="http://www.advancedcustomfields.com/resources/flexible-content/">the Flexible Content fields on ACF&#8217;s site</a>. </p>
<p>The <code>get_template_part()</code> function is built into WordPress (more information within the <a href="http://codex.wordpress.org/Function_Reference/get_template_part">WordPress Codex</a>). The first parameter of the function is the folder name (partials) and the first part of the file name before the dash (remember I named my files stripe-email.php?). The second parameter is the fiel name after the dash (email).</p>
<p>The <code>get_template_part()</code> function is great for other places in your WordPress themes, not just within Flexible Content. I mentioned the blog-excerpt.php snippet is also used within the <strong>archive.php</strong> template:</p>
<pre class="language-php"><code class="language-php">&lt;?php if (have_posts()): while (have_posts()) : the_post(); ?&gt;
	&lt;!-- article --&gt;
	&lt;article id=&quot;post-&lt;?php the_ID(); ?&gt;&quot; &lt;?php post_class(); ?&gt;&gt;
		&lt;?php get_template_part(&#39;partials/blog&#39;, &#39;post&#39;); ?&gt; 
	&lt;/article&gt;
	&lt;!-- /article --&gt;
&lt;?php endwhile; ?&gt;
</code></pre>
<hr class="space" />
<p>The beauty in this method is if I need to change the way the blog excerpt is being displayed, I only have to change one file! I don&#8217;t have to remember every place that a blog excerpt is being implemented.</p>
<hr>
<h3>Other implementations</h3>
<p>This modular method is also useful for formatting content. I used it on the <a href="/portfolio">portfolio section</a> of my site.</p>
<p>I knew each page would need a different format depending on whether it was a website or a print project and what assets I have for each. </p>
<div class="break-out">
<div class="large-6 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/Jimmy_Needham_Splash_Page_-_AMY_HAYWOOD__20150219_.jpg" alt="Jimmy Needham Splash Page " class="alignnone size-full wp-image-3995" /></p>
<div class="caption"><a href="/portfolio/jimmy-needham-splash-page/">Landing page for Jimmy Needham</a></div>
</div>
<div class="large-6 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/Small_Groups_Handbook_-_AMY_HAYWOOD__20150219_.jpg" alt="Small Groups Handbook" class="alignnone size-full wp-image-3996" /></p>
<div class="caption"><a href="/portfolio/small-groups-handbook/">Small Groups Handbook</a></div>
</div>
</div>
<p><br clear="both" /></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/modular-wordpress-theming-flexible-content/">A Modular Approach to WordPress Theming, Using Flexible Content</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/modular-wordpress-theming-flexible-content/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Getting your Git On: A Beginner&#8217;s Guide to Git</title>
		<link>http://www.amyhaywood.com/beginners-guide-git/</link>
		<comments>http://www.amyhaywood.com/beginners-guide-git/#respond</comments>
		<pubDate>Mon, 16 Feb 2015 14:00:00 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[bitbucket]]></category>
		<category><![CDATA[beanstalk]]></category>

		<guid isPermaLink="false">http://www.amyhaywood.com/?p=3895</guid>
		<description><![CDATA[<p>What is git anyway? Short answer: version control. Long answer: Think of it as having unlimited undos on your code. Or better yet, if you’re collaborating with another developer, it allows you to both work on the same project without overwriting each other’s code. Awesome! This has saved my butt on more than one occasion.... <a class="view-article" href="http://www.amyhaywood.com/beginners-guide-git/">View Article</a></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/beginners-guide-git/">Getting your Git On: A Beginner&#8217;s Guide to Git</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>What is git anyway? Short answer: version control. Long answer: Think of it as having unlimited undos on your code. Or better yet, if you’re collaborating with another developer, it allows you to both work on the same project without overwriting each other’s code. Awesome!</p>
<p>This has saved my butt on more than one occasion. I’ve vowed to always use source control, regardless of how big or small the project is.</p>
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/header-git.png" alt="git" class="alignnone size-full wp-image-3910" /></div>
<p>So, now that you’re interested in git, where do you begin? To get started, you’ll need to install git on your local machine (don’t worry, I’ll explain). Eventually, you’ll want to use an online service to store your code, like <a href="http://www.github.com" title="GitHub">GitHub</a>, <a href="http://www.bitbucket.com" title="BitBucket">BitBucket</a>, or <a href="http://beanstalkapp.com/" title="Beanstalk App">Beanstalk</a>. (more on that below, too)</p>
<hr class="space" />
<hr />
<h2>Installing git Locally</h2>
<div class="box">
<h4>NOTE:</h4>
<p>I use a Mac, so unfortunately, I can only speak to that. However, if you’re using another operating system try <a href="http://git-scm.com/book/en/v2/Getting-Started-Installing-Git" title="Installing git">looking here.</a></p>
</div>
<p>The easiest way to to install Git on your Mac (if you’re on Mavericks or older) is to install the XCode Command Line Tools. This is as simple as trying to run <em>git</em> from the Terminal. </p>
<div class="box">
<h4>NOTE:</h4>
<p>Remember, when you’re working in the Command Line, the dollar sign ($) is the prompt and signifies a new line. No need to copy it.</p>
</div>
<pre class="language-terminal"><code class="language-terminal">$ git</code></pre>
<p>If you don’t have git installed already, it will prompt you to do so.</p>
<p>If you want a more up to date version, or would rather run the binary installer, you can grab that <a href="http://git-scm.com/download/mac" title="Binary git installer">here</a>.</p>
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/git-osx-installer.png" title="Binary Installer for git on the Mac"/></div>
<p><a name="git-settings" id="git-settings"></a></p>
<p>The first thing you’ll want to do is configure your git settings.</p>
<pre class="language-terminal"><code class="language-terminal">$ git config --global user.name &quot;John Doe&quot;
$ git config --global user.email &quot;john@doe.org&quot;
$ git config --global color.ui auto</code></pre>
<hr />
<p>Git is typically run from the Terminal. However, as a designer, I tend to be a little leary of the Termianal. Granted I’ve <a href="http://www.amyhaywood.com/getting-started-with-the-terminal/" title="Getting Started with the Terminal">gotten more comfortable</a>, but I still prefer a GUI (Graphical User Interface) when I can get one.</p>
<p>I think the easiest thing to do is learn the vocabulary. Then, it doesn’t matter whether it’s the Terminal or GUI, the same concepts apply no matter what.</p>
<hr />
<h2>Learning the vocabulary</h2>
<div class="box">
<h4>NOTE</h4>
<p><a href="http://www.git-tower.com/blog/git-cheat-sheet/" title="Git Cheat Sheet">Here’s a cheat sheet</a> you can print out and keep handy.</p>
</div>
<p>Let’s walk through this as you would for a real project.</p>
<p>You’ll want to create a folder on your computer for your project. In my user folder, I have a folder called <strong>Code</strong>. Then, a subfolder called <strong>GIT</strong>. I keep all my project folders there.</p>
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/folder-structure.png" alt="Code &gt; Git folder structure" class="alignnone size-full wp-image-3928" /></div>
<p>If you’re trying to do everything from the command line, these commands create a new folder and then navigates inside:</p>
<pre class="language-terminal"><code class="language-terminal">$ mkdir new_project
$ cd new_project</code></pre>
<p>Let’s <strong>init</strong>iatize our git repository. (All your git projects are called repositories.)</p>
<pre class="language-terminal"><code class="language-terminal">$ git init</code></pre>
<p>So what does initializing really do? It creates an <em>empty</em> repository in a hidden folder, <strong>.git</strong>. </p>
<div class="box">
<h4>NOTE:</h4>
<p>If you ever wanted to remove the repository, all you’d need to do is delete that .git subdirectory:</p>
<pre class="language-terminal"><code class="language-terminal">$ git rm -rf .git</code></pre>
</div>
<p>Notice, I said <em>empty</em>. It did <em>not</em> add the current content within your folder. You have to tell it to do that yourself.</p>
<p>All the content within your project folder is considered the <strong>working copy</strong>. Once you get to a place where you want to save those files, you’ll <strong>stage</strong> your changes and then <strong>commit</strong> them to your local repository.</p>
<hr class="space" />
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/workflow.png" title="Working Copy, Staging, Local Repository"/></div>
<hr class="space" />
<p>The advantage here is not all of the files you’ve modified since your last commit have to be staged and committed.</p>
<hr class="space" />
<h4>Status</h4>
<p>Let’s get an overview of everything that has changed since we last committed:</p>
<pre class="language-terminal"><code class="language-terminal">git status</code></pre>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/git_status.png" alt="git status" class="alignnone size-full wp-image-3922" /></p>
<p>Git will put your changes into three main categories:</p>
<ul>
<li>Changes not staged for commit</li>
<li>Changes to be committed</li>
<li>Untracked files</li>
</ul>
<hr class="space" />
<h4>Add</h4>
<p>You can add all these changes by using:</p>
<pre class="language-terminal"><code class="language-terminal">git add .</code></pre>
<p>If you don’t want to add the changes you’ve made, but cherry pick files, you can list them out:</p>
<pre class="language-terminal"><code class="language-terminal">git add assets/dist/css/main.css assets/dist/js/production.js</code></pre>
<hr class="space" />
<h4>Remove</h4>
<p>If we removed a file, we’d need to confirm that too:</p>
<pre class="language-terminal"><code class="language-terminal">git rm something.html</code></pre>
<hr class="space" />
<h4>Commit</h4>
<p>Now, let’s commit our updates:</p>
<pre class="language-terminal"><code class="language-terminal">git commit -m &quot;Initial commit&quot;
</code></pre>
<p>The first commit, I usually title as “Initial commit” but as you continue to make changes and commit your code, you’ll want these messages to be meaningful. This will make it easier for you (or your teammates) to understand the changes you made later down the road.</p>
<p>Your message should include information like, “What was the motivation for the change? How does this differ from the previous version?”</p>
<p>If you need a longer commit message than 50 characters, you can leave out the “-m” parameter and Git will open an editor application for you to write a longer message.</p>
<p>Here are a few guidelines from <a href="http://www.git-tower.com/learn/ebook/command-line/basics/working-on-your-project#start">Tower’s eBook, <em>Learn Version Control with Git</em></a>:</p>
<ol>
<li><strong>Related Changes</strong> A commit should only contain changes from a single topic. Don’t mix up contents from different topics. This will make it harder to understand what happened.</li>
<li><strong>Completed Work</strong> Never commit something that is half-done. If you need to save your current work temporarily in something like a clipboard, you can use Git’s “Stash” feature. But don’t eternalize it in a commit.</li>
<li><strong>Tested Work</strong> You shouldn’t commit code that you <em>think</em> is working. Test it well — and before you commit it to the repository.</li>
<li><strong>Short and Descriptive Messages</strong> A good commit also needs a good message.</li>
</ol>
<hr class="space" />
<h4>Log</h4>
<p>If you want to review a history of all the commits that have been made to a project:</p>
<pre class="language-terminal"><code class="language-terminal">git log</code></pre>
<p>You’ll see a list in chronological order, beginning with the newest item.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/git_log.png" alt="git log" class="alignnone size-full wp-image-3921" /></p>
<p>If there are more items than what can be displayed on one page, you’ll see a : at the bottom of the screen. You can go to the next page by hitting the &lt;SPACE&gt; key and quit with “q”.</p>
<p>You’ll notice from the log, every commit has:</p>
<ul>
<li><strong>Commit Hash</strong> This is that crazy long string of letters and numbers (i.e. aa093b890c78e9d0869a3f267b2530cf2cbeb83f)</li>
<li><strong>Author Name and Email</strong> Remember when we set our name and email address within the <a href="#git-settings">git configurations above</a>? This is where it gets used.</li>
<li><strong>Date</strong></li>
<li><strong>Commit Message</strong></li>
</ul>
<hr class="space" />
<h4>Remote</h4>
<p>Now that we’ve made a bunch of commits, let’s publish (or push) them online. First we need to tell Git where our <strong>remote</strong> repository is.</p>
<p>There’s several services you can use, three of the most popular ones are:</p>
<ul>
<li><a href="http://www.github.com">GitHub</a></li>
<li><a href="http://www.bitbucket.com">BitBucket</a></li>
<li><a href="http://beanstalk.com">Beanstalk</a></li>
</ul>
<p>I go into <a href="#remote-repositories">a little more detail on each service’s features below.</a></p>
<p>Regardless of the service you use, when you create a repository, they will give you an SSH address and HTTPS address.</p>
<p>You can use either:</p>
<pre class="language-terminal"><code class="language-terminal">$ git remote add origin git@bitbucket.org:ahhacreative/git_blog_post.git
</code></pre>
<p>OR</p>
<pre class="language-terminal"><code class="language-terminal">$ git remote add origin https://ahhacreative@bitbucket.org/ahhacreative/git_blog_post.git
</code></pre>
<p>In this case, we named our remote repository “origin.” This is the default within Git. However, I could just as easily name it something else. I usually name mine based on where the remote repository is. This makes it easy within Tower (my GUI of choice) to tell where it’s being saved:</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/tower_remote.png" alt="Git Remotes on Tower" class="alignnone size-full wp-image-3925" /></p>
<p>From the command line:</p>
<pre class="language-terminal"><code class="language-terminal">$ git remote add BITBUCKET git@bitbucket.org:ahhacreative/git_blog_post.git</code></pre>
<p>You can see a list of all your remotes:</p>
<pre class="language-terminal"><code class="language-terminal">git remote -v</code></pre>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/git_remote.png" alt="git remotes" class="alignnone size-full wp-image-3918" /></p>
<p>You’ll notice there are two URLs listed (fetch and push). One is for read access (fetch) and the other is for write (push). Uusally, the two URLs are the same, but you could use different URLs for security and performance issues.</p>
<hr class="space" />
<h4>Push</h4>
<p>Now, we need to <strong>push</strong> our code up to our remote:</p>
<pre class="language-terminal"><code class="language-terminal">$ git push origin master</code></pre>
<p>Hopefully, some of these things are starting to look familiar. <strong>origin</strong> is the name of the remote repository and <strong>master</strong> is the name of our branch. (We haven’t talked about branching yet. It’s OK, just trust me for now, but <a href="#branching">it’s coming</a>.)</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/git_push.png" alt="git push" class="alignnone size-full wp-image-3920" /></p>
<p>Let’s pause for a moment. I just want to take a moment to point out: you’re more than halfway there! It wasn’t that hard, was it?! You know everything you need to know to save, commit, and publish your files online! There’s still more topics to cover, but you already know the basics. That’s worth celebrating!</p>
<hr class="space" />
<h4>Pull</h4>
<p>OK. So far, we’ve just published our changes online. But, what if we’re collaborating with another developer? They’re publishing their changes too. How do we <strong>pull</strong> down there code?</p>
<p>First you may want to see what you’re pulling:</p>
<pre class="language-terminal"><code class="language-terminal">$ git fetch origin
$ git log origin/master</code></pre>
<p>If you want to integrate these changes into your local working copy:</p>
<pre class="language-terminal"><code class="language-terminal">$ git pull</code></pre>
<p>If you have multiple remotes and branches, you may need to specify:</p>
<pre class="language-terminal"><code class="language-terminal">$ git pull origin master</code></pre>
<hr class="space" />
<a id="branching" name="branching"></a></p>
<h4>Branching</h4>
<p>OK, so let’s (finally) talk about branching.</p>
<p>When you’re coding, there are usually several different contexts or “topics” you’re working with:</p>
<ul>
<li>features</li>
<li>bug fixes</li>
<li>experiments</li>
</ul>
<p>In the real world, these all happen simultaneously. You’re trying to fix a bug while a teammate is working on the new about page design.</p>
<p>If branching didn’t exist, how would you integrate some of these changes, but not all of them? You need to post the code for the bug fix, but your teammate isn’t ready to launch the new about page. You find out the new “members only” code you’ve been working on is going in a different direction, but you’ve already integrated that code in with everything else. How do you separate it out?</p>
<hr class="space" />
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/no_branches.jpg" alt="no git branches" class="alignnone size-full wp-image-3917" /></div>
<hr class="space" />
<p>Branching!</p>
<p>You can create a branch to handle each of these topics. It stays separate from all the other contexts. When you make changes, they only apply to the current active branch.</p>
<hr class="space" />
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/branching.png" alt="git branching" class="alignnone size-full wp-image-3911" /></div>
<hr class="space" />
<p>Your current branch can be referred to as the <strong>active</strong> branch, <strong>checked out</strong> branch, or <strong>HEAD</strong> branch. They all mean the same thing.</p>
<p>Whenever you run <code>git status</code>, it will tell you what branch you’re currently on.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/current_branch.png" alt="current branch by running git status" class="alignnone size-full wp-image-3916" /></p>
<div class="box">
<h4>NOTE</h4>
<p>You may have noticed from my screenshots, that my Terminal shows me what branch I’m in and changes color based on whether I’ve there are uncommitted files or not.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/git_ohmyzsh.png" alt="git inside iTerms2 and oh my zsh" class="alignnone size-full wp-image-3923" /></p>
<p>I’m running <a href="https://github.com/robbyrussell/oh-my-zsh" title="Oh My Zsh">Oh My Zsh</a> within <a href="http://iterm2.com/" title="iTerm2">iTerm2</a>. I have more details in <a href="">a blog post.</a></p>
</div>
<p>To create a new branch:</p>
<pre class="language-terminal"><code class="language-terminal">$ git branch feature/about-page</code></pre>
<p></p>
<div class="box">
<h4>NOTE:</h4>
<p>I like to name my branches my contexts. So, you’ll notice, I prepended my branch name (about-page) with “feature.” This is nice because within Tower, it treats these contexts as folders:</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/branches_in_tower.png" alt="branches within Tower" class="alignnone size-full wp-image-3912" />
</div>
<p>We’ve created a branch, but it’s still not our current branch. To change branches, you’ll need to <strong>checkout</strong>:</p>
<pre class="language-terminal"><code class="language-terminal">$ git checkout -b feature/about-page</code></pre>
<p>To view a list of all our branches:</p>
<pre class="language-terminal"><code class="language-terminal">$ git branch -v</code></pre>
<p>The <code>-v</code> (verbose) flag, provides more information, than just <code>git branch</code>.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/git_list_branches.png" alt="git list branches" class="alignnone size-full wp-image-3913" /></p>
<p>Now, that you know how to create and change branches. What happens when you’re ready to commit that code to your main (master) branch?</p>
<p>First, you’ll want to navigate to your master branch. Then, merge in your new branch:</p>
<pre class="language-terminal"><code class="language-terminal">$ git checkout master
$ git merge feature/about-page</code></pre>
<p>Once a branch is merged and deployed, you no longer need it. To delete a local branch:</p>
<pre class="language-terminal"><code class="language-terminal">$ git branch -d feature/about-page </code></pre>
<hr class="space" />
<h4>Stashing</h4>
<p>Remember when we talked about not committing half done work? How do you get around that?</p>
<p>Stashing.</p>
<p><a href="http://www.git-tower.com/learn/ebook/command-line/branching-merging/stashing#start" title="Stash on git-tower.com">git-tower.com</a> explains it well:</p>
<blockquote><p>Think of the Stash as a clipboard on steroids: it takes all the changes in your working copy and saves them for you on a new clipboard. You’re left with a clean working copy, i.e. you have no more local changes.</p>
</blockquote>
<p>To stash your local changes:</p>
<pre class="language-terminal"><code class="language-terminal">$ git stash</code></pre>
<p>To see an overview of all your current stashes:</p>
<pre class="language-terminal"><code class="language-terminal">$ git stash list</code></pre>
<p>The most recent Stashes will always be listed first.</p>
<p>When you want to apply a Stash, you can run:</p>
<pre class="language-terminal"><code class="language-terminal">$ git stash pop</code></pre>
<p>This will pull the latest Stash and clear it from your clipboard. Or</p>
<pre class="language-terminal"><code class="language-terminal">$ git stash apply &lt;StashName&gt;</code></pre>
<p>This pulls the specified Stash, but unlike <code>pop</code>, it remains saved. To delete it, you’ll need to run <code>git stash drop &lt;StashName&gt;</code></p>
<hr class="space" />
<h4>Clone</h4>
<p>These things are all great, but what if you’re not starting from scratch? What if you’re joining a project that already exists? </p>
<p>Then, you’ll want to use <code>clone</code>.</p>
<pre class="language-terminal"><code class="language-terminal">$ git clone https://ahhacreative@bitbucket.org/ahhacreative/git_blog_post.git</code></pre>
<p>This will automatically set the remote to the “origin.” Anytime you <code>pull</code>, it will grab any updates made to the repository.</p>
<p>Sometimes, you’ll want to grab the code from a repository, but start with a clean history. To do so, simply add the flag <code>--bare</code>:</p>
<pre class="language-terminal"><code class="language-terminal">$ git clone --bare https://ahhacreative@bitbucket.org/ahhacreative/git_blog_post.git</code></pre>
<hr class="space" />
<h4>.gitignore</h4>
<p>There will be times when you don’t want to put all your code within your repository. For example, if you’re using bower, you probably don’t want the <strong>bower_components</strong> folder. Or, if you’re running grunt or gulp, you don’t need <strong>node_modules</strong>. A teammate only needs to run <code>bower init</code> or <code>npm install</code> to get those files. Committing them would only bloat your repository.</p>
<p>You can create a file called <code>.gitignore</code> and list all the files or folders to exclude. For example, here’s my .gitignore file for a WordPress project:</p>
<p><script src="https://gist.github.com/ahaywood/8f12eee136d9de33fd29.js"></script></p>
<hr />
<p><a id="remote-repositories" name="remote-repositories"></a></p>
<h2>Remote Repositories</h2>
<p>There are several services that you can use to host your remote repositories.</p>
<hr class="space" />
<h4>GitHub</h4>
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/github.png" alt="GitHub" class="alignnone size-full wp-image-3915" /></div>
<p><a href="http://github.com">GitHub</a> is probably the most popular. If you make your repositories public, then you can create an unlimited number of repositories for free. You start paying when you create private repositories.</p>
<p>GitHub also has an excellent <a href="https://github.com/features">issue tracker built in</a> among several other great resources.</p>
<p>Even if you don’t plan on paying for a GitHub account, I would highly recommend signing up for an account anyway. GitHub has practically become a standard for developers. Meaning, if you’re applying for a programming job, your potential employer could ask to see examples on GitHub.</p>
<hr class="space" />
<h4>BitBucket</h4>
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/bitbucket.png" alt="BitBucket" class="alignnone size-full wp-image-3914" /></div>
<p>I actually store all my code on <a href="http://www.bitbucket.com">BitBucket</a>. BitBucket does everything that GitHub does, but is missing the community that surrounds GitHub.</p>
<p>For me, the decision came down to $$. GitHub’s business model revolves around the number of private repositories you create. BitBucket’s bases its pricing tiers on the number of users. As long as you have under 5 users, it’s free.</p>
<p>As a one-woman web shop, I was easily in the top tier with GitHub. But, with BitBucket, I can have as many free private repositories as I want. That’s a no brainer.</p>
<hr class="space" />
<h4>BeanStalk</h4>
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/beanstalk.png" alt="Beanstalk App" class="alignnone size-full wp-image-3909" /></div>
<p><a href="http://beanstalkapp.com" title="Beanstalk">BeanStalk</a> is another great service. Like GitHub, you’re paying based on the number of repositories you use. </p>
<p>It’s missing a lot of the features that the other two services provide, but the biggest benefit it has is built in deployment. Meaning, you can push changes to your repository and it will automatically send those updates to your server via FTP (or however you specify). That’s almost enough to make me switch. </p>
<p>In the meantime, I’m using <a href="http://dploy.io" title="dploy.io">dploy.io</a> instead. It’s made by the same company (WildBit) that makes Beanstalk. Dploy.io allows you to deploy commits from BitBucket or GitHub. Pricing is based on the number of repositories you’ve connected. </p>
<hr />
<h2>The Apps</h2>
<p>OK, now that you know the correct terminology, I want to introduce a few GUIs:</p>
<hr class="space" />
<h4>Tower</h4>
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/towerapp.png" alt="Tower App" class="alignnone size-full wp-image-3933" /></div>
<p>I use <a href="http://www.git-tower.com/" title="Tower App">Tower</a>. IMHO, it’s the best. Just from glancing at the screenshot, you can see the buttons along the top for most of the vocabulary terms covered in this post. If you want a little more information, check out this screencast (from the Tower app team):</p>
<p><iframe width="900" height="506" src="http://www.youtube.com/embed/cyyuqf1m-2E?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<hr class="space" />
<h4>GitHub</h4>
<div class="break-out"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/02/github_app.png" alt="GitHub on Mac" class="alignnone size-full wp-image-3932" /></div>
<p><a href="https://mac.github.com/" title="GitHub for the mac">GitHub has their own GUI.</a> Unlike Tower, it’s free. I’ve downlaoded it, but I rarely use it since I have Tower. </p>
<p>At the end of the day, it’s whatever you’re the most comfortable with. They all accomplish the same thing. My thing is don’t let the tools get in the way of making cool stuff.</p>
<hr class="space" />
<hr />
<h2>Additional Resources</h2>
<p>Granted, we’ve covered the basics, it should be enough to get you up and going. However, if you want to dig a little deeper, here are a few additional resources to check out:</p>
<ul>
<li><a href="http://www.git-tower.com/learn/">Learn Git from the people that make Tower</a></li>
<li><a href="https://try.github.io/levels/1/challenges/1">Try Git</a> &#8211; This is a resource created by <a href="https://www.codeschool.com/" title="Code School">CodeSchool</a>. It’s pretty great since it’s interactive. You can type commands into their web interface for feedback.</li>
</ul>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/beginners-guide-git/">Getting your Git On: A Beginner&#8217;s Guide to Git</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/beginners-guide-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My SASS Extends, Mixins, and Functions</title>
		<link>http://www.amyhaywood.com/my-sass-extends-mixins-and-functions/</link>
		<comments>http://www.amyhaywood.com/my-sass-extends-mixins-and-functions/#comments</comments>
		<pubDate>Wed, 04 Feb 2015 02:26:49 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[sass]]></category>

		<guid isPermaLink="false">http://www.amyhaywood.com/?p=3900</guid>
		<description><![CDATA[<p>Last week, I wrote a little post about the SASS I have running on my site. Continuing on, I thought I’d share my SASS broilerplate with some of the mixins, functions, and extends. Naming Breakpoints In my SASS breakpoints file, I’m using Chris Coyier’s Breakpoint trick. — It’s a mixin within _2_helpers / _breakpoints.scss file.... <a class="view-article" href="http://www.amyhaywood.com/my-sass-extends-mixins-and-functions/">View Article</a></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/my-sass-extends-mixins-and-functions/">My SASS Extends, Mixins, and Functions</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Last week, I wrote a little post about <a href="http://www.amyhaywood.com/sites-sass-pants/" title="My SASS(y Pants)">the SASS I have running on my site</a>. Continuing on, I thought I’d share my SASS broilerplate with some of the mixins, functions, and extends.</p>
<hr />
<h2>Naming Breakpoints</h2>
<p>In my SASS breakpoints file, I’m using <a href="http://css-tricks.com/naming-media-queries/">Chris Coyier’s Breakpoint trick</a>. — It’s a mixin within <strong>_2_helpers / _breakpoints.scss</strong> file. It takes a break point name and builds out the media query for me.</p>
<pre class="language-css"><code class="language-css">@mixin breakpoint($point) 		{
	@if $point == zurb-xxlarge {
		@media (max-width: 1921px) { @content; }
	}
	@if $point == large-screen {
		@media (max-width: 1600px) { @content; }
	}
	@if $point == zurb-xlarge {
		@media (max-width: 1441px) { @content; }
	}
	@else if $point == retina {
		@media (-webkit-min-device-pixel-ratio: 2), screen and (max--moz-device-pixel-ratio: 2) { @content; }
	}
	@else if $point == regular-screen {
		@media (max-width: 1250px) { @content; }
  	}
  	@else if $point ==  zurb-medium {
		@media (max-width: 1024px)  { @content; }
  	}
	@else if $point ==  smaller-screen {
		@media (max-width: 800px)  { @content; }
  	}
	@else if $point ==  ipad-portrait {
		@media (max-width: 768px)  { @content; }
	}
	@else if $point ==  zurb-small {
		@media (max-width: 640px)  { @content; }
	}
	@else if $point ==  iphone-four {
		@media (max-width: 360px)  { @content; }
	}
	@else if $point ==  iphone {
		@media (max-width: 320px)  { @content; }
	}
}
</code></pre>
<p>I name my breakpoints according to the device (I know. I know.) I’m using: <code>ipad-landscape</code>, <code>ipad-portrait</code>, <code>smaller-screen</code>, <code>iphone</code>. I know the world exists outside of Apple and we are becoming (if not there already) device independent. However, I <em>think</em> in those dimensions.</p>
<p>I also have breakpoints for <code>zurb-medium</code> and <code>zurb-small</code>. I use the <a href="http://foundation.zurb.com/docs/">Zurb Foundation</a> framework and those breakpoints already exist within the framework. Since, the grid is already collapsing at those points, I need to be able to make adjustments in my code as well.</p>
<p>When I want to implement these breakpoints within my SASS, it will look like this:</p>
<pre class="language-css"><code class="language-css">.something {
	padding: 100px;

	@include breakpoint(zurb-small) {
		padding: 10px;
	}
}
</code></pre>
<p>I have <a href="http://www.amyhaywood.com/sublime-text-brain-dump/" title="A Brain Dump on Sublime Text 3">a snippet set up Sublime Text 3</a> that makes this really easy to implement.</p>
<hr class="space" />
<hr />
<h2>Arrows</h2>
<p>On CSS-Tricks, there’s <a href="http://css-tricks.com/snippets/css/css-triangle/">a post about creating triangles</a> in pure CSS. I decided to turn that into a mixin.</p>
<pre class="language-css"><code class="language-css">@mixin arrow ($direction, $size, $color) {
	@if $direction == up {
		border-left: $size solid transparent;
		border-right: $size solid transparent;
		border-bottom: $size solid $color;
	} @else if $direction == down {
		border-left: $size solid transparent;
		border-right: $size solid transparent;
		border-top: $size solid $color;
	} @else if $direction == right {
		border-top: $size solid transparent;
		border-bottom: $size solid transparent;
		border-left: $size solid $color;
	} @else if $direction == left {
		border-top: $size solid transparent;
		border-bottom: $size solid transparent;
		border-right:$size solid $color;
	}
}
</code></pre>
<p>Then, when I want to implement it:</p>
<pre class="language-css"><code class="language-css">.read-more { 
		&amp;:before {
			@include arrow (right, 3px, black);
		}
}
</code></pre>
<p>That’s easy enough.</p>
<hr class="space" />
<hr />
<h2>Color</h2>
<p>I have a set of functions for dealing with color:</p>
<pre class="language-css"><code class="language-css">@function darkest( $color ) 	{ @return darken($color,20%); }
@function darker( $color ) 		{ @return darken($color,13.333%); }
@function dark( $color ) 		{ @return darken($color,6.667%); }
@function light( $color ) 		{ @return lighten($color,16.667%); }
@function lighter( $color ) 	{ @return lighten($color,33.333%); }
@function lightest( $color ) 	{ @return lighten($color,50%); }
</code></pre>
<p>I can easily make the rollover color, a shade darker by using:</p>
<pre class="language-css"><code class="language-css">a {
	&amp;:hover {
		color: darker($red);
	}
}
</code></pre>
<p>I don’t have to open Photoshop or create an additional variable.</p>
<hr class="space" />
<hr />
<h2>Black and White (and Color)</h2>
<pre class="language-css"><code class="language-css">%black-and-white {
	filter: grayscale(100%);
}

%color {
	filter: grayscale(0%);
}
</code></pre>
<p>Now, I can easily convert anything to black and white:</p>
<pre class="language-css"><code class="language-css">.my-image {
	@extend %black-and-white;
}
</code></pre>
<p>Then, if I want to give it color, say on rollover:</p>
<pre class="language-css"><code class="language-css">.my-image {
		&amp;:hover {
			@extend %color;
		}
	}
</code></pre>
<hr class="space" />
<hr />
<h2>Columns</h2>
<pre class="language-css"><code class="language-css">@mixin columns ($columns: 2, $gap: 90px) {
	column-count: $columns;
	column-gap: $gap;
}
</code></pre>
<p>This mixin makes it easy to implement columns. You can tell from the code that I have defaults set for 2 columns with 90px between each column. Meaning, I can implement it without adding any parameters:</p>
<pre class="language-css"><code class="language-css">.two-columns {
	@include columns();
}
</code></pre>
<p>Or if I want to over ride it I can:</p>
<pre class="language-css"><code class="language-css">.three-columns {
		@include columns(3, 30px);
}
</code></pre>
<p>If I want to get crazy, I can even use some of my mixins together:</p>
<pre class="language-css"><code class="language-css">.two-columns {
	@include columns();

	@include breakpoint(zurb-small) {
		@include columns(1);
	}
}
</code></pre>
<p>This just says that the two column class will display 2 columns, unless we’re on mobile. Then, display 1 column.</p>
<hr class="space" />
<hr />
<h3>path</h3>
<p>I have a path function that makes it easy to include images within my SCSS:</p>
<pre class="language-css"><code class="language-css">@function path($src, $dir: img) {
	$src: unquote($src);
	@return url(unquote(&quot;..&quot;)/$dir/$src);
}
</code></pre>
<p>When I set a background image, it might look like this:</p>
<pre class="language-css"><code class="language-css">.background-image {
	background: path(&quot;my-background-image.jpg&quot;) center top no-repeat;
}
</code></pre>
<p>By default, it puts my images within a <strong>img</strong> directory. I can override that, either by passing in another parameter or adjusting the function.</p>
<hr class="space" />
<hr />
<h2>Floats</h2>
<pre class="language-css"><code class="language-css">%left,
.left {
	float: left;
}

.right,
%right {
	float: right;
}

%text--left,
.text--left {
	text-align: left;
}

%text--right,
.text--right {
	 text-align: right;
}

%center,
.center,
%text--center,
.text--center {
	text-align: center;
	width: 100%;
}
</code></pre>
<p>Tehse are a few alignment classes that make it easy to knock something left, right, or center. You’ll notice I have an extends (%) as well as the class (.) that way I can use these classes on the within my HTML as well.</p>
<hr class="space" />
<hr />
<h2>List Styling</h2>
<pre class="language-css"><code class="language-css">.no-bullets,
%no-bullets {
	list-style: none;
}
</code></pre>
<p>This is great when I’m working on site navigation:</p>
<pre class="language-css"><code class="language-css">nav ul {
	@extend %no-bullets;
}
</code></pre>
<hr class="space" />
<hr />
<h2>No Margin, No Padding</h2>
<pre class="language-css"><code class="language-css">.no-margin-padding,
%no-margin-padding {
		margin: 0;
		padding: 0;
}
</code></pre>
<p>Just as the name suggests, using this will remove any margin and padding from the element:</p>
<pre class="language-css"><code class="language-css">nav ul {
	@extend %no-margin-padding;
}
</code></pre>
<hr class="space" />
<hr />
<h2>Circles</h2>
<pre class="language-css"><code class="language-css">.circle,
%circle {
	border-radius: 50em;
}
</code></pre>
<p>This turns any item into a circle:</p>
<pre class="language-css"><code class="language-css">.circle-thumbnail {
		@extend %circle;
}
</code></pre>
<hr class="space" />
<hr />
<h2>Conclusion</h2>
<p>These are all great, but what’s the point? Well, instead of having to write these styles everytime I sit down to work on a project, I have a starting point. Don’t reinvent the wheel every time if you don’t have to. Make it easier on yourself!</p>
<p>Second, any project that I work on, I know I have certain classes available to me. I don’t have to look up the class names. I’ve established a set of standards. Remember, smarter not harder.</p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/my-sass-extends-mixins-and-functions/">My SASS Extends, Mixins, and Functions</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/my-sass-extends-mixins-and-functions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My SASS(y Pants)</title>
		<link>http://www.amyhaywood.com/sites-sass-pants/</link>
		<comments>http://www.amyhaywood.com/sites-sass-pants/#respond</comments>
		<pubDate>Thu, 29 Jan 2015 05:20:12 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[codekit]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[autoprefixer]]></category>
		<category><![CDATA[bem]]></category>
		<category><![CDATA[smacss]]></category>
		<category><![CDATA[grunt]]></category>
		<category><![CDATA[gulp]]></category>
		<category><![CDATA[livereload]]></category>
		<category><![CDATA[style guide]]></category>

		<guid isPermaLink="false">http://www.amyhaywood.com/?p=3863</guid>
		<description><![CDATA[<p>There’s been a lot of talk recently about SASS and CSS structure and Style Guides. It’s kind of cool, really, to see front-end take the “front stage.” I thought I’d add my two cents and pull back the curtain a little bit. Or…watch this video and replace “tight pants” with “SASSy pants.” Jokes. Preprocessing Yes,... <a class="view-article" href="http://www.amyhaywood.com/sites-sass-pants/">View Article</a></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/sites-sass-pants/">My SASS(y Pants)</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/logo-235e394c.png" alt="logo-235e394c" class="alignnone size-full wp-image-3867" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/logo-235e394c-250x107.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/logo-235e394c-120x51.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/logo-235e394c.png 700w" sizes="" /></p>
<p>There’s been a lot of talk recently about SASS and CSS structure and Style Guides. It’s kind of cool, really, to see front-end take the “front stage.”</p>
<p>I thought I’d add my two cents and pull back the curtain a little bit. Or…watch this video and replace “tight pants” with “SASSy pants.”</p>
<p><iframe width="560" height="315" src="https://www.youtube.com/embed/MLUvOtqTmYM" frameborder="0" allowfullscreen></iframe></p>
<p>Jokes.</p>
<hr class="space" />
<h2>Preprocessing</h2>
<p>Yes, please. </p>
<p>To me this is a no brainer. Any tool that is going to make my job easier, sign me up!</p>
<p>I’ve run the gamut on these. </p>
<p>I started with <a href="http://lesscss.org/">LESS</a> because I could put <a href="http://lesscss.org/#download-options">less.js</a> on the server and not worry about compiling. Granted, this isn’t ideal, <em>COUGH</em> graceful degradion.</p>
<p>Then, I started looking into <a href="http://sass-lang.com/">SASS.</a> I was curious because it seemed to be more popular and have more features. At the time, I was running an older verison of MacOS that wasn’t supported by <a href="https://incident57.com/codekit/">CodeKit.</a> So, I turned to <a href="http://livereload.com/">LiveReLoad</a>.</p>
<p>When I did upgrade, though, CodeKit was one of the first things I installed. I <strong><em>LOVED</em></strong> CodeKit…until I started working on a larger project that took a minute plus to compile. In all fairness, I don’t think it was CodeKit’s fault. It was probably the result of Compass building sprites and RubySASS.</p>
<p>Regardless, it forced me to turn to <a href="http://gruntjs.com/">grunt</a> and then finally, to <a href="http://gulpjs.com/">gulp.</a> — And gulp, I shall remain (for now).</p>
<p>The good part about this progression is that it allowed me to experiment with a variety of tools. When I’m collaborating with another developer, I’m able to use whatever method they’ve already put into place.</p>
<hr class="space" />
<h2>Prefixing</h2>
<p>I used to rely on Compass for prefixing, but <a href="https://github.com/postcss/autoprefixer">Autoprefixer</a> is awesome. The best part is that it utilizes the most recent data from <a href="http://caniuse.com/">Can I Use</a> to add only the necessary vendor prefixes.</p>
<hr class="space" />
<h2>Organization of Files</h2>
<p>I keep all my images, fonts, sass, css, and javascript files in an assets folder. They are separated into 2 subdirectories, <strong>dist</strong> for <strong>dist</strong>ributed, compiled files, and <strong>src</strong> for <strong>s</strong>ou<strong>rc</strong>e, original files.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-28-at-8.58.04-PM-700x594.png" alt="Screen Shot 2015-01-28 at 8.58.04 PM" class="alignnone size-large wp-image-3864" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-28-at-8.58.04-PM-250x212.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-28-at-8.58.04-PM-700x594.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-28-at-8.58.04-PM-412x350.png 412w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-28-at-8.58.04-PM-120x101.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-28-at-8.58.04-PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Back in the day, when I used to write long form css by hand, I would list my redefined styles at the top: <code>p</code>, <code>a</code>, <code>hr</code>, you get the idea. Then, layout specific styles, pieces I would use on multiple pages, and finally page specific styles. This made sense from a cascading standpoint.</p>
<p>I’ve tried to maintain a similar structure for my SCSS files:</p>
<ul>
<li><strong>_1_base</strong> This contains <a href="http://foundation.zurb.com/">Zurb Foundation</a> overrides and WordPress specific styles</li>
<li><strong>_2_helpers</strong> These are functions, extends, mixins, variables, and thene files</li>
<li><strong>_3_vendor</strong> Any third party styles I want to incorporate: fonts, <a href="http://icomoon.io/app/#/select">icomoon</a>, etc.</li>
<li><strong>_4_redefine</strong> Start to lok familiar now? These are the redefined styles that I mentioned earlier.</li>
<li><strong>_5_layout</strong> Layout specific styles</li>
<li><strong>_6_pieces</strong> Pieces that I’ll reuse in multiple places (like social media icons)</li>
<li><strong>_7_pages</strong> Page specific files.</li>
</ul>
<p>Within each folder, there’s a file with a similar name as the folder (within _7_pages, there’s a _pages.scss file. It lists out all the other files within that directory to include:</p>
<pre class="language-sass"><code class="language-sass">@import &quot;home&quot;;
@import &quot;blog&quot;;
@import &quot;clients&quot;;
@import &quot;ebooks&quot;;
@import &quot;coaching&quot;;
@import &quot;podcast&quot;;
@import &quot;speaking&quot;;
@import &quot;contact&quot;;
</code></pre>
<p>Within the main scss folder, there’s a main.scss that imports Foundation and each folder’s “index” file:</p>
<pre class="language-sass"><code class="language-sass">@import “_1_base/base&quot;;
@import “_2_helpers/helpers&quot;;
@import “_3_vendor/vendor&quot;;
@import “_4_redefine/redefine&quot;;
@import “_5_layout/layout&quot;;
@import “_6_pieces/pieces&quot;;
@import “_7_pages/pages&quot;;
</code></pre>
<hr class="space" />
<p>This means all my SASS gets compiled into 1 large CSS file. If I do end up having multiple CSS files, it’s to account for IE specific styles.</p>
<p>All my partial files are prefixed with an underscore.</p>
<hr class="space" />
<h2>Naming Conventions</h2>
<p>If you didn’t know, <a href="http://seesparkbox.com/foundry/naming_css_stuff_is_really_hard">naming CSS stuff is really hard</a>. Plenty of really smart people, people much smarter than me debate about these things. There seems to be two main camps: <a href="https://bem.info/">BEM</a> and <a href="https://smacss.com/">SMACCS.</a></p>
<p><strong>BEM</strong> stands for block, element, modifier.</p>
<p><strong>SMACSS</strong> stands for Scalable and Modular Architecture for CSS</p>
<p>A lot more alphabet soup to add to the equation!</p>
<p>When I started trying to figure out my guidelines, <a href="http://cssguidelin.es/">cssguidelin.es</a> became a terrific resource. There’s a section there on <a href="http://cssguidelin.es/#bem-like-naming">BEM-like naming conventions.</a></p>
<p>The fastest way to describe it is nested elements have double underscores:</p>
<pre class="language-css"><code class="language-css">
<p>.social-media__icons {}</p>
<p>.social-media__text {}</p>
</code></pre>
<p>You don’t want to repeat the DOM in your CSS, but you do want to make it easier to identify.</p>
<p>Modifiers or statuses have double dashes:</p>
<pre class="language-css"><code class="language-css">.social-media-—large {}</code></pre>
<p>You can also tell from my example that multiple words are not camel cased, but rather have a single dash between each word.</p>
<div class="box">
<h4>NOTE:</h4>
<p>SASS actually makes this type of naming really easy:</p>
<pre class="language-sass"><code class="language-sass">.social-media {
    &amp;__icons {}
    &amp;__text {}
    &amp;—-large {}
}</code></pre>
<p>Renders:</p>
<pre class="language-css"><code class="language-css">.social-media {}
.social-media__icons {}
.social-media__text {}
.social-media—-large {}</code></pre>
</div>
<hr class="space" />
<h3>Extendable Classes</h3>
<p>When I’m writing classes I know I want to extend, I’ll prepend the class name with a %.</p>
<pre class="language-sass"><code class="language-sass">%no-margin-padding {
     margin: 0;
     padding: 0;
}</code></pre>
<p>There are several advantages here: (1) The class doesn’t actually get written unless it’s used. So, I’ve been able to create a <em>small</em> library of elements that are available to me in all my projects. (2) The % signifies it’s was meant to be extended and is being used in multiple places = don’t change it unless you want it to risk changing multiple elements across the board.</p>
<hr class="space" />
<h2>Classes vs IDs</h2>
<p>I try to use classes instead of IDs. The main reason is because of specificity. You want your code to be as reusable as possible and all your ID elements should be unique.</p>
<p>If I’m using JavaScript to hook on to a particular element, I’ll add an addition class, prepended with <code>js-</code>. This lets me know later that JavaScript is using that particular tag, so don’t change it!</p>
<hr class="space" />
<h2>Naming Variables</h2>
<p>All my <strong>colors are stored in variables:</strong></p>
<pre class="language-sass"><code class="language-sass">$brown     : #847b6c;
$green     : #35b774;
$sky-blue    : #5ecbea;
$teal     : #3a6a77;</code></pre>
<p><strong>When I’m naming grays</strong>, instead of trying to remember the difference between <code>$dark-gray</code>, <code>$darker-gray</code>, and <code>$darkest-gray</code>, I name them by the first letter / number in their hex value: <code>$gray-a</code>, <code>$gray-8</code>, or <code>$gray-c</code>.</p>
<p>All my <strong>font names are stored as variables.</strong> If you’ve used <a href="">fonts.com</a> or <a href="https://www.google.com/fonts/">Google Fonts</a>, you’ll know sometimes it’s hard to remember the exact syntax for a font name. So, storing these values within a variable makes this a no-brainer.</p>
<p>I’ll try and abstract this even further by creating a <code>_themes.scss</code> file. I’ll write an extendable classes with a more generic name:</p>
<pre class="language-sass"><code class="language-sass"><p>%body {
    font-family: $dagny;
}

%sans-serif {
    font-family: $brandon;
    text-transform: uppercase;
}

%serif {
    font-family: $adelle;
}</code></pre>
<p>Now, if a client wants to change the font, this becomes really easy. Instead of finding and replacing all my $dagny variables, I simply, change the typeface within my <code>%body</code> definition.</p>
<p>The same concept extends to colors:</p>
<pre class="language-sass"><code class="language-sass">$border-color : $gray-c;
$heading-color : $red;</code></pre>
<p>When I’m defining the typography, I’ll write an extendable class and then include it:</p>
<pre class="language-sass"><code class="language-sass">%h1 {
    @extend %sans-serif;
    font-size: emCalc(72px); /* emCalc() is Foundation function */
}

h1 {
    @extend %h1;
}</code></pre>
<p>Separating it out that way, helps me do things like this easily:</p>
<pre class="language-sass"><code class="language-sass"><p>.page-title {
    @extend %h1;
}</code></pre>
<hr class="space" />
<h2>Tabs vs. Spaces</h2>
<p><em>I know I will be judged here. It’s OK, go ahead pull out your stones.</em></p>
<p>I prefer tabs. I just like seeing the extra space.</p>
<hr class="space" />
<h2>CSS Rule Sets</h2>
<ul>
<li>I have one selector per line. The main reason is that it makes git commits far more meaningful. Plus, it means the display width of my scss file is not very wide. I can keep it in a second pane within Sublime without sacrificing to much of my screen.</li>
<li>1 space before the opening curly bracket {</li>
<li>A line break after the opening curly brace</li>
<li>No space before the colon</li>
<li>1 space after the colon</li>
<li>No space before the semi-colon</li>
<li>A line break after the semi colon. (this wasn’t always the case)</li>
<li>No space before the closing curly bracket }</li>
<li>Put the closing curly bracket on its own line</li>
<li>A line break after the closing curly bracket</li>
<li>Most properties have 1 blank line between them. But, if they’re not related, they’ll have 5 blank lines between.</li>
</ul>
<hr class="space" />
<h2>SASSY things</h2>
<p>I try to stick to the following order of properties:</p>
<ul>
<li>
<p>@extend</p>
<ul>
<li>@includes</li>
<li>Regular property values (in alphabetical order)</li>
<li>Pseudo element nesting</li>
<li>Regular element nesting</li>
<li>Media queries</li>
</ul>
</li>
</ul>
<p>I know the alphabetical order thing sounds dumb, but it really does help when you’re skimming for a specific property.</p>
<hr class="space" />
<h2>Nesting</h2>
<p>I try not to nest. I’m not always great at it, though. SASS just makes it way too easy. </p>
<hr class="space" />
<h2>Comments</h2>
<p>At the top of every file, I have a comment labeling the file:</p>
<pre class="language-css"><code class="language-css">/*------------------------------------*\
<hr class="space" />
<h1>VARIABLES</h1>
/*------------------------------------*/</code></pre>
<p>The # is supposed to make it easy to find within the project.</p>
<hr class="space" />
<h2>Sprites</h2>
<p>I’ve finally moved to an SVG spriting system. </p>
<p>Let me describe a little bit of the history, here. I originally started with <a href="">Compass</a>. It worked great, but I was having to create multiple sprite sheets to account for retina, an icon might have multiple versions within one sheet to account for the various sizes, and on larger projects, it’d take a while to render out.</p>
<p>Then, I discovered <a href="http://icomoon.io/app/#/select">icomoon</a>. It was great because it handled a lot of the problems I found with Compass. I was able to resize icons on the fly, change colors on the fly, and it cut down on my render time. However, every time I wanted to make a change, I had to visit the icomoon site, upload the new icon, download the new files, and replace my existing files.</p>
<p>Then, once I got a setup for SVG sprites, all these things magically fell into place.</p>
<p>&lt;Insert picture of the unicorn here&gt; Just kidding.</p>
<p>Within my <strong>src / img / svg</strong> folder, I’ll save all my exported svgs. Then, gulp will handle the rest. Awesome!</p>
<hr class="space" />
<h2>Other Style Guides</h2>
<p>I’ve compiled a short list of some of the other “style guides” I’ve read on the Internet:</p>
<ul>
<li><a href="http://codepen.io/chriscoyier/blog/codepens-css">CodePen</a></li>
<li><a href="http://css-tricks.com/sass-style-guide/">CSS-Tricks</a></li>
<li><a href="http://blog.trello.com/refining-the-way-we-structure-our-css-at-trello/">Trello</a></li>
<li><a href="http://ianfeather.co.uk/css-at-lonely-planet/">Lonely Planet</a></li>
<li><a href="http://markdotto.com/2014/07/23/githubs-css/">GitHub</a></li>
<li><a href="http://www.sitepoint.com/css-sass-styleguide/">SitePoint</a></li>
</ul>
<hr class="space" />
<h2>Additional Resources</h2>
<ul>
<li><a href="http://styleguides.io/">styleguides.io</a> &#8211; This is a fantastic resource that compiles style guides and style guide information from all over the inter webs.</li>
<li><a href="http://cssguidelin.es/">cssguidelin.es</a> &#8211; I know I mentioned it earlier, but seriously, check out this site and take the time to read it. It definitely helped me.</li>
</ul>
<hr class="space" />
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/sassy_pants.jpg" alt="sassy_pants" class="alignnone size-full wp-image-3865 left" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/sassy_pants-250x175.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/sassy_pants-120x84.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/sassy_pants.jpg 420w" sizes="" /></p>
<h2>In the Comments</h2>
<p>How do you structure your style sheets?</p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/sites-sass-pants/">My SASS(y Pants)</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/sites-sass-pants/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Brain Dump on Sublime Text 3</title>
		<link>http://www.amyhaywood.com/sublime-text-brain-dump/</link>
		<comments>http://www.amyhaywood.com/sublime-text-brain-dump/#comments</comments>
		<pubDate>Mon, 26 Jan 2015 14:00:00 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[sublime]]></category>

		<guid isPermaLink="false">http://www.amyhaywood.com/?p=3788</guid>
		<description><![CDATA[<p>Let’s face it, developers are opinionated about the tools we use. I’m no different. In my humble opinion, Sublime Text is it. Dreamweaver and Coda have too many WYSIWYG features that are unnecessary to my workflow. I originally started coding with TextMate which I loved, however, the development seemed to stall out and Sublime offered... <a class="view-article" href="http://www.amyhaywood.com/sublime-text-brain-dump/">View Article</a></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/sublime-text-brain-dump/">A Brain Dump on Sublime Text 3</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/sublime.jpg" alt="Sublime Text" class="alignnone size-full wp-image-3814" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/sublime-250x106.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/sublime-120x50.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/sublime.jpg 700w" sizes="" /></p>
<p>Let’s face it, developers are opinionated about the tools we use. I’m no different.</p>
<p>In my humble opinion, <a href="http://www.sublimetext.com/">Sublime Text</a> is it. <a href="http://www.adobe.com/products/dreamweaver.html">Dreamweaver</a> and <a href="https://panic.com/coda/">Coda</a> have too many WYSIWYG features that are unnecessary to my workflow. I originally started coding with <a href="http://macromates.com/">TextMate</a> which I loved, however, the development seemed to stall out and Sublime offered several key features that TextMate was missing.</p>
<p>So, if you’re interested in Sublime or if you’re trying to trick it out, this post is for you! I figure if you’re going to spend all day with a tool, why not take the time to determine the best and most effective way you can use it. Let me share some of my workflow.</p>
<div class="box">
<h4>A Quick Word of Warning:</h4>
<p>This post is L-O-N-G (it&#8217;s a brain dump!). To make it easier for you, I wanted to include a brief table of contents, in case you want to jump to a particular section:</p>
<ol>
<li><a href="#features">Features</a></li>
<li><a href="#keyboard-shortcuts">Keyboard Shortcuts</a></li>
<li><a href="#preferences">Setting up your Preferences</a></li>
<li><a href="#snippets">Snippets</a></li>
<li><a href="#plugins">Plugins and Extensions</a></li>
<li><a href="#more">Looking for More?</a></li>
<li><a href="#comments">Comments</a></li>
</div>
<hr class="space" />
<hr />
<h2 id="features">Features</h2>
<p>Some of my favorite features are actually native to the app: </p>
<hr class="space" />
<h4>Multiple Cursors</h4>
<p>You can <strong>Cmd + Click</strong> in multiple places within your file to create multiple cursors or <strong>Alt + Drag Click</strong> to select multiple lines.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/multiple-cursors.gif" alt="Sublime Text - Multiple Cursors" class="alignnone size-full wp-image-3812" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/multiple-cursors-250x155.gif 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/multiple-cursors-120x74.gif 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/multiple-cursors.gif 500w" sizes="" /></p>
<hr class="space" />
<h4>Multiple Panes</h4>
<p>You can have multiple panes within Sublime.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-9.54.56-PM-700x455.png" alt="Sublime Text - Multiple Panes" class="alignnone size-large wp-image-3813" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-9.54.56-PM-250x162.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-9.54.56-PM-700x455.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-9.54.56-PM-537x350.png 537w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-9.54.56-PM-120x78.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-9.54.56-PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>I prefer 2 columns, but you could have rows instead. — If this excites you, check out the <a href="https://github.com/SublimeText/Origami/">Orgami plugin</a> (also listed below).</p>
<p>I’ll usually keep my HTML on the left and my SCSS and JS on the right.</p>
<p>I’ve also found this feature useful, if I’m working with a longer file and constantly scrolling up and down. I can pull the top of the file up in one pane and put the bottom of the same file in another pane.</p>
<hr class="space" />
<h4>Search within a project</h4>
<p><strong>Cmd + Shift + F</strong> will open the project search pane. You can also limit your search to certain files and folders.</p>
<p>If you want to limit the search to the current project type <strong>&lt;project&gt;</strong> within the “Where” field.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/find_in_project.png" alt="Sublime Text - Search within prject" /></p>
<p>Ever since I started splitting my SASS into multiple files, this feature has become invaluable. Within the “where” field, I usually include “assets/src/scss/“ so that the results are only within my SASS directory. I don’t want the compiled .css returning.</p>
<p>Within the “Find Results” screen, you can double click on the file name and it will take you to that particular file — or you can click on the line of code and it will take you to that spot specifically.</p>
<p>Lastly, you’ll see buttons to the left of your search fields that allow to toggle regular expressions, case sensitive, whole word, show context, and use buffer. I only make use of show context and use buffer.</p>
<div class="box">
<h4>NOTE</h4>
<p>You may want to look into <a href="">folder_exclude_patterns</a> within your preferences file if you want to omit certain results from your search.</p>
</div>
<hr class="space" />
<hr />
<h2 id="keyboard-shortcuts">Keyboard Shortcuts</h2>
<p>Your options here are limitless. I don’t know about you, but I can only remember so many at a time. I’ve included the ones I’ve found to be the most useful that I find myself using on a daily basis.</p>
<hr class="space" />
<h4>Cmd + t</h4>
<p>This is by far my most used shortcut.</p>
<p>This opens a panel at the top, type the name (or part of a name) of a file within your project, hit &lt;ENTER&gt; and it will open.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/cmd_t.gif" alt="cmd_t" class="alignnone size-full wp-image-3816" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/cmd_t-250x203.gif 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/cmd_t-430x350.gif 430w, http://www.amyhaywood.com/wp-content/uploads/2015/01/cmd_t-120x97.gif 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/cmd_t.gif 596w" sizes="" /></p>
<hr class="space" />
<h4>Cmd + Shift + p</h4>
<p>This short cut runs a close second. Similar to <strong>Cmd + t</strong>, this will open a panel at the top of my screen. Except, instead of opening files, it allows you to run commands. This could be a command from a plugin or extension or a command you might find in the menus (but don’t want to use your mouse).</p>
<hr class="space" />
<h4>Cmd + r</h4>
<p>This allows you to easily find and jump to a piece of code within the current file. Within a CSS or SASS file, you can easily find a class or id tag. Within a PHP file, you can easily find a function.</p>
<hr class="space" />
<h4>Cmd + Shift + t</h4>
<p>This will re-open the last tab that you closed.</p>
<hr class="space" />
<h4>Cmd + 1 </h4>
<h4>Cmd + 2</h4>
<h4>Cmd + 3 (through 9)</h4>
<p>If you numbered your tabs, left to right starting with 1, hitting <strong>Cmd + 2</strong>, would allow you to jump to the second tab. <strong>Cmd + 4</strong>, the fourth. You get the idea.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_number.png" alt="Sublime Text - Cmd Number" /></p>
<hr class="space" />
<h4>Ctrl + 1</h4>
<h4>Ctrl + 2</h4>
<p>If you have multiple panes open and numbered them left to right starting with 1, hitting <strong>Ctrl + 2</strong> would allow you to jump to the second pane. <strong>Ctrl + 1</strong> will jump back to the first pane.</p>
<p>If you’re using this shortcut in conjunction with <strong>Cmd + 1 (through 9)</strong>, the tab numbers restart within each pane. For example, I might type <strong>Ctrl + 2</strong> to jump to the second pane, and then <strong>Cmd + 3</strong> to jump to the third tab within that pane.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/ctrl_number.png" alt="Sublime Text - Ctrl + Number" /></p>
<hr class="space" />
<h4>Cmd + k + l</h4>
<h4>Cmd + k + u</h4>
<p>The sequence, here, took me a while to “get.” Basically, keep the <strong>Cmd</strong> key held down the whole time, and then type <strong>k</strong> (release) <strong>l</strong> (or u). </p>
<p>This will transform your selected text to all uppercase or all lowercase. I can’t tell you how many times I’ve started typing with the CAPS lock on by accident. Being the anal retentive programmer that I am, instead of having to delete that text and retype, Cmd + k + l. (I remember it by thinking <strong>k</strong>onvert to <strong>u</strong>pper or <strong>l</strong>ower.)</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_k_u.gif" alt="Sublime Text - Cmd + k + u" /></p>
<hr class="space" />
<h4>Cmd + [</h4>
<p>This will indent your entire line of code (or selection) to left.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_left_bracket.gif" alt="Sublime Text + Cmd + Left Bracket" /></p>
<hr class="space" />
<h4>Cmd + ]</h4>
<p>Similar to <strong>Cmd + ]</strong>, this will indent your entire line of code (or selection) to the right.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_right_bracket.gif" alt="Sublime Text - Cmd Right Bracket" /></p>
<hr class="space" />
<h4>Cmd + Shift + v</h4>
<p>This will paste and indent, automatically applying the correct indention to the pasted text.</p>
<hr class="space" />
<h4>Cmd + k + b</h4>
<p>Slides the sidebar in and out. I use this more when I’m working remotely on my laptop and screen real estate is an issue.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_k_b.gif" alt="Sublime Text - Command + K + B" /></p>
<hr class="space" />
<h4>Cmd + d</h4>
<p>This will highlight the entire word that your cursor is in. If you hit it again, it will select the next instance that word is used.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_d.gif" alt="Sublime Text - Cmd + D" /></p>
<hr class="space" />
<h4>Ctrl + Shift + w</h4>
<p>I use this one all the time! It wraps your current selection with a tag.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/ctrl_shift_w.gif" alt="Sublime Text - Ctrl + Shift + W" /></p>
<hr class="space" />
<h4>Cmd + Shift + .</h4>
<p>This is another one that has become second nature for me. This will automatically complete an open tag.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_shift_period.gif" alt="Sublime Text - Cmd + Shift + ." /></p>
<hr class="space" />
<h4>Cmd + l</h4>
<p>This will select the entire line your cursor is on.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_l.gif" alt="Sublime Text - Cmd + L" /></p>
<hr class="space" />
<h4>Cmd + j</h4>
<p>This will get rid of the return at the end of the line.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_j.gif" alt="Sublime Text - Cmd + J" /></p>
<hr class="space" />
<h4>Ctrl + Shift + k</h4>
<p>This will get rid of the entire line your cursor is on. Great for cleaning up code.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/ctrl_shift_k.gif" alt="Sublime Text - Ctrl + Shift + K" /></p>
<hr class="space" />
<h4>Cmd + Shift + K</h4>
<p>This will highlight the wrapping tag.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_shift_k.gif" alt="Sublime Text Shortcut - Cmd + K" /></p>
<hr class="space" />
<h4>Cmd + /</h4>
<p>Will toggle a comment block on and off.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_slash.gif" alt="Sublime Text Shortcut - Cmd + /" /></p>
<hr class="space" />
<h4>Cmd + Shift + &lt;Enter&gt;</h4>
<p>This will move your cursor to a new line above your current position.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_shift_enter.gif" alt="Sublime Text Shortcut - Cmd + Shift + Enter" /></p>
<hr class="space" />
<h4>Cmd + Enter</h4>
<p>Same thing as <strong>Cmd + Shift + &lt;ENTER&gt;</strong> except, it will move your cursor to a new line below your current position.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_enter.gif" alt="Sublime Text Shortcut - Cmd + Shift" /></p>
<hr class="space" />
<h4>Ctrl + Cmd + Up Arrow</h4>
<h4>Ctrl + Cmd + Down Arrow</h4>
<p>This is great when you have a list you’re trying to reorder. <strong>Ctrl + Cmd + Up Arrow</strong> moves your current line up. Similarly, <strong>Ctrl + Cmd + Down Arrow</strong> moves your current line down.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/ctrl_cmd_arrow.gif" alt="Sublime Text Shortcut - Cmd + Ctrl + Arrow" /></p>
<hr class="space" />
<hr />
<h2 id="preferences">Setting up Your Preferences</h2>
<p>One of the “weird” things about Sublime is that the preferences file uses JSON. Admittedly, not the most user friendly.</p>
<p>Go to <strong>Sublime Text &gt; Preferences &gt; Settings &#8211; User</strong> to edit the file.</p>
<p>I’ve included mine:</p>
<p><script src="https://gist.github.com/ahaywood/99b67bc1c02409d0e57e.js"></script></p>
<p>Within my preference, I make the folder labels bold:</p>
<pre class="language-javascript"><code class="language-javascript">“bold_folder_labels”: true,</code></pre>
<p>I use the Cobalt theme (goes back to my TextMate days). </p>
<pre class="language-javascript"><code class="language-javascript">&quot;color_scheme&quot;: &quot;Packages/Color Scheme - Default/Cobalt.tmTheme&quot;,</code></pre>
<p>You can actually set that through the menus. Just go to <strong>Sublime Text &gt; Preferences &gt; Color Scheme &gt; Color Scheme &#8211; Default &gt; Cobalt</strong></p>
<p>I’ve also experimented with <a href="https://github.com/daylerees/colour-schemes">Dayle Rees’s</a> color schemes, if you’re looking for more options. There are instructions on his GitHub page on how to install.</p>
<p>Other things I’ve defined in my preference file?</p>
<pre class="language-javascript"><code class="language-javascript"><p>&quot;folder_exclude_patterns&quot;:</p>
<p>[</p>
<p>&quot;.svn&quot;,</p>
<p>&quot;.git&quot;,</p>
<p>&quot;.hg&quot;,</p>
<p>&quot;CVS&quot;</p>
<p>],</p></code></pre>
<p>This prevents center file extensions from appearing in my sidebar and project search.</p>
<div class="box">
<h4>NOTE:</h4>
<p>You can also set folder_exclude_patterns on a project level.</p>
</div>
<pre class="language-javascript"><code class="language-javascript">“font_size”: 14</code></pre>
<p>Controls the font size. Surprise! <img src="http://www.amyhaywood.com/wp/wp-includes/images/smilies/simple-smile.png" alt=":-)" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<pre class="language-javascript"><code class="language-javascript">“highlight_line”: true,</code></pre>
<p>Highlights the line that your cursor is on.</p>
<pre class="language-javascript"><code class="language-javascript">“highlight_modified_tabs”: true</code></pre>
<p>This setting changes the color of the file name in a tab if the file has been modified.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/highlighted-tab.png" alt="Sublime Text - Highlighted Tab" /></p>
<pre class="language-javascript"><code class="language-javascript">“spell_check”: true</code></pre>
<p>Runs spell check.</p>
<hr class="space" />
<hr />
<h2 id="snippets">Snippets</h2>
<p>This is where Sublime starts to get really powerful and workflow efficient.</p>
<p>“Snippets” of code that I find myself typing all the time, I’ll turn into a Sublime Snippet. It’s as easy as going to <strong>Tools &gt; New Snippet</strong>. Sublime will open a new file with a template:</p>
<pre class="language-javascript"><code class="language-javascript">&lt;snippet&gt;
<p>&lt;content&gt;&lt;!<a href="">CDATA[</a></p>
<p>Hello, ${1:this} is a ${2:snippet}.</p>
<p>]]&gt;&lt;/content&gt;</p>
<p>&lt;!-- Optional: Set a tabTrigger to define how to trigger the snippet --&gt;</p>
<p>&lt;!-- &lt;tabTrigger&gt;hello&lt;/tabTrigger&gt; --&gt;</p>
<p>&lt;!-- Optional: Set a scope to limit where the snippet will trigger --&gt;</p>
<p>&lt;!-- &lt;scope&gt;source.python&lt;/scope&gt; --&gt;</p>
<p>&lt;/snippet&gt;</p></code></pre>
<p>To understand snippets, let’s talk through the default snippet and how it would work. If we uncommented line 6 and saved this snippet as hello.sublime-snippet (<strong>all snippets must have a sublime-snippet extension</strong>), every time we typed “hello&lt;TAB&gt;”, <strong>Hello, this is a snippet.</strong> would appear. You’ll notice that <strong>this</strong> is highlighted. We could type whatever we want to replace “this”, hit &lt;TAB&gt; again and <strong>snippet</strong> would be highlighted. &lt;TAB&gt; again, and our cursor goes to the end of the line.</p>
<p>So what just happened? Well, on line 3 of our, between <code>&lt;content&gt;&lt;![CDATA[</code> and <code>]]&lt;/content&gt;</code> is our code. The <code>${1:this} </code> and <code>${2:snippet}</code> signifies our tab stops. </p>
<p>Technically you don’t need the <code class="language-javascript">:this</code> and <code class="language-javascript">:snippet</code>, but they serve as placeholder values to remind you what content needs to go there.</p>
<p>The number tells Sublime what order to tab through.</p>
<p>If you want to get fancy, you can have multiple <code class="language-javascript">${1:this}</code>s in your snippets. That means that you’d have multiple cursors as you’re tabbing through. Let me give you a practical example:</p>
<p><script src="https://gist.github.com/ahaywood/8dedcac32dd5cf9f4b73.js"></script></p>
<p>This is my starting point for creating a JavaScript controller file. You’ll see two <code class="language-javascript">${1}s</code>, two <code class="language-javascript">${2}s</code>, and two <code class="language-javascript">${3}s</code>.</p>
<p>When I type “start_js&lt;TAB&gt;” my code appears with my cursor in two places. I can type the name of my variable on line 5. I’ll know I’ll initialize it on line 6 using the same name. Why not do it all at once? I hit &lt;TAB&gt; and I have cursor on line 5 and another on line 10. I can create a new instance of my object (line 5) and define the name of my object (line 10) at the same time… you get the idea.</p>
<pre class="language-javascript"><code class="language-javascript">&lt;tabTrigger&gt;hello&lt;/tabTrigger&gt;</code></pre>
<p>This is the text you’ll type (followed by the &lt;TAB&gt; key) to trigger the snippet. By default, this line is commented out, so make sure to name it appropriately and uncomment that line before saving it.</p>
<p>— It’s OK if you forget the tab trigger. Type <strong>Cmd + Shift + P</strong>. You’ll see a bar appear, type “snippet”, and then as you continue to type, Sublime will drill down and try to find the snippet you’re referring to. It will also remind you of the tab trigger on the far right.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/cmd_shift_p.gif" alt="Sublime Text Shortcut - Cmd + Shift + P" /></p>
<pre class="language-javascript"><code class="language-javascript"><p>&lt;scope&gt;source.python&lt;/scope&gt;</p></code></pre>
<p>This line will help scope your triggers. What does that mean?Well, in the case of my JavaScript starter file, I’ve limited it to only working with JavaScript files. Instead of “.python” it says “.js”. Any file I want to use that snippet in, must be saved with a .js extension.</p>
<p>If I have trouble with a snippet loading, it’s usually related to the scope.</p>
<p>By default this line is commented out, so it’s not <em>necessary</em>, but it prevents your snippets from conflicting with each other.</p>
<hr class="space" />
<h4>Tips and Tricks</h4>
<p>When you’re saving your snippets, they’ll be placed in your <strong>User’s Library folder &gt; Application Support &gt; Sublime Text 3 &gt; Packages &gt; User &gt;</strong>. From there, though, I like to keep my snippets organized. I have folders for each of the languages (CSS, HTML, JS, and PHP).</p>
<hr class="space" />
<h4>Other Snippets</h4>
<p>If you’re curious what other snippets I use, I’ve created gists that you’re more than welcome to download and use.</p>
<hr class="space" />
<p><strong>CSS</strong></p>
<ul>
<li><a href="https://gist.github.com/ahaywood/f8fcd31dde9d1deba681">Media queries and defining breakpoints</a> &#8211; I use <a href="http://css-tricks.com/naming-media-queries/">Chris Coyier’s Naming Media Queries</a> trick. This snippet follows that syntax.</li>
<li><a href="https://gist.github.com/ahaywood/e6743dd71b0c7c38b2f0">Z-Index Map</a> &#8211; I use <a href="http://css-tricks.com/handling-z-index/">Chris Coyier’s trick for handling z-index.</a></li>
</ul>
<p><strong>HTML</strong></p>
<ul>
<li><a href="https://gist.github.com/ahaywood/50994e99ed7a36f10b19">Picturefill for retina displays</a> &#8211; I use <a href="https://github.com/scottjehl/picturefill">Scott Jehl’s Picturefill</a> syntax for responsive image polyfills.</li>
<li><a href="https://gist.github.com/ahaywood/84af50542d4784587f7c">Placeholder images using placehold.it</a> &#8211; <a href="http://placehold.it/">Placehold.it</a> offers a great service for providing placeholder images if you’re creating mock-ups. By changing a few parameters within the URL, you can control the size, color, and text color of the image.</li>
</ul>
<p><strong>JS</strong></p>
<ul>
<li><a href="https://gist.github.com/ahaywood/8dedcac32dd5cf9f4b73">Starter JavaScript file</a>, referenced earlier.</li>
</ul>
<p><strong>WordPress (PHP)</strong></p>
<ul>
<li><a href="https://gist.github.com/ahaywood/3d87ee1786976b293842">Creating a file include</a></li>
<li><a href="https://gist.github.com/ahaywood/9b6b510aa929f3e79941">Using get_template_part</a></li>
</ul>
<hr class="space" />
<hr />
<h2 id="plugins">Plugins and Extensions</h2>
<p>At the end of the day, the plugins and extensions are ultimately what tie me to Sublime. I’ve become so reliant on them that it would be really hard for me to change editors.</p>
<hr class="space" />
<h3>Package Control</h3>
<p>The first thing you’ll need to do is install <a href="https://packagecontrol.io/">Package Controll.</a> This makes it super simple to find and install packages and keep them up to date.</p>
<p>If you go to the <a href="https://packagecontrol.io/installation">Package Control install page</a> they do a good job of explaining how to get started:</p>
<ul>
<li>Go to Sublime, hit <strong>ctrl + `</strong> (it’s above the &lt;TAB&gt; key).</li>
<li>Copy and paste the code they provide on their site and hit &lt;ENTER&gt;</li>
</ul>
<p>Easy Peasy Lemon Squeezey.</p>
<hr class="space" />
<h3>Installing Packages</h3>
<p>Now that Package Control is installed, anytime you want to install a package, just hit <strong>Cmd + Shift + P</strong> and then start to type “install”. <strong>Package Control: Install Package</strong> shoud come up as an option. Hit &lt;ENTER&gt;. Then, you can search for whatever package you want to install. Select it. Hit &lt;ENTER&gt; and it will automagically download and install itself and stay up to date. You can watch the progress in the bottom left gray bar.</p>
<hr class="space" />
<h4>Advanced New File</h4>
<p><a href="https://packagecontrol.io/packages/AdvancedNewFile">Advanced New File</a> makes it easy to create new files and folders from your keyboard. I simply type <strong>Cmd + alt + shift + n</strong>, a line appear at the bottom of window and I can type the name of the file I want to create. If I want it to be within a particular folder, I simply include the path as well: <strong>assets/src/scss/_1_base/globals.scss</strong>. If I want to create a folder, I still type <strong>Cmd + alt + shift + n</strong>, but instead of typing the file name, I type the folder name. It knows the difference because instead of ending in a dot extension, end with a trailing <strong>/</strong>. For example: <strong>assets/src/img/svg/</strong>.</p>
<div class="box">
<p>By default, when you create a new file, it will add a __init__.py to your folder. This is great, if you’re writing python (I’m assuming, I don’t know python). You can turn this off by going to <strong>Sublime Text &gt; Preferences &gt; Package Settings &gt; AdvancedNewFile &gt; Key Bindings — User</strong></p>
<p>Copy and paste the following line:</p>
<pre><code class="language-javascript">[
	{ "keys": ["shift+super+alt+n"], "command": "advanced_new_file_new", "args": {"is_python": false}},
]</code></pre>
<p>Anything within your <strong>Key Bindings — User</strong> file, will override the defaults established within <strong>Key Bindings — Default</strong>.</p>
</div>
<hr class="space" />
<h4>Alignment and AlignTab</h4>
<p>The <a href="https://packagecontrol.io/packages/Alignment">Alignment</a> and <a href="https://packagecontrol.io/packages/AlignTab">AlignTab</a> make it easy to correct alignment within your code.</p>
<p>With the Alignment package, you can press <strong>Cmd + Ctrl + a</strong> and your selection will indent consistently. If the lines are already indented properly, it will then check to make sure the first = on each line is aligned.</p>
<p>The AlignTab package is a little more versatile. I will typically call it by typing <strong>Cmd + Shift + P</strong> then selecting <strong>AlignTab</strong> and <strong>&lt;ENTER&gt;</strong>. A input field will appear at the bottom of your window and your type the character you want the text to align by.</p>
<p>It’s also worth noting that AlignTab has a <strong>Live Preview Mode</strong> option that allows you to preview the change before hitting &lt;ENTER&gt;.</p>
<hr class="space" />
<h4>Auto File Name</h4>
<p><a href="https://packagecontrol.io/packages/AutoFileName">AutoFileName</a> will autocomplete the folder and file names as you’re typing. So handy! If you’re referencing an image source, it will also fill in the height and width of the image.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/autofilename.gif" alt="Sublime Text - Autofile Plugin" /></p>
<div class="caption">NOTE: Within the screenshot, I’m using Emmet to generate to &lt;img&gt; tag.</div>
<hr class="space" />
<h4>Bracket Highlighter</h4>
<p><a href="https://packagecontrol.io/packages/BracketHighlighter">BracketHighlighter</a> will highlight the matching tag, plus it will put an icon in the gutter to help you identify the bracket, parenthesis, tag, etc.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/brackethighligheter.png" alt="Sublime Text = Bracket Highlighter" /></p>
<p>This has been a tremendous help in helping me troubleshoot code, when my nesting gets off.</p>
<hr class="space" />
<h4>Comment Snippets</h4>
<p><a href="https://packagecontrol.io/packages/Comment-Snippets">Comment Snippets</a> is a set of snippets that help you build comment blocks. For example, <code class="language-html">comm + tab</code> would render</p>
<pre class="language-html"><code class="language-html">/* Comment */</code></pre>
<p>Or, <code class="language-html">comm-section + tab</code> would produce:</p>
<pre class="language-html"><code class="language-html">/*=============================================
    =            Section comment block            =
    =============================================*/



    /*-----  End of Section comment block  ------*/</code></pre>
<p>You can see more examples by reading their <a href="https://packagecontrol.io/packages/Comment-Snippets">documentation.</a></p>
<hr class="space" />
<h4>DocBlockr</h4>
<p><a href="https://packagecontrol.io/packages/DocBlockr">DocBlockr</a> is similar to Comment Snippets in that it helps create comments, but it&#8217;s more robust. For example, if you&#8217;re writing a comment block, it will maintain your style and indentation.</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/comment_indentation.gif" alt="Sublime Text - DocBlockr Example" /></p>
<p>Also, if you&#8217;re going back and documenting variables and functions, DocBlockr will pick up on your variables and parameters, pre-filling your comment.<br />
<img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/docblockr_function.gif" alt="Sublime Text - DocBlockr example" /></p>
<p>It can also do fancy things, like surrounding you content with slashes. <code class="language-html">// Something</code><strong>CTRL + &lt;ENTER&gt;</strong>:</p>
<p><img src="http://amyhaywoodcom.s3.amazonaws.com/blog/150126/double_slashes.gif" alt="Sublime Text - DocBlockr Example" /></p>
<p>This is just the tip of the <a href="https://packagecontrol.io/packages/DocBlockr" title="DocBlockr documentation">iceberg</a>.</p>
<hr class="space" />
<h4>Syntax</h4>
<p>You can extend Sublime to support different languages and syntax highlighting through plugins too. There&#8217;s one for just about anything you can imagine:</p>
<ul>
<li><a href="https://packagecontrol.io/packages/Laravel%20Blade%20Highlighter">Laravel&#8217;s Blade Templating System</a><</li>
<li><a href="https://packagecontrol.io/packages/Sass">SASS</a></li>
<li><a href="https://packagecontrol.io/packages/LESS">Less</a></li>
<li><a href="https://packagecontrol.io/packages/CodeIgniter%20Snippets">CodeIgniter</a></li>
<li><a href="https://packagecontrol.io/packages/Hamlpy">HAML</a></li>
</ul>
<p>You get the idea.</p>
<hr class="space" />
<h4>Emmet</h4>
<p><strong><em>If you don’t install any other packages, install this one!</em></strong> I use <a href="https://packagecontrol.io/packages/Emmet">Emmet</a> (html) and <a href="https://packagecontrol.io/packages/Emmet%20Css%20Snippets">Emmet CSS Snippets</a> and <a href="https://packagecontrol.io/packages/Emmet%20Style%20Reflector">Emmet Style Reflector</a>.</p>
<p>It makes coding SO MUCH easier. Just to give you an idea, you can type <code class="language-javascript">ul&gt;li*3&gt;a[href=#]</code> and then hit tab and it will generate this for you:</p>
<pre class="language-html"><code class="language-html">&lt;ul&gt;
&lt;li&gt;&lt;a href=“#”&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=“#”&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=“#”&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<p>The <code class="language-javascript">&gt;</code> sets up the nesting, the <code class="language-javascript">*</code> sets up how many elements, and the <code class="language-javascript">[]</code> establishes any attributes.</p>
<p>The CSS version is somewhat similar. I can just start to type (typically) the first two letters of each word in a property, hit &lt;TAB&gt; and it will generate that property for me.</p>
<p>For example <code class="language-javascript">ff</code> &lt;TAB&gt; will produce <code class="language-javascript">font-family: ;</code> or <code class="language-javascript">td</code> &lt;TAB&gt; will give me <code class="language-javascript">text-decoration: ;</code>. </p>
<p>Chris Coyier has a 20 minute screencast on how to use Emmet (embedded below). I can’t tell you how many hours Emmet has saved me, it’s more than worth taking 20 minutes to familiarize yourself.</p>
<div class="break-out">
<div class="large-12 columns"><iframe width="560" height="315" src="//www.youtube.com/embed/0uIPGgq9R5Y" frameborder="0" "allowfullscreen"></iframe></div>
</div>
<hr class="space" />
<h4>GitGutter</h4>
<p>If you’re running .git on your project (which you should! …no excuses!), then <a href="https://packagecontrol.io/packages/GitGutter">GitGutter</a> will put an icon in the gutter, next to the line number, letting you know what has changed since your last commit.</p>
<p>…and while we’re talking about Git, you may want to check out <a href="https://packagecontrol.io/packages/Git">Git</a> and <a href="https://packagecontrol.io/packages/Github%20Tools">GitHub Tools</a>. Git provides git integration directly in Sublime. (I still use <a href="http://www.git-tower.com/">Tower</a>, though.) GitHub tools provides GitHub integration (I’ve moved most of my code to BitBucket.)</p>
<hr class="space" />
<h4>HTML-CSS-JS Prettify</h4>
<p>Admittedly, this is not the most used plugin that I have installed. But, when I do use it, it’s like magic.</p>
<p><a href="https://packagecontrol.io/packages/HTML-CSS-JS%20Prettify">HTML-CSS-JS Prettify</a> will take an HTML, CSS, or JS file and make the code look really pretty. It comes in handy if I copied the source from somewhere or if I’m dealing with someone else’s code.</p>
<hr class="space" />
<h4>Open Finder</h4>
<p><a href="https://packagecontrol.io/packages/Open%20Finder">Open Finder</a> gives you the command “Finder: Open here”, which will open the current file’s folder in Finder. Sounds simple, but very useful.</p>
<hr class="space" />
<h4>Origami</h4>
<p><a href="https://packagecontrol.io/packages/Origami">This</a> is one of my favorites. It makes opening and closing panes so easy. I simply type <strong>Cmd + K + arrow</strong> to open a new pane. Arrow up, opens a pane above. Arrow down, one below. Arrow right, to the right. Arrow left, to the left. </p>
<p>If I want to close a pane, I simply type <strong>Cmd + K + Shift + arrow</strong>. (Be careful not to get this mixed up with <strong>Cmd + Shift + K</strong>, just remember hold down the command key, press and release the k button, then hit shift, then arrow) Arrow up, closes the pane above it. etc.</p>
<hr class="space" />
<h4>Placeholders</h4>
<p><a href="https://packagecontrol.io/packages/Placeholders">Placeholders</a> provides placeholder content. So, I can simply type <strong>lorem&lt;TAB&gt;</strong> and a paragraph of Lorem Ipsum will be generated.</p>
<hr class="space" />
<h4>Sidebar Enhancements</h4>
<p><a href="https://packagecontrol.io/packages/SideBarEnhancements">SideBarEnhacements</a> provides some additional functionality to your sidebar. For example, it provides some additional menu options when you right click on a file or folder in the sidebar (“move to trash” and “open with…”) just to name a few.</p>
<hr class="space" />
<h4>Sublime GitHub</h4>
<p><a href="https://packagecontrol.io/packages/sublime-github">Sublime GitHub</a> is a must for me. It allows me to access my gists directly from Sublime. We talked about snippets earlier and I suppose gists could provide some overlap. The difference, for me, though, is a snippet requires some interraction (tabbing through). A gist, however, could be a whole piece of code or an entire file that I reuse quite frequently. My bower.json, package.json, or gulpfile.js are perfect examples.</p>
<p>Within Sublime, I will type <strong>Cmd + Shift + P</strong>, then I’ll start to type <strong>gist</strong>. I’ll select <strong>GitHub: Copy Gist to Clipboard</strong> and hit &lt;ENTER&gt;. Within the top panel, it will list all my gists. I can start to type the name of the gist, select it with my arrow keys if it’s not already selected, hit &lt;ENTER&gt; and then Cmd + V to paste it into my current file.</p>
<hr class="space" />
<h4>ToDo Review</h4>
<p>Last but not least: <a href="https://packagecontrol.io/packages/TodoReview">ToDoReview</a>. As I’m typing code, sometime I’ll write a line, but know that I need to come back and work on it. Say I’m stubbing out a page and have a placeholder for a JavaScript slider. I know I’ll need to come back and work on the slider, but I don’t have time in the moment to implement it. So, I’ll type <code class="language-javascript">&lt;!-- TODO: Implement Slider --&gt;</code></p>
<p>The great thing about this method</p>
<ol>
<li>It’s a comment, so you can’t see it on the front end.</li>
<li>It identifies the exact spot and line number in my code that still needs work.</li>
<li>It doesn’t interrupt my flow of stubbing out the page.</li>
</ol>
<p>Later, I can go back and run <strong>TodoReview: Project Files</strong> (by hitting <strong>Cmd + Shift + P</strong> and it will generate a list of all the places in the code where I listed TODO items. That list then comes my checklist. I can double click on the TODO in the list and it will take me to that spot in the code. Once I’ve reworked it, I’ll remove the comment, and regenerate the list.</p>
<div class="box">
<h4>NOTE:</h4>
<p>You may notice, if you’re implementing bower or other node components, this syntax is common among other developers. By running <strong>TodoReview: Project Files</strong>, it will return Todo items within your project’s bower_components folder and node_modules folder that other programmers have left behind.</p>
<p>You can exclude these fles folders from your results, by going to <strong>Sublime Text &gt; Preferences &gt; Package Settings &gt; ToDoReview &gt; Settings — User</strong> and listing them within your preferences.json file. I’ve included mine for reference:</p>
<p><script src="https://gist.github.com/ahaywood/670e54d34be4d000dfd1.js"></script>
</div>
<hr class="space" />
<hr />
<h2 id="more">Looking for more?</h2>
<p><em>Whew!</em> That’s all I got. If I’ve just whetted your appetite or you’re looking for more information, here are a few additional resources:</p>
<ul>
<li>Tuts+ has a free course: <a href="http://code.tutsplus.com/articles/perfect-workflow-in-sublime-text-free-course--net-27293">Perfect Workflow in Sublime Text: Free Course!</a></li>
<li><a href="http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/index.html">Sublime Text Unofficial Documentation</a></li>
<li><a href="https://sublimetextbook.com/">Sublime Text Power User</a>, a book and video package that is quite awesome</li>
<li><a href="http://css-tricks.com/sublime-text-front-end-developers/">A post on CSS-Tricks by wesbos</a> who wrote the ^^^Sublime Text Power User book</a>
</ul>
<hr class="space" />
<hr />
<p>I know this seems like a lot, but I know Sublime is so powerful and extendable that there’s plenty more. I’m interested to hear in the comments, what are some of your tips and tricks? Snippets? Plugins? Macros?</p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/sublime-text-brain-dump/">A Brain Dump on Sublime Text 3</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/sublime-text-brain-dump/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>How to install WordPress Plugins with Composer</title>
		<link>http://www.amyhaywood.com/composer-install-wordpress-plugins/</link>
		<comments>http://www.amyhaywood.com/composer-install-wordpress-plugins/#comments</comments>
		<pubDate>Fri, 09 Jan 2015 14:00:00 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[workflow]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[composer]]></category>

		<guid isPermaLink="false">http://amyhaywood.com/?p=3696</guid>
		<description><![CDATA[<p>What happens when you’re working with another WordPress developer, both developing a site locally, and someone updates the plugins on their local version? Their syntax and implementation may be different than yours if it was a major release. Suddenly, your local copy is broken. No fault of your own, just inconsistencies within the project. What... <a class="view-article" href="http://www.amyhaywood.com/composer-install-wordpress-plugins/">View Article</a></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/composer-install-wordpress-plugins/">How to install WordPress Plugins with Composer</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>What happens when you’re working with another WordPress developer, both developing a site locally, and someone updates the plugins on their local version? Their syntax and implementation may be different than yours if it was a major release. Suddenly, your local copy is broken. No fault of your own, just inconsistencies within the project.</p>
<p>What do you do? How do you prevent that from happening?</p>
<p>Let me present another scenario. Maybe this one will hit a little closer to home. Everytime you set up a WordPress site, you have to go through the same motions of downloading, installing, and activating a set of plugins. Maybe you’ve upped the ante a little bit and have a set of files on your local machine you just copy and paste everything over. Regardless, it’s still a pain when those plugins are updated. You have to visit each individual site, download the revised plugin code and replace the existing copy on your hard drive.</p>
<p>There must be an easier way…and there is!</p>
<p><img class="alignnone size-full wp-image-3747" src="http://www.amyhaywood.com/wp-content/uploads/2015/01/composer.jpg" alt="Composer" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/composer-250x130.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/composer-671x350.jpg 671w, http://www.amyhaywood.com/wp-content/uploads/2015/01/composer-120x62.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/composer.jpg 700w" sizes="" /></p>
<p>I’ve started using <a href="https://getcomposer.org/">Composer</a> in my workflow, now most of those headaches have evaporated.</p>
<hr class="space" />
<h2>First things first</h2>
<p>Let’s get Composer on your machine (<em>COUGH</em> Mac).</p>
<p>If you visit <a href="https://getcomposer.org/doc/00-intro.md">Composer’s site</a>, it will explain your options in more detail. My preference, though, was to install it globally so that the <code>composer</code> command can be run anywhere on your system.</p>
<p>Open the Terminal and from the command line, run:</p>
<div class="terminal">curl -sS https://getcomposer.org/installer | php<br />
mv composer.phar /usr/local/bin/composer
</div>
<div class="box">
<h4>NOTE</h4>
<p>If the above fails due to permissions, run the mv line again with sudo.
</p></div>
<hr class="space" />
<h2>On to the fun part…</h2>
<p>Within your WordPress project directory, create a file called <strong>composer.json</strong>.</p>
<p><img class="alignnone size-large wp-image-3749" src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-8.57.35-PM-700x432.png" alt="Wordpress Project Structure" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-8.57.35-PM-250x154.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-8.57.35-PM-700x432.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-8.57.35-PM-566x350.png 566w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-8.57.35-PM-120x74.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-8.57.35-PM.png 876w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>As the extension suggests, this is a preference file, written in json that describes the plugins you’ll be installing and their version numbers.</p>
<p>Here’s my broilerplate. Feel free to copy it and use it as a stating point for your own projects.</p>
<p><script src="https://gist.github.com/ahaywood/15e0de9d9a861e76b517.js"></script></p>
<p>Let me walk through it line by line.</p>
<p>The first few lines are pretty obvious. <strong>Name</strong> is the name of your project. You can replace <code>ahaywood/PROJECTNAME</code> with your information. Ideally, this should reflect your repo name.</p>
<p>Under <strong>authors</strong>, you can change “Amy (Haywood) Dutton” and “email” to include your name and email address respectively.</p>
<p>I’m going to jump down to line 27, where it reads <strong>extras.</strong> This defines the paths for both plugins and themes. As you can tell, I have a <strong>wp-content</strong> folder within the root that includes sub directories for <strong>plugins</strong> and <strong>themes</strong>.</p>
<p>On line 33, I’ve listed all the plugins that the project requires.</p>
<p><a href="http://wpackagist.org/">WP Packegist</a> makes this easy. They mirror all the WordPress plugin and theme directories as Composer repositories.</p>
<p>What does that mean?</p>
<p>If you got to WordPress.org and find a plugin you want to implement, you can also find it on WP Packegist.</p>
<p>Take the first plugin I have listed: <a href="https://wordpress.org/plugins/backupwordpress/">Backup WordPress</a>. The part of the URL that comes after <strong>/plugin</strong> is the name of the WP Packegist repo.</p>
<div class="break-out">
<div class="large-12 columns"><img class="alignnone wp-image-3750 size-full" src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_18_05_PM.png" alt="Backup WordPress on WordPress.org" width="1024" height="668" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_18_05_PM-250x163.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_18_05_PM-700x456.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_18_05_PM-536x350.png 536w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_18_05_PM-120x78.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_18_05_PM.png 1024w" sizes="(max-width: 1024px) 100vw, 1024px" /></div>
</div>
<p>If you’re still not exactly sure what the name of the repo is, <a href="http://wpackagist.org/">WP Packegist</a> just implemented a search on their site. (<em>Quick Note:</em> I searched for “Backup WordPress,” first, and it did not return any results. But, searching for “backupwordpress” returned what I was looking for.)</p>
<div class="break-out">
<div class="large-12 columns"><img class="alignnone wp-image-3751 size-full" src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-6.22.23-PM.png" alt="Backup WordPress on  WP Packegist" width="1024" height="668" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-6.22.23-PM-250x163.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-6.22.23-PM-700x456.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-6.22.23-PM-536x350.png 536w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-6.22.23-PM-120x78.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-6.22.23-PM.png 1024w" sizes="(max-width: 1024px) 100vw, 1024px" /></div>
</div>
<p>Line 34 includes the full name of the repository: <strong>“wpackagist-plugin/backupwordpress”</strong>.</p>
<div class="break-out">
<div class="large-12 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_27_33_PM.png" alt="Screen_Shot_2015-01-08_at_6_27_33_PM" class="alignnone size-full wp-image-3774" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_27_33_PM-250x163.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_27_33_PM-700x456.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_27_33_PM-536x350.png 536w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_27_33_PM-120x78.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_6_27_33_PM.png 1024w" sizes="" />
</div>
</div>
<p>You can also see there are several other plugins from Wp Packegist that I’m referencing:</p>
<div class="break-out">
<div class="large-12 columns">
<div data-height="268" data-theme-id="10245" data-slug-hash="EaZwLq" data-default-tab="js" data-user="ahaywood" class='codepen'>
<pre><code>&quot;wpackagist-plugin/backupwordpress&quot; : &quot;3.0.*&quot;,
&quot;wpackagist-plugin/intuitive-custom-post-order&quot; : &quot;2.1.*&quot;,
&quot;wpackagist-plugin/wordpress-seo&quot; : &quot;1.7.*&quot;,
&quot;wpackagist-plugin/wp-help&quot; : &quot;1.3.*&quot;,
&quot;wpackagist-plugin/user-admin-simplifier&quot; : &quot;0.6.*&quot;</code></pre>
<p>See the Pen <a href='http://codepen.io/ahaywood/pen/EaZwLq/'>Highlight WPackgist</a> by Amy Dutton (<a href='http://codepen.io/ahaywood'>@ahaywood</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
</div>
<p><script async src="//assets.codepen.io/assets/embed/ei.js"></script>
</div>
</div>
<p>The number following the name is the version number. The star serves as a wildcard. This means for Backup WordPress, versions 3.0.1 or 3.0.4 would both qualify. You also have the option of being explicit when you define the version number:</p>
<p><code>"wpackagist-plugin/backupwordpress" : “3.0.4”</code></p>
<div class="box">
<h3>NOTE</h3>
<p>Just checking to see if you’re paying attention here. One of the cases I made for Composer was that it would lock down your plugin files. How does that work with wildcards and version numbers, obviously 3.0.1 and 3.0.4 are not the same. — For now you can just trust me or if it’s really bothering, skip down to <a href="#lock-file">the section where I talk about the composer.lock file.</a>
</div>
<p>The only reason that Composer knows to look at WP Packegist for these packages, is because it’s defined as a reference on line 11 and 12.</p>
<div class="break-out">
<div class="large-12 columns">
<div data-height="268" data-theme-id="10245" data-slug-hash="LExzrp" data-default-tab="js" data-user="ahaywood" class='codepen'>
<pre><code>&quot;type&quot; : &quot;composer&quot;,
&quot;url&quot;  : &quot;http://wpackagist.org&quot;</code></pre>
<p>See the Pen <a href='http://codepen.io/ahaywood/pen/LExzrp/'>Reference Wpackagist</a> by Amy Dutton (<a href='http://codepen.io/ahaywood'>@ahaywood</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
</div>
<p><script async src="//assets.codepen.io/assets/embed/ei.js"></script>
</div>
</div>
<hr class="space" />
<h2>Setting up a Premium WordPress Plugin (or a plugin on a private repository)</h2>
<p>You’ll notice several other repositories are referenced on lines 14 &#8211; 25:</p>
<div class="break-out">
<div class="large-12 columns">
<div data-height="268" data-theme-id="10245" data-slug-hash="pvRWKx" data-default-tab="js" data-user="ahaywood" class='codepen'>
<pre><code>{
     &quot;type&quot; : &quot;vcs&quot;,
     &quot;url&quot; : &quot;git@bitbucket.org:ahhacreative/ahha&lt;em&gt;plugin&lt;/em&gt;acf.git&quot;
},
{
     &quot;type&quot; : &quot;vcs&quot;,
     &quot;url&quot; : &quot;git@github.com:ahaywood/ahha-gravityforms.git&quot;
},
{
     &quot;type&quot; : &quot;vcs&quot;,
     &quot;url&quot; : &quot;git@github.com:ahaywood/ahha-wp-db-migrate-pro.git&quot;
}</code></pre>
<p>See the Pen <a href='http://codepen.io/ahaywood/pen/pvRWKx/'>Reference Repositories</a> by Amy Dutton (<a href='http://codepen.io/ahaywood'>@ahaywood</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
</div>
<p><script async src="//assets.codepen.io/assets/embed/ei.js"></script>
</div>
</div>
<p>and implemented on lines 39 &#8211; 41:</p>
<div class="break-out">
<div class="large-12 columns">
<div data-height="268" data-theme-id="10245" data-slug-hash="XJpeYw" data-default-tab="js" data-user="ahaywood" class='codepen'>
<pre><code>&quot;ahaywood/ahha-gravityforms&quot; : &quot;1.8.*&quot;,
&quot;ahaywood/ahha-wp-db-migrate-pro&quot; : &quot;1.3.*&quot;,
&quot;ahhacreative/ahha&lt;em&gt;plugin&lt;/em&gt;acf&quot; : &quot;5.1.*&quot;</code></pre>
<p>See the Pen <a href='http://codepen.io/ahaywood/pen/XJpeYw/'>XJpeYw</a> by Amy Dutton (<a href='http://codepen.io/ahaywood'>@ahaywood</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
</div>
<p><script async src="//assets.codepen.io/assets/embed/ei.js"></script>
</div>
</div>
<p>The reason these are different is because they are premium plugins and unavailable on WordPress.org. I still want to use Composer, though, so I’m hosting them in <em>private</em> <a title="https://github.com/">GitHub</a> and <a href="https://bitbucket.org/">BitBucket</a> repositories</p>
<p>First, I tell Composer what type of files they are (vcs) and where they are located (url).</p>
<div class="break-out">
<div class="large-12 columns">
<div data-height="268" data-theme-id="10245" data-slug-hash="EaZwRq" data-default-tab="js" data-user="ahaywood" class='codepen'>
<pre><code>{
     &quot;type&quot; : &quot;vcs&quot;,
     &quot;url&quot; : &quot;git@github.com:ahaywood/ahha-gravityforms.git&quot;
},</code></pre>
<p>See the Pen <a href='http://codepen.io/ahaywood/pen/EaZwRq/'>EaZwRq</a> by Amy Dutton (<a href='http://codepen.io/ahaywood'>@ahaywood</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
</div>
<p><script async src="//assets.codepen.io/assets/embed/ei.js"></script>
</div>
</div>
<p><br clear="both" /></p>
<div class="box">
<h4>NOTE</h4>
<p>The URL is the SSH address, <strong>NOT</strong> HTTPS.
</div>
<p>Then, I reference them as project requirements:</p>
<p><code>"ahaywood/ahha-gravityforms" : "1.8.*",</code></p>
<p>That takes care of our composer.json file. Woo hoo</p>
<hr />
<p>Now let’s talk about actually getting that plugin set up correctly on your BitBucket, GitHub, Beanstalk, or whatever account.</p>
<p>Here’s what I do: Download the plugin code. Create a folder on my computer where this code can live. I actually have a folder called <strong>COMPOSER</strong> for this exact purpose.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.13.14-PM-700x432.png" alt="Composer Files in Finder" class="alignnone size-large wp-image-3760" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.13.14-PM-250x154.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.13.14-PM-700x432.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.13.14-PM-566x350.png 566w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.13.14-PM-120x74.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.13.14-PM.png 876w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Within the plugin folder, create a <strong>composer.json</strong> file</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.13.24-PM-700x432.png" alt="Screen Shot 2015-01-08 at 9.13.24 PM" class="alignnone size-large wp-image-3759" /

Copy and paste the following code:

<script src="https://gist.github.com/ahaywood/685c9f170d8c66577089.js"></script></p>
<p>This file is a lot smaller than before:</p>
<ul>
<li><strong>name</strong> is the name of the repository</li>
<li><strong>type</strong> is the type of file it is. — It could be “wordpress-plugin” or “wordpress-theme”. (Remember, when we talked about installer-paths in our first composer.json file? We defined the install paths for both a wordpress-plugin or wordpress-theme. Line 29 and 30. It actually looks at this line to know what the type of file it is and to make sure it gets installed in the right place.)</li>
<li><strong>require</strong> this line refers tothe version of composer we’re running, <strong>NOT</strong> the version of the plugin. (Can you tell I’ve gotten that mixed up before?)</li>
</ul>
<p>Add this folder as a local repository. My app of choice is <a href="http://www.git-tower.com/">Tower</a>.</p>
<div class="break-out">
<div class="large-12 columns"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.23.12-PM.png" alt="Add a Local Repo in Tower" class="alignnone size-full wp-image-3770" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.23.12-PM-250x175.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.23.12-PM-700x491.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.23.12-PM-498x350.png 498w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.23.12-PM-120x84.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.23.12-PM.png 1024w" sizes="" /></div>
</div>
<p>Run an initial commit.</p>
<p>Then, create a remote repository and link it to your repository.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.22.15-PM.png" alt="Adding a remote repository in Tower" class="alignnone size-full wp-image-3761" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.22.15-PM-250x127.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.22.15-PM-120x61.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.22.15-PM.png 512w" sizes="" /></p>
<p>Now, you’ll also need to create a <strong>tag</strong> for your commit. This relates to the <strong>version number</strong> you’re referencing in your composer.json file. I like for my numbers to match the develpers’ release numbers.</p>
<p>In Tower, you can click on the branch, then right click on a particular commit. Select <strong>“Create New Tag from…”</strong> in the drop down menu.</p>
<div class="break-out">
<div class="large-12 columns">
<a href="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.27.45-PM.png"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.27.45-PM.png" alt="Adding a tag within Tower" class="alignnone size-full wp-image-3771" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.27.45-PM-250x165.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.27.45-PM-700x463.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.27.45-PM-528x350.png 528w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.27.45-PM-120x79.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-9.27.45-PM.png 1024w" sizes="" /></a>
</div>
</div>
<p>In GitHub, tags are referred to as <strong>releases</strong>. So, if you’d prefer to do it from their site, you can click on the Releases tab, then <strong>Draft a new release.</strong></p>
<div class="break-out">
<div class="medium-6 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_30_PM-700x456.png" alt="Release inside GitHub" class="alignnone size-large wp-image-3762" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_30_PM-250x163.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_30_PM-700x456.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_30_PM-536x350.png 536w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_30_PM-120x78.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_30_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" />
</div>
<div class="medium-6 columns">
<img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_27_PM-700x456.png" alt="Draft a New Release inside GitHub" class="alignnone size-large wp-image-3763" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_27_PM-250x163.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_27_PM-700x456.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_27_PM-536x350.png 536w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_27_PM-120x78.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_30_27_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" />
</div>
</div>
<hr class="space" />
<h3>Updating your plugin</h3>
<p>When you get ready to update the plugin, simply download the latest release from the developers’ site, then replace all of the code in your local repository with theirs.</p>
<p>Commit it, tag it, and push it to your remote repository.</p>
<hr class="space" />
<h3>F-I-N-A-L-L-Y</h3>
<p>Let’s download all these plugins and actually install them on WordPress.</p>
<p>Within the root of your project folder, inside the Terminal, run <code>composer install</code>.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-10.41.57-PM-700x664.png" alt="Run composer install from Terminal" class="alignnone size-large wp-image-3772" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-10.41.57-PM-250x237.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-10.41.57-PM-700x664.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-10.41.57-PM-368x350.png 368w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-10.41.57-PM-120x113.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-08-at-10.41.57-PM.png 780w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>It might take a while, but when it’s done, you can go to the Plugin screen of WordPress and activate all your plugins.</p>
<hr class="space" />
<h3>Troubleshooting</h3>
<p>If you get an error within the Terminal about not having the right privileges to download the plugins, it’s probably related to your SSH keys.</p>
<p>I actually wrote a blog post about <a href="http://www.amyhaywood.com/ssh-site-setup/">Setting up a Site with SSH</a>. I can’t tell you how many times I actually reference that post myself! The post refers to SpringLoops, but the same applies here. Scroll down to where it says, “First, you’ll need to check for existing SSH keys.” Once you copy the keys to your clipboard, you can go to your service of choice, find the section that says SSH keys, and paste them there.</p>
<div class="break-out">
<div class="medium-6 columns">
<a href="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_04_PM.png"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_04_PM-700x456.png" alt="SSH Keys within GitHub" class="alignnone size-large wp-image-3764" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_04_PM-250x163.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_04_PM-700x456.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_04_PM-536x350.png 536w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_04_PM-120x78.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_04_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></a>
</div>
<div class="medium-6 columns">
<a href="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_19_PM.png"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_19_PM-700x456.png" alt="SSH Keys within BitBucket" class="alignnone size-large wp-image-3765" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_19_PM-250x163.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_19_PM-700x456.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_19_PM-536x350.png 536w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_19_PM-120x78.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-08_at_9_38_19_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></a>
</div>
</div>
<p><br clear="both" /></p>
<div class="box">
<h4>Update January 26, 2015</h4>
<p>I just moved all my Composer plugins off of GitHub to BitBucket. I had some problems. I kept getting an error everytime I ran <code>composer update</code>:</p>
<p><a href="http://www.amyhaywood.com/wp-content/uploads/2015/01/composer_update_error.png"><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/composer_update_error-700x192.png" alt="composer_update_error" class="alignnone size-large wp-image-3853" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/composer_update_error-250x68.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/composer_update_error-700x192.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/composer_update_error-120x33.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/composer_update_error.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></a></p>
<p>I was finally able to get it to work, but I had to change the version number within my main composer.json file to <code>dev-master</code>. In context:</p>
<pre class="language-javascript"><code class="language-javascript">
"require": {
     "ahhacreative/ahha_plugin_gravityforms" : "dev-master",
     "ahhacreative/ahha_plugin_wpdbmigratepro" : "dev-master"
},</code></pre>
<p>Then, within each individual plugin&#8217;s composer.json, I had to add a <code>version</code> and <code>dist</code> parameter:</p>
<pre class="language-javascript"><code class="language-javascript">
{
  "name": "ahhacreative/ahha_plugin_wpdbmigratepro",
  "version": "master",
  "type": "wordpress-plugin",
  "require": {
    "composer/installers": "v1.0.6"
  },
  "dist": {
        "url": "git@bitbucket.org:ahhacreative/ahha_plugin_wpdbmigratepro.git",
        "type": "git"
    }
}
</code></pre>
</div>
<hr class="space" />
<div class="box">
<h4>Update February 18, 2015</h4>
<p>I just ran into an issue when I was trying to deploy my site via <a href="http://capistranorb.com/">capistrano</a>: No submodule mapping found in .gitmodules for path.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/submodule_error.png" alt="No Submodule Mapping Found" class="alignnone size-full wp-image-3974" /></p>
<p>Fortunately, <a href="https://delboy1978uk.wordpress.com/tag/no-submodule-mapping-found-in-gitmodules/">this article</a> pointed me in the right direction. Within my root directory, there&#8217;s a file called .gitmodules, I opened it up and all that was listed was the WordPress submodule:</p>
<pre class="language-terminal"><code class="language-terminal">[submodule "wp"]
	path = wp
	url = git://github.com/WordPress/WordPress.git</code></pre>
<p>I added the following lines:</p>
<pre class="language-terminal"><code class="language-terminal">[submodule "ahha_plugin_acf"]
 	path = wp-content/plugins/ahha_plugin_acf
 	url = git@bitbucket.org:ahhacreative/ahha_plugin_acf.git
[submodule "ahha_plugin_gravityforms"]
 	path = wp-content/plugins/ahha_plugin_gravityforms
 	url = git@bitbucket.org:ahhacreative/ahha_plugin_gravityforms.git
[submodule "ahha_plugin_wpdbmigratepro"]
 	path = wp-content/plugins/ahha_plugin_wpdbmigratepro
 	url = git@bitbucket.org:ahhacreative/ahha_plugin_wpdbmigratepro.git</code></pre>
<p>Problem solved.</p>
</div>
<hr class="space" />
<p><a name="composer-lock" id="composer-lock"></a></p>
<h3>composer.lock</h3>
<p>You’ll also notice that now, in addition to your composer.json file, there should be a <strong>composer.lock</strong> file. This file <em>locks</em> things down. It records the <em>exact</em> version of the file being installed.</p>
<p>If you want to update your site, simply go to the <strong>composer.json</strong> file, update the version numbers and then go to your project folder, inside the Terminal, and run <code>composer update</code>. Yep! That simple.</p>
<hr class="space" />
<h3>This seems awfully complicated…</h3>
<p>Like a lot of things in the dev world, it can be a lot up front. That’s the learning curve talking. But, once that’s mastered, things go a whole lot faster. So, here’s my process now:</p>
<ol>
<li><a>Create a WordPress project using Yeoman.</a></li>
<li>Within the root folder, create a <strong>composer.json</strong> file, copying and pasting my own <a>GitHub boilerplate gist.</a></li>
<li>Go to my project in the Terminal and type <code>cu</code> (I have <a>Oh My Zsh! installed with the composer plugin activated.</a>)</li>
</ol>
<p>That’s it! 3 steps!</p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/composer-install-wordpress-plugins/">How to install WordPress Plugins with Composer</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/composer-install-wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Lazy Smart Programmer&#8217;s way to set up a WordPress Site</title>
		<link>http://www.amyhaywood.com/the-lazy-smart-programmers-way-to-set-up-a-wordpress-site/</link>
		<comments>http://www.amyhaywood.com/the-lazy-smart-programmers-way-to-set-up-a-wordpress-site/#respond</comments>
		<pubDate>Wed, 07 Jan 2015 14:00:00 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[yeoman]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://amyhaywood.com/?p=3660</guid>
		<description><![CDATA[<p>When you get ready to set up a WordPress site, typically your process looks something like this: Download the latest version of WordPress from wordpress.org Unzip it. Copy and paste the files into a local directory (you are developing locally, right?) Create a MySQL database. Run the 5 minute WordPress install. Download your starter theme.... <a class="view-article" href="http://www.amyhaywood.com/the-lazy-smart-programmers-way-to-set-up-a-wordpress-site/">View Article</a></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/the-lazy-smart-programmers-way-to-set-up-a-wordpress-site/">The <strike>Lazy</strike> Smart Programmer&#8217;s way to set up a WordPress Site</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/coding-700x367.jpg" alt="Coding" class="alignnone size-large wp-image-3734" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/coding-250x131.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/coding-700x367.jpg 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/coding-666x350.jpg 666w, http://www.amyhaywood.com/wp-content/uploads/2015/01/coding-120x63.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/coding.jpg 750w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>When you get ready to set up a WordPress site, typically your process looks something like this:</p>
<ol>
<li>Download the latest version of WordPress from <a href="http://www.wordpress.org">wordpress.org</a></li>
<li>Unzip it.</li>
<li>Copy and paste the files into a local directory (you are developing locally, right?)</li>
<li>Create a MySQL database.</li>
<li>Run the 5 minute WordPress install.</li>
<li>Download your starter theme.</li>
<li>Unzip it.</li>
<li>Copy and paste the theme file into WordPress’s theme directory.</li>
<li>Find your base plugins that you know you’ll need. Download each of them individually.</li>
<li>Copy and paste the plugin files into WordPress’s plugin directory.</li>
<li>Start your custom work.</li>
</ol>
<p>That’s 11 steps, at least! I know, if you do it enough times you could probably get that down to a 15 minute setup, and that’s probably only if you have local versions of your boilerplate theme and plugins that you can quickly copy and paste into the respective directories.</p>
<p>But, why? Why would you even want to waste your time doing such mindless work every time you start a project when you could be spending that time designing and developing something beautiful and original?</p>
<p>What if I were to tell you that you could cut down that down to two minutes…on a bad day? Interested?</p>
<p>If you can hang with me for the length of this post, we can get you set up and you can start being more efficient.</p>
<hr />
<p>Remember in English class, how they told us to (1) say what you’re going to say, (2) say it, and then (3) say what you said. I always remember thinking, “That sounds redundant.” Well, I’m going to take a lesson from Mrs. Nooks. I’ll tell you a little bit about the tools we’re going to put in our tool chest, then I’ll show you practically how to use them. It may get a little technical from time to time, but try to stick with it, it will be worth it.</p>
<hr />
<h2>Node.js</h2>
<p>A lot of services are built on <a href="http://nodejs.org/">Node.js.</a> If you visit the Node.js site it says it’s built on Chrome’s JavaScript runtime. Just know, that means f-a-s-t.</p>
<p>If we’re going to use it, we have to install it. Fortunately for us, this is easy. There’s a big green “install” button their site. Click it.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.02.16-AM-700x496.png" alt="Node.js" class="alignnone size-large wp-image-3735" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.02.16-AM-250x177.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.02.16-AM-700x496.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.02.16-AM-492x350.png 492w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.02.16-AM-120x85.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.02.16-AM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Once the package is downloaded, unzip, and double click on the package to install it. Hooray!</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.03.26-AM-700x525.png" alt="Node successfully installed!" class="alignnone size-large wp-image-3736" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.03.26-AM-250x187.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.03.26-AM-700x525.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.03.26-AM-466x350.png 466w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.03.26-AM-120x90.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2014-12-27-at-10.03.26-AM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<div class="box">
<h3>NOTE</h3>
<p>Grunt and Gulp also run on Node. (Blog post for the future.) Just know, for now, we’re set up for success!</p>
</div>
<p>&nbsp;</p>
<h2>Yeoman</h2>
<p><a href="http://yeoman.io">Yeoman</a> is a project generator. It can do quite a bit, setting up sites and scaffolding (and not just for WordPress). We’re going to take the easy way out and use a generator Wesley Todd has already created specifically for starting a WordPress project: <a href="http://wesleytodd.com/2013/5/yeopress-a-yeoman-generator-for-wordpress.html">YeoPress</a>. </p>
<div class="box">
<h3>NOTE:</h3>
<p>To run YeoPress, Node is the only thing that is required (which we just installed), however, Wesley encourages you to have <strong>git</strong> and <strong>SASS</strong> installed, too. If you don’t, no worries, it’s pretty straightforward too:</p>
<h4>git</h4>
<p>You can go to the <a href="http://git-scm.com/downloads">git website,</a> download the file, unzip, and double click on the package to install it. Done and done.</p>
<h4>SASS</h4>
<p>SASS is a Ruby gem. If you’re working on a Mac, it comes with Ruby already installed. All you have to do is open up your Terminal (<em>GASP</em> I know, it will be OK.) and run the command:</p>
<div class="terminal">gem install sass</div>
<p>If you get an error, chances are you need to run the sudo command:</p>
<div class="terminal">sudo gem install sass</div>
<p>Sudo forces your computer to run the command. It will ask you to enter your computer’s password.</p>
<p>If you want to check to make sure everything was installed correctly, you can run:</p>
<div class="terminal">sass -v</div>
<p>You should see it return <code>Sass 3.4.9 (Selective Steve)</code>.</p>
</div>
<p><!-- /.box --></p>
<p>Now, for installing Yeoman (yo) and YeoPress (at the same time). Within the Terminal run:</p>
<div class="terminal">npm install -g yo generator-wordpress</div>
<p><code>npm</code> just means that it’s a node command.</p>
<p>Easy.</p>
<p>Now, within the Terminal, we just have to navigate to the folder we want to install WordPress inside of. </p>
<div class="box">If I lost you at, “within the Terminal,” it’s OK.</p>
<p>For the longest time, I was uncomfortable inside the Terminal, too. But, I promise, the more you use the more comfortable you’ll become. As soon as you see the benefits that the Terminal provides your workflow, it will eventually become something you can’t / won’t want to ignore.</p>
<p>You can <a href="/getting-started-with-the-terminal/">get started with the Terminal here.</a></div>
<p>Now, run:</p>
<div class="terminal">yo wordpress</div>
<p>You’ll see the WordPress logo appear and it will start to ask you a series of questions about how you want to set up your WordPress install:</p>
<p><strong>WordPress URL</strong><br />
If you’re <a href="http://www.amyhaywood.com/turning-your-mac-into-a-server/">doing local development</a> (as you should), enter that URL in.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.27-PM-700x859.png" alt="Running yo wordpress within the Terminal" class="alignnone size-large wp-image-3737" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.27-PM-250x307.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.27-PM-700x859.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.27-PM-284x350.png 284w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.27-PM-120x147.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.27-PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><strong>Table Prefix</strong><br />
This is the table prefix for your WordPress database. By default it’s wp_. Stay with that. It makes it easy when you’re looking at your database to be able to tell which tables are related to your WordPress install.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.34-PM-700x859.png" alt="Table prefix when running yo WordPress within the Terminal" class="alignnone size-large wp-image-3738" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.34-PM-250x307.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.34-PM-700x859.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.34-PM-284x350.png 284w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.34-PM-120x147.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.34-PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><strong>Database Host, Name, User, Password</strong></p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.40-PM-700x859.png" alt="Entering Database credentials when running yo wordpress" class="alignnone size-large wp-image-3739" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.40-PM-250x307.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.40-PM-700x859.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.40-PM-284x350.png 284w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.40-PM-120x147.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-07-at-6.13.40-PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>I use a free app on my Mac, called <a href="http://www.sequelpro.com/">Sequel Pro</a> to manage my databases. But, if you’re using <a href="http://www.mamp.info/en/">MAMP</a>, you can do everything through PHPMyAdmin.</p>
<p>MAMP will also list all the credentials you need (host, user, and password) on the WebStart page.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_10_21_12_PM-700x456.png" alt="Webstart Screen in MAMP" class="alignnone size-large wp-image-3740" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_10_21_12_PM-250x163.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_10_21_12_PM-700x456.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_10_21_12_PM-536x350.png 536w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_10_21_12_PM-120x78.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_10_21_12_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><strong>Use Git?</strong><br />
More on this later, too, but for now, take my word and just say “Yes”…err, rather “Y”.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_49_PM-700x859.png" alt="use git inside yo wordpress" class="alignnone size-large wp-image-3741" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_49_PM-250x307.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_49_PM-700x859.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_49_PM-284x350.png 284w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_49_PM-120x147.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_49_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><strong>Would you like to install WordPress as a submodule?</strong></p>
<p>There are people that sit on both sides of the fence on this one, people <a href="http://ajk.fi/2013/wordpress-as-a-submodule/">for</a> and <a href="https://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/">against.</a></p>
<p>My personal take? </p>
<p>First, let me explain what a submodule is. Submodules are a “Git thing”. It’s essentially an external Git repo that your repo references. Think of it as a nested repo that you can update it independently.</p>
<p>When you think of it in those terms, it makes sense to implement WordPress as a submodule. I don’t manage the WordPress core, so why not make it seperate and reference the actual WordPress repo itself?</p>
<p>If you implement WordPress as a submodule, you’ll using the following commands to update WordPress later:</p>
<div class="terminal">cd wp<br />
git fetch &amp;&amp; git fetch &#8211;tags<br />
git checkout 4.1<br />
cd ..<br />
git add wp<br />
git commit -m “Updated to WP 4.1”<br />
git push</div>
<p>Not too shabby.</p>
<div class="box">
<h3>NOTE:</h3>
<p>If you get an error, when you try to update WordPress, like: <code>Your local changes to the following files would be overwritten by checkout.</code> Try forcing the checkout:</p>
<div class="terminal">git checkout -f another-branch</div>
</div>
<p>So… “Yes” install WordPress as a submodule.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_56_PM-700x859.png" alt="Wordpress as a submodule" class="alignnone size-large wp-image-3742" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_56_PM-250x307.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_56_PM-700x859.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_56_PM-284x350.png 284w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_56_PM-120x147.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_13_56_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><strong>WordPress install directory</strong><br />
My personal preference is “wp.”</p>
<p>This means when I log in to the admin panel, the address will be: http://SITENAME.dev/wp/wp-admin</p>
<p><strong>WordPress content directory</strong><br />
I go with “wp-content.”</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_02_PM-700x859.png" alt="Directories for WordPress Install" class="alignnone size-large wp-image-3743" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_02_PM-250x307.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_02_PM-700x859.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_02_PM-284x350.png 284w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_02_PM-120x147.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_02_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><strong>Install a custom theme?</strong><br />
I choose “no.” But, I think this would be a good area, in the future, to streamline my process even more.</p>
<p><strong>Does this all look correct?</strong><br />
It’s always comforting that it asks you to double check. “Yes.”</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_05_PM-700x859.png" alt="yo wordpress - all correct?" class="alignnone size-large wp-image-3744" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_05_PM-250x307.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_05_PM-700x859.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_05_PM-284x350.png 284w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_05_PM-120x147.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-07_at_6_14_05_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Boom! It will download WordPress for you and set up your config file. Granted, the set up may sound a little verbose, but we just condensed that 11 step process into a few lines of code.</p>
<hr />
<h2>For future reference:</h2>
<p><strong>If you clone your repo and the wp directory is blank</strong> (WordPress is a submodule, remember), run:</p>
<div class="terminal">
<p>git submodule init &amp;&amp; git submodule update</p>
</div>
<p><strong>Also, if you need to update YeoPress,</strong> it’s as simple as running the following line:</p>
<div class="terminal">npm update -g yo generator-wordpress</div>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/the-lazy-smart-programmers-way-to-set-up-a-wordpress-site/">The <strike>Lazy</strike> Smart Programmer&#8217;s way to set up a WordPress Site</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/the-lazy-smart-programmers-way-to-set-up-a-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Overcome your Fear of the Terminal</title>
		<link>http://www.amyhaywood.com/getting-started-with-the-terminal/</link>
		<comments>http://www.amyhaywood.com/getting-started-with-the-terminal/#respond</comments>
		<pubDate>Mon, 05 Jan 2015 14:00:00 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[oh my zsh]]></category>

		<guid isPermaLink="false">http://amyhaywood.com/?p=3693</guid>
		<description><![CDATA[<p>Getting Started For years, I’ve been afraid of the Terminal. I was scared that I would erase my entire hard drive with a single typo. But, then I started using grunt. I found it to be so much faster and allowed far more task automation than the tools I had been using previously. IMHO, anything... <a class="view-article" href="http://www.amyhaywood.com/getting-started-with-the-terminal/">View Article</a></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/getting-started-with-the-terminal/">How to Overcome your Fear of the Terminal</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h2>Getting Started</h2>
<p>For years, I’ve been afraid of the Terminal. I was scared that I would erase my entire hard drive with a single typo.</p>
<p>But, then I started using <a href="http://gruntjs.com/">grunt</a>. I found it to be so much faster and allowed far more task automation than the tools I had been using previously. IMHO, anything that will speed up your workflow is worth investing in (whether that’s time or money ).</p>
<p>Once I started spending more time in the Terminal, I became more comfortable and confident. Trust me, I still prefer a GUI (graphical user interface), but I’m no longer afraid I’m going to delete my entire harddrive. — And let’s be honest, you could delete your entire hard drive with a GUI too. Drag your harddrive to the trash and click “Empty Trash.” But, nobody in the right their mind would do that. Similarly, you’d have to type a very specific command in the Terminal to delete your entire harddrive and nobody in their right mind would do that either. — Plus if you have a typo in the Terminal, it will tell you and the command won’t run.</p>
<hr />
<p>So, here are the commands that I’ve found to be the most useful:</p>
<div class="box">
<h4>NOTE:</h4>
<p>When you see examples of command lines in the Terminal and you see a <strong>$</strong>. Don’t copy the $, it just signifies that it’s the beginning of a Terminal line.</div>
<p><code>cd</code> stands for change directory. Similar to the Finder where you click on the folder, in Terminal, you just type in the directory that you want:</p>
<div class="terminal">$ cd Sites</div>
<p>You can type <code>cd ..</code> to go up a level or <code>cd ../..</code> to go up 2 levels. <code>cd /</code> will take you to your home directory.</p>
<p>The Terminal also supports tab auto completion. So you could type <code>cd De&lt;TAB&gt;</code> and it will fill in <code>cd Desktop</code> for you. Handy! </p>
<p><code>ls</code> will list all files and directories in your current location.</p>
<p><code>pwd</code> will show you the current file path to your current location.</p>
<p><code>mkdir FOLDERNAME</code> will create a folder named FOLDERNAME. <code>mkdir</code> stands for “Make Directory.”</p>
<p>Anytime, you hit the up arrow on your keyboard, it will fill in the last command you ran. Hit it again and it will cycle to the command before that. The down arrow cycles in the opposite direction.</p>
<p>Just to give you an idea of how these commands are used together: when I first open the Terminal, I might type <code>ls</code> to see what my file / folder options are. Then:</p>
<div class="terminal">
$ cd Code/GIT/<br />
$ mkdir NEWPROJECT<br />
$ cd NEWPROJECT
</div>
<p>This navigates to the GIT folder and then creates a new directory for a project. Then, navigates inside the folder I just created.</p>
<p>If this is still making your head spin, here’s a WYSIWYG way that I saved until the end: Open up your Terminal type in <code>cd </code>. Then, open up Finder, navigate to the Folder you want to open in Terminal and drag that folder from the Finder onto your Terminal window. It should enter the location for that file path for you. Now, hit &lt;RETURN&gt;. — You’re welcome.</p>
<hr />
<p><strong>If you’re feeling ambitious, a few other tips and tricks:</strong></p>
<p>I use <a href="http://iterm2.com/">iTerm2</a> instead of Mac’s default Terminal. It has a little bit more functionality. My favorite feature, I have a shortcut set up so that any time I hit ALT + Cmd + Space, the Terminal overlays my entire screen. Using the same command sequence will toggle it off. This is great for quickly checking on a grunt or gulp task.</p>
<p>If you want to set this up:</p>
<ol>
<li>Download and install iTerm2.</li>
<li>Go to <strong>iTerm &gt; Preferences</strong>. Click on the “Profiles” tab.</li>
<li>
<p>Click on the + button in the bottom left. I labeled my profile “Hotkey Window”</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_23_22_PM_copy-700x440.png" alt="iTerm Preference Window" class="alignnone size-large wp-image-3721" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_23_22_PM_copy-250x157.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_23_22_PM_copy-700x440.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_23_22_PM_copy-556x350.png 556w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_23_22_PM_copy-120x75.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_23_22_PM_copy.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
</li>
<li>
<p>In the <strong>Window</strong> tab, I tweaked the transparency, checked <strong>Blur</strong>, changed the <strong>Style</strong> to “Fullscreen”, changed the <strong>Space</strong> to “All Spaces.”</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_26_51_PM-700x440.png" alt="Screen_Shot_2015-01-02_at_10_26_51_PM" class="alignnone size-large wp-image-3722" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_26_51_PM-250x157.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_26_51_PM-700x440.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_26_51_PM-556x350.png 556w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_26_51_PM-120x75.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_26_51_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
</li>
<li>
<p>Then, under the <strong>Keys</strong> tab, check “Show/hide iTerm2 with a system-wide hotkey. As I mentioned, I’m using ALT + Cmd + Space, but do whatever works best for you.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_27_54_PM-700x440.png" alt="Screen_Shot_2015-01-02_at_10_27_54_PM" class="alignnone size-large wp-image-3723" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_27_54_PM-250x157.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_27_54_PM-700x440.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_27_54_PM-556x350.png 556w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_27_54_PM-120x75.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_27_54_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
</li>
<li>Also check “Hotkey toggles a dedicated window with profile:” and make sure “Hotkey Window” (or whatever you named your custom profile is selected from the dropdown.</li>
</ol>
<hr />
<p>Lightning Round.</p>
<p>I’ve always wondered how people were able to customize their Terminal to be all kinds of cool colors.</p>
<p>Then, I was introduced to <strong><a href="https://github.com/robbyrussell/oh-my-zsh">Oh My Zsh</a></strong> = Awesome.</p>
<p>Even if you could care less about Terminal colors, there are other short cut codes packaged within Oh My Zsh that make Terminal life even better.</p>
<p>I took a leap of faith and trusted Robby Russell and simply ran his automatic installer via Curl. Just copy and paste the following line into your Terminal (remember you don’t need to copy the $ sign):</p>
<div class="terminal">$ curl -L http://install.ohmyz.sh | sh</div>
<p>Then, you can start Zsh by simply restarting or opening a new command window.</p>
<p>There are plenty of <a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Themes">themes to choose from.</a> I went with the <strong>agnoster</strong> theme and then the colors in my Terminal to use the <a href="http://ethanschoonover.com/solarized">Solarized theme</a>.</p>
<p><em>Slow down</em></p>
<p>Sorry.</p>
<p>To change the theme for Oh My Zsh, copy and past the following line into your Terminal:</p>
<div class="terminal">
$ nano /.zshrc
</div>
<p><code>nano</code> is a simple text editor that runs within the Terminal. So, we’re simply telling it to open our preference file in nano.</p>
<p>Go to the line that’s called ZSH_THEME=“”. Change that line to the name of the theme you want to use, in our case agnoster.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_49_10_PM.png" alt="Screen_Shot_2015-01-02_at_10_49_10_PM" class="alignnone size-full wp-image-3724" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_49_10_PM-250x307.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_49_10_PM-284x350.png 284w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_49_10_PM-120x147.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_10_49_10_PM.png 682w" sizes="" /></p>
<p>Then, type Ctrl + O for “Write Out” (also save). It will ask for the file name, just hit enter to keep the same file name.</p>
<p>Then, type Ctrl + X to exit.</p>
<p>To install the Solaraized theme, click on <a href="http://ethanschoonover.com/solarized">the download link on their site</a> (also available on their <a href="https://github.com/altercation/ethanschoonover.com/blob/master/projects/solarized/README.md">GitHub page</a>).</p>
<p>Unzip the file. Navigate to <strong>iterm2-colors-solarized.</strong></p>
<p>Double click on the <strong>Solarized Dark.itermcolors</strong> file. It should launch iTerm2 with a pop-up message explaining that the color scheme has been loaded into the iTerm2 Preferences (Preferences &gt; Profiles &gt; Colors &gt; Load Presets).</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-02-at-10.53.41-PM.png" alt="Screen Shot 2015-01-02 at 10.53.41 PM" class="alignnone size-full wp-image-3725" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-02-at-10.53.41-PM-250x125.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-02-at-10.53.41-PM-120x60.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-02-at-10.53.41-PM.png 532w" sizes="" /></p>
<p>Make sure your “Hotkey Window” profile is selected and choose “Solarized Dark” from the <strong>Load Presets…</strong> doprdown.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_29_59_PM-700x440.png" alt="Screen_Shot_2015-01-04_at_10_29_59_PM" class="alignnone size-large wp-image-3726" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_29_59_PM-250x157.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_29_59_PM-700x440.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_29_59_PM-556x350.png 556w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_29_59_PM-120x75.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_29_59_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>As you begin using the new theme, you may notice some of the characters are not appearing correctly. </p>
<p>I’m using <strong>Menlo for Powerline</strong>. You can go to <a href="https://github.com/abertsch/Menlo-for-Powerline">their GitHub repository</a>, download, and install the font. There are some other options in the <a href="https://github.com/powerline/fonts">Powerline font repo</a>.</p>
<p>If you’re using a font manager like <a href="http://www.extensis.com/">Suitcase</a>, be sure to mark the font as permanent.</p>
<p>If you’re still having trouble, check the <strong>Text</strong> tab within iTerm2 and make sure the appropriate fonts are marked.</p>
<p><img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_11_01_19_PM-700x440.png" alt="Screen_Shot_2015-01-02_at_11_01_19_PM" class="alignnone size-large wp-image-3727" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_11_01_19_PM-250x157.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_11_01_19_PM-700x440.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_11_01_19_PM-556x350.png 556w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_11_01_19_PM-120x75.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-02_at_11_01_19_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<div class="box">
<h4>UPDATE JANUARY 25, 2015</h4>
<p>Menlo for Powerline stopped working for me. So, I ended up downloading <a href="https://github.com/powerline/fonts">these Powerline fonts from GitHub</a> and installing Meslo, using the same process as described above.</div>
<hr />
<p><strong>Tripe Bonus.</strong></p>
<p>As I mentioned earlier, “Oh My Zsh” has several shortcuts included. For example, if you’re running Composer, instead of typing <code>composer update</code>, you can simply type <code>cu</code>. Instead of <code>git status</code>, <code>gst</code>. Still not convinced? Here’s one of my favorites: you can type <code>stt</code> and it will open the current directory within Sublime Text. These might not sound like much, but the more you live in the Terminal, the more time it will save you. </p>
<p>All of these shortcuts are considered plugins. You can check out all the ones that available on the <a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins">Oh My Zsh’s wiki page.</a></p>
<p>Once you decide which plugins you want to use, you can activate them similar to setting the theme.</p>
<div class="terminal">
$ nano /.zshrc
</div>
<p>Find the line that says <code>plugins=()</code></p>
<p>Include the plugin name within the parenthesises.</p>
<p>Mine reads:</p>
<div class="terminal">
plugins=(git sublime sudo laravel4 Composer bower npm osx)
</div>
<hr />
<p><strong>Last trick.</strong></p>
<p>I have an alias set up so that anytime I type <code>projects</code> into iTerm, it will go directly to my projects folder, where I keep all my code. Essentially, it’s the same as typing <code>cd ~/Code/GIT/</code> (just in case you were wondering the ~ references your home directory. If you’re not sure what I’m referring to, just type <code>cd ~</code> and then <code>pwd</code> or <code>ls</code> in the Terminal. You’ll see.)</p>
<p>If you still have your preference file open (<code>nano ~/.zshrc </code>), look at the bottom. There are a few examples already set up, but commented out (the # in front means the line is commented out). Add a line at the very bottom, below the examples, that reads <code>alias projects=&quot;cd ~/Sites&quot;</code>.</p

<img src="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_32_26_PM-700x859.png" alt="Screen_Shot_2015-01-04_at_10_32_26_PM" class="alignnone size-large wp-image-3728" srcset="http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_32_26_PM-250x307.png 250w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_32_26_PM-700x859.png 700w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_32_26_PM-284x350.png 284w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_32_26_PM-120x147.png 120w, http://www.amyhaywood.com/wp-content/uploads/2015/01/Screen_Shot_2015-01-04_at_10_32_26_PM.png 1024w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Then, write out the file (^O) and exit (^X). Restart iTerm2 (or open a new command window). Test it out. Nifty!</p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/getting-started-with-the-terminal/">How to Overcome your Fear of the Terminal</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/getting-started-with-the-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8 WordPress Plugins I Put on All my Sites</title>
		<link>http://www.amyhaywood.com/8-wordpress-plugins-i-put-on-all-my-sites/</link>
		<comments>http://www.amyhaywood.com/8-wordpress-plugins-i-put-on-all-my-sites/#respond</comments>
		<pubDate>Mon, 08 Dec 2014 14:00:00 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>

		<guid isPermaLink="false">http://amyhaywood.com/?p=3632</guid>
		<description><![CDATA[<p>There are eight plugins that I put on all the WordPress sites I build. Not only do they speed up development, but they also enrich my clients’ experience. Advanced Custom Fields (ACF) http://www.advancedcustomfields.com/ From a development standpoint, this WordPress plugin is a MUST HAVE. It makes it easy to create custom fields within posts, pages,... <a class="view-article" href="http://www.amyhaywood.com/8-wordpress-plugins-i-put-on-all-my-sites/">View Article</a></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/8-wordpress-plugins-i-put-on-all-my-sites/">8 WordPress Plugins I Put on All my Sites</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone size-large wp-image-3634" src="http://amyhaywood.com/wp-content/uploads/2014/12/business-99-700x229.jpg" alt="Coding Webpages" srcset="http://www.amyhaywood.com/wp-content/uploads/2014/12/business-99-250x81.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2014/12/business-99-700x229.jpg 700w, http://www.amyhaywood.com/wp-content/uploads/2014/12/business-99-120x39.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2014/12/business-99.jpg 712w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>There are eight plugins that I put on all the WordPress sites I build. Not only do they speed up development, but they also enrich my clients’ experience.</p>
<hr />
<h2>Advanced Custom Fields (ACF)</h2>
<p><img class="alignnone size-large wp-image-3642" src="http://amyhaywood.com/wp-content/uploads/2014/12/advanced-custom-fields-700x228.jpg" alt="Advanced Custom Fields" srcset="http://www.amyhaywood.com/wp-content/uploads/2014/12/advanced-custom-fields-250x81.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2014/12/advanced-custom-fields-700x228.jpg 700w, http://www.amyhaywood.com/wp-content/uploads/2014/12/advanced-custom-fields-120x39.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2014/12/advanced-custom-fields.jpg 720w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><a href="http://www.advancedcustomfields.com/">http://www.advancedcustomfields.com/</a></p>
<p>From a development standpoint, this WordPress plugin is a MUST HAVE. It makes it easy to create custom fields within posts, pages, or custom post types.</p>
<p>Sure, you can enter values into <a href="http://codex.wordpress.org/Custom_Fields">custom fields</a> or program <a href="http://www.smashingmagazine.com/2011/10/04/create-custom-post-meta-boxes-wordpress/">post meta data</a>. However, this plugin makes customization <strong>much, much</strong> easier. Plus, there are several different field options (if you have a PRO): <a href="http://www.advancedcustomfields.com/resources/repeater/">repeater field</a>, <a href="http://www.advancedcustomfields.com/resources/gallery/">photo gallery</a>, <a href="http://www.advancedcustomfields.com/resources/options-page/">options panel</a>, <a href="http://www.advancedcustomfields.com/resources/flexible-content/">flexible content</a>.</p>
<p>I can’t tell you how many clients have told me how intuitive I’ve made the backend, simply because I use this plugin.</p>
<p>You can download <a href="https://wordpress.org/plugins/advanced-custom-fields/">version 4 for free</a> or <a href="http://www.advancedcustomfields.com/pro/">buy</a> a personal license (1 site) for $25 or a development license (unlimited sites) for $100.</p>
<hr />
<h2>Gravity Forms</h2>
<p><img class="alignnone size-large wp-image-3641" src="http://amyhaywood.com/wp-content/uploads/2014/12/gravityforms-700x455.jpg" alt="Gravity Forms" srcset="http://www.amyhaywood.com/wp-content/uploads/2014/12/gravityforms-250x162.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2014/12/gravityforms-700x455.jpg 700w, http://www.amyhaywood.com/wp-content/uploads/2014/12/gravityforms-537x350.jpg 537w, http://www.amyhaywood.com/wp-content/uploads/2014/12/gravityforms-120x78.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2014/12/gravityforms.jpg 720w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><a href="http://gravityforms.com/">http://gravityforms.com/</a></p>
<p>This plugin allows you to create all kinds of forms for your site. You could argue that <a href="https://wordpress.org/plugins/contact-form-7/">Contact 7</a> accomplishes the same purpose, however this is much more extendable.</p>
<ul>
<li>You can create forms with multiple pages.</li>
<li>By default, all submissions are also saved within the backend and can be exported as a CSV.</li>
<li>You can write in form logic (if there user answers this way, display these questions).</li>
<li>I can write conditions to determine who receives email notifications, based on the type of content entered.</li>
<li>With the Developer edition, you can connect the form to MailChimp so that users are automatically added to a mailing list.</li>
<li>With the Developer Edition, you can also connect your PayPal or Stripe account to accept payment and / or donations.</li>
</ul>
<p>The price tag on Gravity Forms is a little steeper than ACF:</p>
<ul>
<li><strong>$39</strong> &#8211; Personal license (1 Site)</li>
<li><strong>$99</strong> &#8211; Business (3 Sites)</li>
<li><strong>$199</strong> &#8211; Developer (Unlimited Sites), advanced form add ons</li>
</ul>
<hr />
<h2>Yoast</h2>
<p><img src="http://amyhaywood.com/wp-content/uploads/2014/12/yoast-700x227.jpg" alt="Yoast" class="alignnone size-large wp-image-3646" srcset="http://www.amyhaywood.com/wp-content/uploads/2014/12/yoast-250x81.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2014/12/yoast-700x227.jpg 700w, http://www.amyhaywood.com/wp-content/uploads/2014/12/yoast-120x39.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2014/12/yoast.jpg 720w" sizes="(max-width: 700px) 100vw, 700px" /><br />
<a href="https://yoast.com/wordpress/plugins/seo/">https://yoast.com/</a></p>
<p>This is a <strong>FREE</strong> plugin that has practically become the standard for Search Engine Optimization within WordPress. As you enter content, it will make recommendations on how to optimize your post for Google. People pay big money for SEO consultants, when this plugin can tell you practically everything you need to know.</p>
<hr />
<h2>WP DB Migrate Pro</h2>
<p><img class="alignnone size-large wp-image-3639" src="http://amyhaywood.com/wp-content/uploads/2014/12/wp-db-migrate-700x228.jpg" alt="wp-db-migrate" srcset="http://www.amyhaywood.com/wp-content/uploads/2014/12/wp-db-migrate-250x81.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2014/12/wp-db-migrate-700x228.jpg 700w, http://www.amyhaywood.com/wp-content/uploads/2014/12/wp-db-migrate-120x39.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2014/12/wp-db-migrate.jpg 720w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><a href="https://deliciousbrains.com/wp-migrate-db-pro/">https://deliciousbrains.com/wp-migrate-db-pro/</a></p>
<p>Anytime I’m working on a site, I want to streamline my workflow. Migrating a site by hand is multi step process:</p>
<ul>
<li>Copy the database</li>
<li>Change the Site URL and the Homepage URL</li>
<li>Replace the dev URLs with the production URLs</li>
<li>Update the permalinks</li>
</ul>
<p>Once this plugin is set up, it reduces that process to 1 step:</p>
<ul>
<li>Click the button.</li>
</ul>
<p>It costs a little bit of cash, but well worth the cost:</p>
<ul>
<li><strong>$90</strong> &#8211; Personal (12 Installs)</li>
<li><strong>$199</strong> &#8211; Developer (100 Installs)</li>
<li><strong>$450</strong> &#8211; Elite (unlimited installs)</li>
</ul>
<p>&lt;div class=“box”&gt;NOTE: If you’re concerned about site speed and conscientious about the number of plugins you install, once you’re done developing a site, this plugin can be disabled.&lt;/div&gt;</p>
<hr />
<h2>Backup WordPress</h2>
<p><img class="alignnone size-large wp-image-3640" src="http://amyhaywood.com/wp-content/uploads/2014/12/backupwordpress-700x226.jpg" alt="Backup WordPress" srcset="http://www.amyhaywood.com/wp-content/uploads/2014/12/backupwordpress-250x80.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2014/12/backupwordpress-700x226.jpg 700w, http://www.amyhaywood.com/wp-content/uploads/2014/12/backupwordpress-120x38.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2014/12/backupwordpress.jpg 720w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><a href="https://bwp.hmn.md/">https://bwp.hmn.md/</a></p>
<p>This plugin is peace of mind. It does exactly as the name suggests = Backs up WordPress.</p>
<p>When you’re backing up your site, there are 2 things to consider: backing up the database and backing up your files. This plugin handles both.</p>
<p>You can use either the free version or the developer version ($99). The Developer version can be installed on an unlimited number of sites and unlocks a number of different ways to backup your site: FTP, Dropbox, Amazon S3, Google Dropbox, etc.</p>
<p>This is not the only option out there. <a href="https://ithemes.com/purchase/backupbuddy/">Backup Buddy</a>, <a href="https://wordpress.org/plugins/better-wp-security/">iThemes Security</a> (formerly Better WP Security), and <a href="https://vaultpress.com/">VaultPress</a> all offer similar services. The important thing, here, is that you are actually backing up your site. You’ll sleep better at night, especially, if you’re managing someone else’s site!</p>
<hr />
<h2>Intuitive Custom Post Order</h2>
<p><a href="https://wordpress.org/plugins/intuitive-custom-post-order/">https://wordpress.org/plugins/intuitive-custom-post-order/</a></p>
<p>Almost every time I create a custom post type for a client, they’ll need the ability to customize the order that the content appears in. This plugin allows them to go to the post listing and drag and drop posts into the order that they want. It lives up to the name = intuitive.</p>
<hr />
<h2>WP Help</h2>
<p><img class="alignnone size-large wp-image-3637" src="http://amyhaywood.com/wp-content/uploads/2014/12/wp_help-700x226.jpg" alt="WP Help" srcset="http://www.amyhaywood.com/wp-content/uploads/2014/12/wp_help-250x80.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2014/12/wp_help-700x226.jpg 700w, http://www.amyhaywood.com/wp-content/uploads/2014/12/wp_help-120x38.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2014/12/wp_help.jpg 720w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p><a href="https://wordpress.org/plugins/wp-help/">https://wordpress.org/plugins/wp-help/</a></p>
<p>I wrote <a href="http://www.amyhaywood.com/how-to-create-screencasts/">a post about how I create screencasts</a> for all my clients, training them on how to use WordPress. This plugin creates a panel on the backend, where I can easily post all the screencasts I create. It’s nice because it places everything in one central location.</p>
<hr />
<h2>User Admin Simplifier</h2>
<p><a href="http://amyhaywood.com/wp-content/uploads/2014/12/user_admin_simplifier.jpg"><img class="alignnone size-large wp-image-3636" src="http://amyhaywood.com/wp-content/uploads/2014/12/user_admin_simplifier-700x222.jpg" alt="User Admin Simplifier" srcset="http://www.amyhaywood.com/wp-content/uploads/2014/12/user_admin_simplifier-250x79.jpg 250w, http://www.amyhaywood.com/wp-content/uploads/2014/12/user_admin_simplifier-700x222.jpg 700w, http://www.amyhaywood.com/wp-content/uploads/2014/12/user_admin_simplifier-120x38.jpg 120w, http://www.amyhaywood.com/wp-content/uploads/2014/12/user_admin_simplifier.jpg 720w" sizes="(max-width: 700px) 100vw, 700px" /></a></p>
<p><a href="https://wordpress.org/plugins/user-admin-simplifier/">https://wordpress.org/plugins/user-admin-simplifier/</a></p>
<p>Sometimes, I want to limit what the client has access to, making it as easy as possible for them to update their site. This plugin allows me to quickly and easily control menus and navigation panels they have access to within the WordPress backend. I can even make modifications on a per user basis.</p>
<hr />
<p>I’m all about workflow and systems and making the development process simple. It’s not about being lazy, it’s about being efficient. If installing a plugin, accomplishes that purpose, I say, “Go for it! Do it!”</p>
<p>What are some plugins that are must haves for you?</p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/8-wordpress-plugins-i-put-on-all-my-sites/">8 WordPress Plugins I Put on All my Sites</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/8-wordpress-plugins-i-put-on-all-my-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Step by Step Instructions for Displaying a Vimeo feed with jQuery</title>
		<link>http://www.amyhaywood.com/displaying-a-vimeo-feed-with-jquery-revised/</link>
		<comments>http://www.amyhaywood.com/displaying-a-vimeo-feed-with-jquery-revised/#comments</comments>
		<pubDate>Fri, 07 Jun 2013 18:39:14 +0000</pubDate>
		<dc:creator><![CDATA[Amy]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Feed]]></category>
		<category><![CDATA[Vimeo]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Step By Step Instructions]]></category>

		<guid isPermaLink="false">http://www.amyhaywood.com/?p=2744</guid>
		<description><![CDATA[<p>Prologue A while back, I wrote a post on displaying a Vimeo feed using jQuery. Recently, I had to do this for a client site. Knowing, I had written a blog post, I naturally, pulled up my blog post, so I could follow my own advice. (One of the good things about blogging = documenting... <a class="view-article" href="http://www.amyhaywood.com/displaying-a-vimeo-feed-with-jquery-revised/">View Article</a></p>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/displaying-a-vimeo-feed-with-jquery-revised/">Step by Step Instructions for Displaying a Vimeo feed with jQuery</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h2 id="prologue">Prologue</h2>
<p><a href="http://www.amyhaywood.com/displaying-a-vimeo-feed-with-jquery/" title="Displaying a Vimeo Feed with jQuery">A while back</a>, I wrote a post on displaying a Vimeo feed using jQuery.</p>
<p>Recently, I had to do this for a <a href="http://www.codyfry.com" title="Cody Fry">client site</a>. Knowing, I had written a blog post, I naturally, pulled up my blog post, so I could follow my own advice. (One of the good things about blogging = documenting your own process)</p>
<p>However, I quickly discovered, my code was outdated. None of it worked! Even the site that I referenced in my post, their code didn’t work! My Google Search returned my post as the top hit! &#8212; and any links after that were outdated too!</p>
<p>So, I wanted to update my content, using code that actually works (go figure).</p>
<hr />
<h2 id="actual_work">The Actual Work</h2>
<p>I found a <a href="https://github.com/vimeo/vimeo-api-examples">code repository on GitHub</a> that had everything I needed. So, <a href="https://github.com/vimeo/vimeo-api-examples/archive/master.zip">download the code (direct link).</a></p>
<div class="break-out">
<div class="large-12 columns"><img src="http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.55.13-PM-1024x671.png" alt="Vimeo Feed and jQuery Screenshot" width="950" class="alignnone size-large wp-image-2745" srcset="http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.55.13-PM-300x196.png 300w, http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.55.13-PM-1024x671.png 1024w, http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.55.13-PM-470x308.png 470w, http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.55.13-PM.png 1024w" sizes="(max-width: 950px) 100vw, 950px" /></div>
</div>
<p>You&#8217;ll see there are several examples for you to work from. No need to reinvent the wheel! </p>
<p>For the site I was working on, I neeed to display a featured video at the top with thumbnails beneath it. Within the <strong>simple-api</strong> folder, there&#8217;s a folder called <strong>gallery</strong>, then I grabbed the <strong>js-example.html</strong> file. It already has everything you need.</p>
<div class="break-out">
<div class="large-12 columns"><img src="http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.59.49-PM-1024x450.png" alt="Displaying a Vimeo Feed - Finder" width="1024" height="450" class="alignnone size-large wp-image-2746" srcset="http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.59.49-PM-300x131.png 300w, http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.59.49-PM-1024x450.png 1024w, http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.59.49-PM-470x206.png 470w, http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-12.59.49-PM.png 1024w" sizes="(max-width: 1024px) 100vw, 1024px" /></div>
</div>
<p>I copied the CSS out of the header, and placed it in my site&#8217;s CSS. </p>
<div class="break-out">
<div class="large-12 columns">
<div data-height="377" data-theme-id="10245" data-slug-hash="0f95ad9ca28dad9a3367d7a81dc6d55a" data-default-tab="css" data-user="ahaywood" class='codepen'>
<pre><code>#thumbs { 
  height: 298px; 
  width: 300px; 
  border: 1px solid #E7E7DE; 
  padding: 0; 
  float: left;
  
    ul { 
      list-style-type: none; 
      margin: 0 10px 0; 
      padding: 0 0 10px 0;
      
      li { 
        height: 75px; 
      }
  }
}

.thumb { 
  border: 0; 
  float: left; 
  width: 100px; 
  height: 75px; 
  background: url(http://a.vimeocdn.com/thumbnails/defaults/default.75x100.jpg); 
    margin-right: 10px; 
}

#embed { 
  background-color: #E7E7DE; 
  height: 280px; 
  width: 504px; 
  float: left; 
  padding: 10px; 
}

#portrait { 
  float: left; 
  margin-right: 5px; 
  max-width: 100px; 
}
  
#stats { 
  clear: both; 
  margin-bottom: 20px; 
}</code></pre>
<p>See the Pen <a href='http://codepen.io/ahaywood/pen/0f95ad9ca28dad9a3367d7a81dc6d55a/'>0f95ad9ca28dad9a3367d7a81dc6d55a</a> by Amy Dutton (<a href='http://codepen.io/ahaywood'>@ahaywood</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
</div>
<p><script async src="//assets.codepen.io/assets/embed/ei.js"></script></div>
</div>
<p>I also copied the javascript and pasted it in my site&#8217;s JS folder. (Don&#8217;t forget to make sure you&#8217;re using <a href="http://www.jquery.com">jQuery</a>).</p>
<div class="break-out">
<div class="large-12 columns">
<div data-height="377" data-theme-id="10245" data-slug-hash="0f95ad9ca28dad9a3367d7a81dc6d55a" data-default-tab="js" data-user="ahaywood" class='codepen'>
<pre><code>var apiEndpoint = &#x27;http://vimeo.com/api/v2/&#x27;;
var oEmbedEndpoint = &#x27;http://vimeo.com/api/oembed.json&#x27;
var oEmbedCallback = &#x27;switchVideo&#x27;;
var videosCallback = &#x27;setupGallery&#x27;;
var vimeoUsername = &#x27;brad&#x27;;

// Get the user&#x27;s videos
$(document).ready(function() {
  $.getScript(apiEndpoint + vimeoUsername + &#x27;/videos.json?callback=&#x27; + videosCallback);
});

function getVideo(url) {
	$.getScript(oEmbedEndpoint + &#x27;?url=&#x27; + url + &#x27;&amp;width=504&amp;height=280&amp;callback=&#x27; + oEmbedCallback);
}

function setupGallery(videos) {

	// Set the user&#x27;s thumbnail and the page title
	$(&#x27;#stats&#x27;).prepend(&#x27;&lt;img id=&quot;portrait&quot; src=&quot;&#x27; + videos[0].user_portrait_medium + &#x27;&quot; /&gt;&#x27;);
	$(&#x27;#stats h2&#x27;).text(videos[0].user_name + &quot;&#x27;s Videos&quot;);

	// Load the first video
	getVideo(videos[0].url);

	// Add the videos to the gallery
	for (var i = 0; i &lt; videos.length; i++) {
		var html = &#x27;&lt;li&gt;&lt;a href=&quot;&#x27; + videos[i].url + &#x27;&quot;&gt;&lt;img src=&quot;&#x27; + videos[i].thumbnail_medium + &#x27;&quot; class=&quot;thumb&quot; /&gt;&#x27;;
		html += &#x27;&lt;p&gt;&#x27; + videos[i].title + &#x27;&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;&#x27;;
		$(&#x27;#thumbs ul&#x27;).append(html);
	}

	// Switch to the video when a thumbnail is clicked
	$(&#x27;#thumbs a&#x27;).click(function(event) {
		event.preventDefault();
		getVideo(this.href);
		return false;
	});

}

function switchVideo(video) {
	$(&#x27;#embed&#x27;).html(unescape(video.html));
}</code></pre>
<p>See the Pen <a href='http://codepen.io/ahaywood/pen/0f95ad9ca28dad9a3367d7a81dc6d55a/'>0f95ad9ca28dad9a3367d7a81dc6d55a</a> by Amy Dutton (<a href='http://codepen.io/ahaywood'>@ahaywood</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
</div>
<p><script async src="//assets.codepen.io/assets/embed/ei.js"></script></div>
</div>
<p>Replace the <strong>vimeoUsername</strong> name with the vimeo user you&#8217;re trying to pull from.</p>
<div class="break-out">
<div class="large-12 columns">
<div class="center"><img src="http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-1.02.55-PM.png" alt="Displaying a Vimeo Feed" class="alignnone size-full wp-image-2747" srcset="http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-1.02.55-PM-300x100.png 300w, http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-1.02.55-PM-470x157.png 470w, http://www.amyhaywood.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-07-at-1.02.55-PM.png 824w" sizes="" /></div>
</div>
</div>
<p>Then, copy and paste the containers within the HTML, into yours. it&#8217;s important that you leave the id tags alone so that the JS can grab them&#8230;errr.. if you&#8217;re going to change them, change them within the JS file too. Also, make sure those tags don&#8217;t conflict with your existing DOM.</p>
<div class="break-out">
<div class="large-12 columns">
<div data-height="377" data-theme-id="10245" data-slug-hash="0f95ad9ca28dad9a3367d7a81dc6d55a" data-default-tab="html" data-user="ahaywood" class='codepen'>
<pre><code>&lt;div id=&quot;stats&quot;&gt;
  &lt;h2&gt;&lt;/h2&gt;
	&lt;div style=&quot;clear: both;&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;wrapper&quot;&gt;
	&lt;div id=&quot;embed&quot;&gt;&lt;/div&gt;
	&lt;div id=&quot;thumbs&quot;&gt;
		&lt;ul&gt;&lt;/ul&gt;
	&lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>See the Pen <a href='http://codepen.io/ahaywood/pen/0f95ad9ca28dad9a3367d7a81dc6d55a/'>0f95ad9ca28dad9a3367d7a81dc6d55a</a> by Amy Dutton (<a href='http://codepen.io/ahaywood'>@ahaywood</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
</div>
<p><script async src="//assets.codepen.io/assets/embed/ei.js"></script></div>
</div>
<p>You should be good to go! &#8212; Unless of course, you want to restyle some elements (which is what I did). But, this will at least get you pointed in the right direction.</p>
<div class="break-out">
<div class="large-12 columns">
<p data-height="377" data-theme-id="10245" data-slug-hash="0f95ad9ca28dad9a3367d7a81dc6d55a" data-default-tab="result" data-user="ahaywood" class='codepen'>See the Pen <a href='http://codepen.io/ahaywood/pen/0f95ad9ca28dad9a3367d7a81dc6d55a/'>0f95ad9ca28dad9a3367d7a81dc6d55a</a> by Amy Dutton (<a href='http://codepen.io/ahaywood'>@ahaywood</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
<p><script async src="//assets.codepen.io/assets/embed/ei.js"></script></div>
</div>
<p>The post <a rel="nofollow" href="http://www.amyhaywood.com/displaying-a-vimeo-feed-with-jquery-revised/">Step by Step Instructions for Displaying a Vimeo feed with jQuery</a> appeared first on <a rel="nofollow" href="http://www.amyhaywood.com">AMY HAYWOOD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.amyhaywood.com/displaying-a-vimeo-feed-with-jquery-revised/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
