<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Development - Stapps.io]]></title><description><![CDATA[Development - Stapps.io]]></description><link>https://blog.stapps.io/</link><generator>Ghost 0.11</generator><lastBuildDate>Thu, 01 Jan 2026 09:41:41 GMT</lastBuildDate><atom:link href="https://blog.stapps.io/tag/development/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Match nth case with regex]]></title><description><![CDATA[<p>For an app I worked on lately I implemented some Github style checkboxes in their markdown syntax. </p>

<p>The format is like so:</p>

<pre><code>[ ] Checkbox 1
[ ] Checkbox 2
[ ] Checkbox 3
</code></pre>

<p><em>There's a couple ways you could approach this but I've gone with regular expression.</em></p>

<p>The pattern to match this is: <code>((\[[ x]].*?(\r\</code></p>]]></description><link>https://blog.stapps.io/match-nth-case-with-regular-expression/</link><guid isPermaLink="false">d2647153-b24b-4e85-a268-524c4528d4a6</guid><category><![CDATA[Development]]></category><category><![CDATA[regex]]></category><category><![CDATA[markdown]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Wed, 13 Jul 2016 20:19:55 GMT</pubDate><content:encoded><![CDATA[<p>For an app I worked on lately I implemented some Github style checkboxes in their markdown syntax. </p>

<p>The format is like so:</p>

<pre><code>[ ] Checkbox 1
[ ] Checkbox 2
[ ] Checkbox 3
</code></pre>

<p><em>There's a couple ways you could approach this but I've gone with regular expression.</em></p>

<p>The pattern to match this is: <code>((\[[ x]].*?(\r\n|\r|\n)){INDEX})\[[ x]](.*)</code> <br>
Where INDEX is the nth we want to match -1. If we want the first, the index would be 0. 2nd would be 1, 3rd would be 2 etc. <br>
E.g. to match the 2nd, the INDEX would be 1: <code>((\[[ x]].*?(\r\n|\r|\n)){1})\[[ x]](.*)</code></p>

<p>Then we can use <code>$1[x]$4</code> as the replacement.</p>

<p>Replacing the 2nd would result in:  </p>

<pre><code>[ ] Checkbox 1
[x] Checkbox 2
[ ] Checkbox 3
</code></pre>

<p>But let's break this pattern down. The first half of this is in brackets representing the first captured group as $1 for the replace statement. In this we have <code>\[[ x]]</code> which matches square brackets an empty space or x inside, then <code>.*?</code> matches any content after it till the end of the line, followed by <code>(\r\n|\r|\n)</code> which detects the end of the line. This then get's repeated for the INDEX <code>{INDEX}</code> or <code>{1}</code> for matching the 2nd checkbox. The INDEX is 1 less than the value we are looking for as it starts at 0 rather than 1. This ends the first capturing group. We then we look for the checkbox again <code>\[[ x]]</code> as this is the one we will be replacing and grab all the content after it in a last capturing group which in the replace is $4. </p>

<p>Try this out at <a href="http://regexr.com/3dqac">http://regexr.com/3dqac</a> <br>
Use the original empty checkboxes text above and the regex, then click to replace and enter the replacement script. Then try changing the index between 0, 1 and 2 to see if live replace whichever checkbox.</p>]]></content:encoded></item><item><title><![CDATA[The importance of obscuring email addresses on websites]]></title><description><![CDATA[<p><code>mailto:email@address.com</code> links in sites are pretty common place, but having this in the source code of the site means that email is going to get soo much extra spam.</p>

<p>This is not a new topic btw, it's one since the dawn of time <em>- internet time</em>.</p>

<h2 id="whywillthisleadtospamrobotsthatswhy">"Why</h2>]]></description><link>https://blog.stapps.io/the-importance-of-obscuring-email-addresses-on-websites/</link><guid isPermaLink="false">db5667fb-1fd1-4f04-a8e0-70f19a1e19ce</guid><category><![CDATA[Design]]></category><category><![CDATA[Development]]></category><category><![CDATA[REC]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Wed, 15 Jun 2016 16:52:48 GMT</pubDate><content:encoded><![CDATA[<p><code>mailto:email@address.com</code> links in sites are pretty common place, but having this in the source code of the site means that email is going to get soo much extra spam.</p>

<p>This is not a new topic btw, it's one since the dawn of time <em>- internet time</em>.</p>

<h2 id="whywillthisleadtospamrobotsthatswhy">"Why will this lead to spam?" Robots, that's why.</h2>

<p>Robots as we call them, or crawlers, or harvesters, or just scripts can be coded to search round the internet and gather email addresses from sites. </p>

<p>Sometimes it's just for the sake of gathering random emails, while other times they can be looking for sites in specific industries etc. </p>

<p><img src="https://blog.stapps.io/content/images/2016/06/robots-everywhere-meme.jpg" alt="Robots, robots everywhere."></p>

<p>You might be thinking this doesn't happen much, but likely it's happening right now on your site... and again... and again. Many people are running these automated crawlers, and why, because it's easy to do and they can profit from it. </p>

<h2 id="howeasyisit">"How easy is it?"</h2>

<p>Here's a quick bash script I wrote in about 5 minutes and it's far from perfect. It searches google.co.uk for "web designers" using curl and returns the first 100 results. Then it uses a combination of grep and awk find all the sites returned. Then it uses xargs to execute curl again to request each site and grep to look for any email addresses. At the end it prints out all the email addresses it's found. <br>
Go ahead, try this in your terminal now: <em>(Tested on mac &amp; linux/ubuntu)</em></p>

<pre><code class="language-bash">curl -s "https://www.google.co.uk/search?q=web+designers&amp;num=100" --user-agent "Chrome" \  
    | grep -oE '&lt;a href="\/url\?q=(https?:\/\/.*?\/)' \
    | awk -F'=|&amp;' '{print $3}' \
    | xargs -L 1 bash -c '\
        curl -s $0 --user-agent "Chrome" \
        | grep -oE "\b[A-Za-z0-9._%+-]+(@|\[at\])[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" ' \
    | uniq
</code></pre>

<p><em>That 2nd to last line matching the email addresses comes from <a href="http://www.shellhacks.com/en/RegEx-Find-Email-Addresses-in-a-File-using-Grep">Shell Hacks</a> btw.</em></p>

<p>For ease of copying here it is as a single line:  </p>

<pre><code class="language-bash">curl -s "https://www.google.co.uk/search?q=web+designers&amp;num=100" --user-agent "Chrome" | grep -oE '&lt;a href="\/url\?q=(https?:\/\/.*?\/)' | awk -F'=|&amp;' '{print $3}' | xargs -L 1 bash -c 'curl -s $0 --user-agent "Chrome" | grep -oE "\b[A-Za-z0-9._%+-]+(@|\[at\])[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" ' | uniq  
</code></pre>

<p>As I said this isn't perfect by far, but it shows how quick you can knock up a script to do this type of thing. <br>
At the time this was built this gave me 54 email addresses.</p>

<p>Many crawlers out are often more detailed in the way they request sites, crawl their pages and the way they search for email addresses. The above script may not work in a month or so. But that's fine as I wrote it to prove it works now. </p>

<h2 id="okigetithowdoifixthis">"Ok, I get it, how do i fix this?"</h2>

<p>If you want to help save your clients email spam boxes a bit then you're going to want to make the job a little harder for these robots. </p>

<p>Email obfuscation is a technique of encoding the email so it's not clearly shown in the source, but instead it's shown as html entities which the browser decodes or it's added through the use of javascript on to the page. </p>

<p>Some systems may come with simple ways to obscure email addresses.</p>

<p><strong>Working in Wordpress?</strong> <br>
You can use <code>&lt;?php echo antispambot('email@address.com'); ?&gt;</code> <br>
Ref: <a href="https://codex.wordpress.org/Function_Reference/antispambot">https://codex.wordpress.org/Function_Reference/antispambot</a></p>

<p><strong>Working in <a href="http://www.reallyeasycart.co.uk/">REC</a>?</strong> <br>
You can use <code>{{ "email@address.com" | safe_email }}</code></p>

<p>Other systems often have similar techniques or plugins to help. </p>

<p>In fact some CDN services such as <a href="https://support.cloudflare.com/hc/en-us/articles/200170016-What-is-Email-Address-Obfuscation-">Cloudflare</a> offer this as a setting enabled by default. </p>

<p>But if you're looking for a manual way to do this, there's plenty tools out there to help. <br>
Here's a few that seem good:</p>

<ul>
<li><a href="http://andrew.hedges.name/experiments/obfuscator/">Online Email Obfuscator - Encodes an email to html entities</a></li>
<li><a href="http://www.email-obfuscator.com/">Email Obfuscator - Encodes the email with javascript</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[REC Procedure for changes to an existing site]]></title><description><![CDATA[<p>Unlike a new site, making changes to an existing site doesn't require a full "go live" procedure as such, but that doesn't mean it doesn't have any process. <br>
It's just as important it goes smoothly, in fact it's more so as it's affecting a live site that the company depends</p>]]></description><link>https://blog.stapps.io/rec-proceedure-for-changes-to-an-existing-site/</link><guid isPermaLink="false">830a8e17-627f-472e-81e1-6e47dfd424bf</guid><category><![CDATA[REC]]></category><category><![CDATA[Design]]></category><category><![CDATA[Development]]></category><category><![CDATA[Testing]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Fri, 10 Jun 2016 08:44:50 GMT</pubDate><content:encoded><![CDATA[<p>Unlike a new site, making changes to an existing site doesn't require a full "go live" procedure as such, but that doesn't mean it doesn't have any process. <br>
It's just as important it goes smoothly, in fact it's more so as it's affecting a live site that the company depends on it. <br>
You need to be sure your changes won't lead to any loss of leads or sales the site may bring, especially if the client didn't sign off on it.</p>

<p>Here's a straight forward process cycle you can follow that's worked for me.</p>

<p><img src="https://blog.stapps.io/content/images/2016/06/agile-process.png" alt="Agile Process"></p>

<p>The flow here starts with the idea and ends only when the client has signed off on the project. Everything in between is a loop of design &amp; development shortly followed by testing &amp; feedback from the client. The more you work in iterations this way, the better you'll get at working out good logical places to break each sprint. You can even plan them in advance. <br>
You'll want to strike a balance between keeping the client updated and getting their feedback, but avoiding showing the client much broken / unfinished code. <br>
Generally the faster you get feedback though, the easier the process will be later on. </p>

<h2 id="ideastage">Idea stage</h2>

<ul>
<li>Before starting changes, engage with the client and review the brief of exactly what is needed. This is important to make sure you know what they are looking for. Sketches and simple mockups are very useful here to assure the client and yourself that you are both on the same page. </li>
<li>Is the site fully responsive? Or does it have a mobile only view? Make sure consideration to this is given in any mockups and estimates for the work.</li>
</ul>

<h2 id="firstiteration">First iteration</h2>

<p>Depending on the changes, the first iteration may be designing a mockup. Following the above image you would design the mockup and then contact the client for feedback. This could then go through several iterations before moving into development. </p>

<h2 id="followingiterations">Following iterations</h2>

<p>Each following iteration involves a sprint of work followed shortly by a review by the client. These are not formal reviews, more to keep the client informed that work is happening. It's also useful as clients often change their minds or can only work out what they truly want when they see it. This way you'll find out quickly if you're going the wrong way.</p>

<p>I wont intrude much into your design / development process here, I have <a href="https://blog.stapps.io/css-structure-anti-patterns-part1/">another post that does this already</a>, but make sure you're regularly involving the client for feedback.</p>

<h2 id="tipswhiledeveloping">Tips while developing</h2>

<ul>
<li>Try not to copy content directly from legacy templates into responsive, but instead apply a fresh design over the responsive-site. <br>
E.g. if this is a responsive redesign it's tempting to copy say a product page template file from legacy, but this likely wont work. Instead use the existing design as a mockup, you can reuse imagery but coding new css and additional html structure will be less work than you'd think.  </li>
<li>Keep track of new features you've added, you'll want this for testing later, and for your support documentation.</li>
</ul>

<h2 id="testing">Testing</h2>

<ul>
<li>Browser test main site + special new features that the client may have requested!</li>
<li>Google Analytics > Check browsers bringing in most visitors &amp; enquiries or orders. 
<strong><a href="https://blog.stapps.io/modern-browser-testing/">Check out my other post on Modern web design</a>.</strong></li>
</ul>

<h3 id="thingstolookoutforespeciallywhiletesting">Things to look out for especially while testing:</h3>

<ul>
<li>Check your site's performance and mobile friendliness with <a href="https://testmysite.thinkwithgoogle.com/">Google's new tool</a>.</li>
<li>Do the changes affect ecommerce? E.g. a responsive redesign? or changes to products etc. You'll need to test the full cart process: finding a product on the site, add to cart, registration, checkout page, payment processor (no need to pay, but at least get it into paypal or wherever to check the order values) and thanks page, this will help you spot anything weird or broken. Best to do so with the browser console</li>
<li>Any specific custom functionality already on the site? Such as a custom app. Make sure this is still working, or brought through into the new design. </li>
</ul>

<h3 id="gettingusefulfeedback">Getting useful feedback</h3>

<p>Try to make sure the client actually looks at the design of all changed pages. Sometimes they can just load the homepage up and that's all, later after release they then may complain that other things are not right. It's also easy for them to miss stuff too :). <br>
Set expectations during early iterations about exactly what functionality is loaded up and therefore for review. <br>
Get their feedback, make any changes, re-browser test the changes, etc. repeat! You can send them a link to a dev site if that's where you're working, or a preview link if working on the live site but in a different template folder. </p>

<h2 id="release">Release</h2>

<ul>
<li>Get written proof of client sign off on entire site before making it live.</li>
<li>Finally you're ready to go live, but wait it's Friday, DONT! DON’T DO IT! NOPE NOPE NOPE.
<img src="https://blog.stapps.io/content/images/2016/06/Nope-Meme-04.jpg" alt=""></li>
</ul>

<h3 id="relatedarticles">Related articles</h3>

<p>If you're interested in a more in-depth look at workflow and processes, I recommend Redesign the Web - The Smashing Book #3, chapter 10 is on workflow redesigned and really worth a read.  </p>

<ul>
<li><a href="https://blog.stapps.io/modern-browser-testing/">Modern web design</a></li>
<li><a href="https://blog.stapps.io/css-structure-anti-patterns-part1/">CSS structure &amp; anti patterns</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[AWS ELB free SSL termination]]></title><description><![CDATA[<p>Did you know you can generate free SSL certificates for your AWS load balancer?</p>

<p>At work we have some application servers on AWS with an ELB in front, which we wanted to migrate it to HTTPS. It needs a wildcard subdomain so Cloudflare my normal go to is out for</p>]]></description><link>https://blog.stapps.io/aws-elb-free-ssl-termination/</link><guid isPermaLink="false">442d0a85-f5a7-471b-8bbb-45e550d88c93</guid><category><![CDATA[Development]]></category><category><![CDATA[aws]]></category><category><![CDATA[ssl]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Mon, 06 Jun 2016 15:23:15 GMT</pubDate><content:encoded><![CDATA[<p>Did you know you can generate free SSL certificates for your AWS load balancer?</p>

<p>At work we have some application servers on AWS with an ELB in front, which we wanted to migrate it to HTTPS. It needs a wildcard subdomain so Cloudflare my normal go to is out for now. Let's encrypt would work, but I'd need to have a bit more complex setup to have it auto renew from one node and distribute between the nodes or send the cert to the ELB via the API maybe?</p>

<p>Anyway, after searching I stumbled onto some new AWS posts talking about the <a href="https://aws.amazon.com/certificate-manager/">Certificate Manager</a>. It allows you to request SSL certs for domains, verify them via email and once setup you can add HTTPS listener to your ELB with the generated certificate, so HTTPS traffic comes in, and HTTP traffic back to the instances securely within your VPC.</p>

<p>A very simple setup provided free on top of our existing architecture, supports wildcards and everything we needed.</p>

<p>More details here: <br>
<a href="https://aws.amazon.com/blogs/aws/new-aws-certificate-manager-deploy-ssltls-based-apps-on-aws/">https://aws.amazon.com/blogs/aws/new-aws-certificate-manager-deploy-ssltls-based-apps-on-aws/</a></p>]]></content:encoded></item><item><title><![CDATA[Reading list for modern web design]]></title><description><![CDATA[<p>Over the years I've found some books on web design to be just as important as posts online. Here's a short post on books I've read, enjoyed and think are worth while reading in terms of web design today. </p>

<p>These books are fairly up to date but the methods used</p>]]></description><link>https://blog.stapps.io/reading-list-for-modern-web-design/</link><guid isPermaLink="false">00b1f4c7-2e89-4dbc-8b8e-19c77fdad321</guid><category><![CDATA[Responsive]]></category><category><![CDATA[Design]]></category><category><![CDATA[Development]]></category><category><![CDATA[CSS]]></category><category><![CDATA[javascript]]></category><category><![CDATA[REC]]></category><category><![CDATA[Books]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Sat, 04 Jun 2016 16:13:00 GMT</pubDate><content:encoded><![CDATA[<p>Over the years I've found some books on web design to be just as important as posts online. Here's a short post on books I've read, enjoyed and think are worth while reading in terms of web design today. </p>

<p>These books are fairly up to date but the methods used are solid and still valid into tomorrow. <br>
By no means am I saying "read these and you're ready", or a definitive list of books I've read or think you should read. But if you're looking for books to tune your skills, this list may help. </p>

<p>I'd also encourage you to leave comments below to share books on web design you've enjoyed and have helped you too. </p>

<h2 id="books">Books</h2>

<div class="books-container">

<p>In case you've not stumbled onto this gem before, <a href="http://alistapart.com/">A List Apart</a> is a great source of useful information. Their series of short books on  
<a href="https://abookapart.com/">A Book Apart</a> offer great core skills such as:</p>

<!-- HTML5 book -->  
<div class="media book-media">  
  <a href="https://html5forwebdesigners.com/" class="img">
<img src="https://blog.stapps.io/content/images/2016/06/html5-for-web-designers-book.png" alt="">
  </a>
  <div class="bd">
    <h3 class="title">HTML5 for web designers by Jeremy Keith.</h3>
    <p>Looking to get up to speed on HTML5? A core skill of modern web design is being able to use these new HTML elements with purpose.</p>
  </div>
</div>

<!-- CSS3 book -->  

<div class="media book-media">  
  <a href="https://abookapart.com/products/css3-for-web-designers" class="img">
<img src="https://blog.stapps.io/content/images/2016/06/css3-for-web-designers-book.jpg" alt="">
  </a>
  <div class="bd">
    <h3 class="title">CSS3 for web designers by Dan Cederholm.</h3>
    <p>Also a core tool on your belt is CSS3. Techniques such as rounded corners (with border-radius) and background gradients and more are all common place in modern design. These are made simpler with this book.</p>
  </div>
</div>

<!-- Responsive web design book -->  

<div class="media book-media">  
  <a href="https://abookapart.com/products/responsive-web-design" class="img">
<img src="https://blog.stapps.io/content/images/2016/06/responsive-web-design-book.jpg" alt="">
  </a>
  <div class="bd">
    <h3 class="title">Responsive web design by Ethan Marcotte.</h3>
    <p>A brilliant intro to responsive web design, very useful techniques from the guy that coined the term "responsive web design"!</p>
  </div>
</div>

<p>The above are just 3 of their books, it's worth checking out <a href="https://abookapart.com/products/">more</a>. Hopefully this is a nice taste of books they offer and should help you learn the core skills needed to get started with modern web design.</p>

<p>On to other ranges of books, the following focus more on techniques, patterns, usability and inspiration.</p>

<!-- SMACSS book -->  

<div class="media book-media">  
  <a href="https://smacss.com/" class="img">
<img src="https://blog.stapps.io/content/images/2016/06/smacss-book.jpg" alt="">
  </a>
  <div class="bd">
    <h3 class="title">Scalable and Modular Architecture for CSS (SMACSS) by Jonathan Snook.</h3>
    <p>Another short book but front to back a great read full of useful info on writing and structuring css.
<br>The patterns he talks about are simple and easy to follow, but make all the difference in creating maintainable css designs.  
<br><em>I can't recommend this book enough.</em></p>  
  </div>
</div>

<!-- Smashing magazine book -->  

<div class="media book-media">  
  <a href="https://shop.smashingmagazine.com/products/the-smashing-book-1-digital-edition" class="img">
<img src="https://blog.stapps.io/content/images/2016/06/smashing-mag-book.jpg" alt="">
  </a>
  <div class="bd">
    <h3 class="title">Any from the "Smashing Book" series.</h3>
    <p>Full of the latest modern techniques, inspiring articles and more. 
  <br>Personally read books 1 & 3 but I'd bet the 2nd is worth wile too. 
  <br>The <a href="https://www.smashingmagazine.com/">Smashing Magazine</a> website has been a constant source of useful info and inspiration for years. </p>
  </div>
</div>

<!-- Don't make me think book -->  

<div class="media book-media">  
  <a href="https://www.amazon.co.uk/dp/0321965515/ref=pd_lpo_sbs_dp_ss_1?pf_rd_p=569136327&pf_rd_s=lpo-top-stripe&pf_rd_t=201&pf_rd_i=0321344758&pf_rd_m=A3P5ROKL5A1OLE&pf_rd_r=BSZR6QXQ8QGC19K6K9TC" class="img">
<img src="https://blog.stapps.io/content/images/2016/06/dont-make-me-think-book.jpg" alt="">
  </a>
  <div class="bd">
    <h3 class="title">Don't Make Me Think: A Common Sense Approach to Web Usability by Steve Krug.</h3>
    <p>If being able to build a site is the first step, then building it right is the second. This book goes over common web usability and is definitely worth the read.</p>
  </div>
</div>

<p>Ready to dive into Javascript?</p>

<!-- Eloquent JavaScript book -->  

<div class="media book-media">  
  <a href="http://eloquentjavascript.net/" class="img">
<img src="https://blog.stapps.io/content/images/2016/06/eloquent-javascript.jpg" alt="">
  </a>
  <div class="bd">
    <h3 class="title">Eloquent JavaScript: A Modern Introduction to Programming by Marijn Haverbeke.</h3>
    <p>This book came out around 2011 but I wish it had been there back in 2008 when I first started Javascript. It's useful for getting started with Javascript, or fine tuning your skills and filling in any blanks. </p>
  </div>
</div>

<!-- Javascript good parts book -->  

<div class="media book-media">  
  <a href="http://eloquentjavascript.net/" class="img">
<img src="https://blog.stapps.io/content/images/2016/06/js-good-parts.gif" alt="">
  </a>
  <div class="bd">
    <h3 class="title">JavaScript: The Good Parts by Douglas Crockford.</h3>
    <p>Douglas Crockford gives a great run through of the language and the syntax to give you a solid understanding of programming with it.</p>
  </div>
</div>

<p>Looking for something a bit deeper? Something for improving your developer skills?</p>

<!-- Eloquent JavaScript book -->  

<div class="media book-media">  
  <a href="https://pragprog.com/book/tpp/the-pragmatic-programmer" class="img">
<img src="https://blog.stapps.io/content/images/2016/06/pragmatic-programmer.jpg" alt="">
  </a>
  <div class="bd">
    <h3 class="title">The Pragmatic Programmer:
From Journeyman to Master by Andrew Hunt and David Thomas.</h3>  
    <p>If you're interested in levelling up your skills then this book may be for you. It covers patterns, methodology, solid ideas and tools to take your code to the next level. It's also surprising easy to follow as it's often ultimately about common sense. </p>
  </div>
</div>

<p></p></div><p></p>

<h2 id="newsletters">Newsletters</h2>

<p><em>I like a good newsletter or 10 for keeping up to date on the modern web.</em>
They're one way that's really helped me stay up to date especially over the past year. Maybe they will work for you too.</p>

<p>Sitepoint's <a href="https://www.sitepoint.com/versioning/email">Versioning</a> newsletter is worth subscribing to if you're interested in a daily digest of latest web news. <br>
Though this can be too frequent, <a href="https://web-design-weekly.com/">Web Design Weekly</a>, or <a href="http://responsivedesignweekly.com/">Responsive Design Weekly</a> are 2 great weekly newsletters also. <br>
There are many others like this such as HTML5 Weekly, CSS Weekly, Javascript Weekly and eWebDesign newsletter. <br>
My advice is to pick one and see if you like it. If not you can always un-subscribe :).  </p>

<p>If you're working on an <a href="http://www.reallyeasycart.co.uk/">REC</a>, here's some more links that may be of use for keeping up to date: <a href="http://design.reallyeasycart.co.uk/up-to-date.html">http://design.reallyeasycart.co.uk/up-to-date.html</a></p>

<p>Please leave comments with books or posts online you'd recommend :), I'd love to hear about books that you've read and have helped you, along with inspiration for what I should read next.  </p>]]></content:encoded></item><item><title><![CDATA[Modern browser testing]]></title><description><![CDATA[<p>Browser testing has come along way, these aren't the days of IE5/6 double margin bugs or old IE hasLayout problems. <br>
We still battle some bugs but by large they are much less common to run into for day to day design. However this doesn't mean you don't need to</p>]]></description><link>https://blog.stapps.io/modern-browser-testing/</link><guid isPermaLink="false">5b2513a2-4243-4056-bf2f-a93cadd2ec2e</guid><category><![CDATA[Design]]></category><category><![CDATA[CSS]]></category><category><![CDATA[Responsive]]></category><category><![CDATA[REC]]></category><category><![CDATA[Development]]></category><category><![CDATA[Template]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Thu, 02 Jun 2016 08:24:50 GMT</pubDate><content:encoded><![CDATA[<p>Browser testing has come along way, these aren't the days of IE5/6 double margin bugs or old IE hasLayout problems. <br>
We still battle some bugs but by large they are much less common to run into for day to day design. However this doesn't mean you don't need to test!</p>

<h3 id="contents">Contents</h3>

<ol>
<li><a href="https://blog.stapps.io/modern-browser-testing/#tipswhilecoding">Tips while coding</a>  </li>
<li><a href="https://blog.stapps.io/modern-browser-testing/#selectingbrowsers">Selecting browsers to test</a>  </li>
<li><a href="https://blog.stapps.io/modern-browser-testing/#whybrowserstack">Why BrowserStack</a>  </li>
<li><a href="https://blog.stapps.io/modern-browser-testing/#testing">Testing like a pro</a></li>
</ol>

<p><a id="tipswhilecoding"></a>  </p>

<h2 id="tipswhilecodingtomakeyourbrowsertestingeasier">Tips while coding to make your browser testing easier</h2>

<ol>
<li><p><strong>Don't focus too much on making your designs pixel perfect in every browser.</strong></p>

<blockquote>
  <p>"While some designers strive for cross-browser pixel perfection, proponents of fluid design do not think that layouts have to look identical across all platforms and screen resolutions." <br>
  <em>- The Smashing Book (Chapter on the Art &amp; Science of CSS Layouts)</em> </p>
</blockquote>

<p>Often clients (or our own OCD's) will want a design to be pixel perfect across multiple browsers and sizes, but there's very little need for this. I'm not saying make them drastically different in each browser, but if they have minor differences then this is good enough for me. The important thing is the design is able to adapt to the available screen size, and look good enough in browsers where support for some features isn't easily available. E.g. rounded corners with border-radius, these days it's pretty much all browsers, but if you go back to IE8 it doesn't support border-radius. Though if you look at your design, does the fact it doesn't have rounded corners cause any problems? no? great, leave it, no fancy polyfills etc needed. Which nicely brings me to my next point.</p></li>
<li><p><strong>Don't fear vendor prefixes, but also don't fret about them either.</strong> <br>
That sounds confusing, I probably could word that better. <br>
What I mean is, feel free to use vendor prefixes in your code. But make your own decisions of when to and not to use them. E.g. <a href="http://caniuse.com/#feat=flexbox">flexbox</a> is a great case of where it's needed, especially because of IE10's alt syntax. But <a href="http://caniuse.com/#feat=css-repeating-gradients">css gradients</a>, if you set a fallback background-color then this will likely be fine if you don't bother adding the vendor prefixed versions too as they will use the fallback. <br>
<a href="http://pleeease.io/play/">There</a> <a href="https://autoprefixer.github.io/">are</a> <a href="http://prefixr.com/">many</a> <a href="http://prefixr.cloudvent.net/">sites</a> out there that offer automatically adding prefixes to your code. But simpler than this, you can get editor plugins (for <a href="https://wbond.net/sublime_packages/prefixr">Sublime</a>, <a href="https://atom.io/packages/autoprefixer">Atom</a>, etc.) which can run right in your editor with a single command. 
One rule to remember with these new css properties &amp; vendor prefixes is, always use the real property too, don't just style for webkit prefixes, make sure you style for all and then add prefixes for added support. Also, think about browsers that don't even have prefixes. Make sure your design degrades gracefully without them, or better yet, build without them where you can and add them on top after, so you know the base is already nice and this progressively enhances the design in newer browsers. </p></li>
<li><p><strong>Avoid browser specific hacks.</strong> <br>
Ok yes, very unlikely if you're supporting IE7 or 8 maybe. But 9+ and most other modern browsers, do you really need that hack? In the case that you super need a hack, <a href="http://browserhacks.com/">browserhacks.com</a> is a great resource for it. <strong>But</strong> is it needed?</p></li>
<li><p><strong>Avoid adding lines of code you don't understand.</strong></p>

<p>Sure use libraries and snippets, in fact I encourage it, but try to look and learn how they work. Especially if it's a few lines in your own css. Sometimes when you copy other peoples code you can be left with properties that don't appear to make sense. Best case is if they are not explained somewhere, try taking them out, does it break, if so you'll learn why they were added, and if not, maybe you can remove them to simplify the code. You can always add them back in later if needed. But try to avoid seeing some code as <em>magic</em>. Magic hides reality, and often I've found magic can lead to bugs.</p></li>
<li><p><strong>Resize your browser often while developing.</strong> <br>
This is one of the fastest ways to quickly catch problems fast, and to prove your designs adapt to the screen size available. </p></li>
<li><p><strong>Learn to master your browsers dev tools</strong> <br>
Each of the major browsers have developer tools that help you build sites. Its really worth investing time in learning these tools. Most of them offer some sort of emulation for browser modes, screen sizes, user agents etc. So this is useful for browser testing. But the tools are also useful during testing because you can use them to inspect elements style to see exactly why something isn't working. Rather than the old methods of try this property, refresh browser maybe it'll work. Instead you can try your ideas live!</p>

<p>Spend some time familiarising yourself with the top browser tools: <a href="https://developer.chrome.com/devtools">Chrome</a>, <a href="https://developer.mozilla.org/en-US/docs/Tools">Firefox</a>, <a href="http://www.opera.com/dragonfly/">Opera</a>, <a href="https://developer.apple.com/safari/tools/">Safari</a>, <a href="https://msdn.microsoft.com/en-us/library/bg182326(v=vs.85).aspx">IE</a>, <a href="https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/f12-devtools-guide/">Edge</a>.</p>

<p><a href="https://www.codeschool.com/courses/discover-devtools">Here's a free course on the chrome dev tools, really worth a watch.</a></p></li>
</ol>

<p><a id="selectingbrowsers"></a>  </p>

<h2 id="selectingbrowserstotest">Selecting browsers to test</h2>

<p>Always test the latest browsers, versions &amp; platforms. <br>
Chrome latest, Firefox Latest, IE11, Edge Latest. Android Chrome latest, IOS Safari latest etc. <br>
This is the quickest way to be extra safe with your design. </p>

<p><strong>Working with an existing site</strong></p>

<p>If your existing site has analytics, this is the perfect place to start to make sure you cover it's most used devices, browsers and versions. <br>
For example, just because you've tested on the latest IOS safari version, doesn't mean that's the version that's currently most in use for this site. <br>
It's really worth checking the browsers that bring the most visitors and importantly the most conversions. </p>

<p>Login to Analytics > Audience > Technology > Browser &amp; OS. <br>
Then you can also click on a specific browser to then find a tab to see specific versions of that browser.</p>

<p>Be sure to set the date range for last month, and then also compare to last 6 months. </p>

<p>You can check out device/browser sizes if you click the Screen resolution tab at the top, though my personal recommendation is to make your design adapt to all screen widths rights down to 320px <em>(or 240px if you can but not always so easy)</em>.</p>

<p>If it's an ecommerce store &amp; revenue is stored too then you can see which devices, browsers and versions generate revenues. This is important, as if a specific older browser is bringing in thousands, maybe a couple big customers use it, it may not even be a popular browser but if it brings in the bucks, you'd better be supporting it ;).</p>

<p><a href="https://www.aabacosmallbusiness.com/advisor/google-analytics-browsers-visitors-220046730.html">Find out more details on using Google analytics to find browser support here</a>.</p>

<p><a id="whybrowserstack"></a>  </p>

<h2 id="browsertestingwithbrowserstack">Browser testing with BrowserStack</h2>

<p>Ok, I cannot stress the importance of this tool: <a href="https://www.browserstack.com/start">BrowserStack</a></p>

<p><em>This may sound like an advert for BrowserStack, I just really love their tool.</em></p>

<p>Here's my 5 favourite features it has!</p>

<ol>
<li>Test on all the major browsers &amp; versions,  </li>
<li><p>On all the major platform versions of Windows, OS X, Android, IOS &amp; Windows Phone. - It's not just about the browsers, its also about the different versions of them, and the different platforms they are on. <br>
When a client calls up saying they have a problem on IE 10 on Windows 8, you can fire up BrowserStack and test the same as them. <br>
<em>Speaking of which, tools like <a href="http://fmbip.com/get-started/">Findmebyip.com</a> offer urls you can share with your clients to find out what browser they are currently using as often people don't know.</em>  </p></li>
<li><p>These are not emulators, real browsers on real platforms! I've had designers tell me before they don't trust services like this because it's not the real device, which i understand, but with BrowserStack you really have access to real instances of windows and OS X with the real browsers installed. Also for mobile they have "Physical Devices" which are real devices in a device farm BrowserStack have so you're really on the device testing! They also offer emulators for some mobile devices they don't have, but the physical devices cover most cases.</p></li>
<li><p>Their <a href="https://www.browserstack.com/mobile-features">mobile features</a> are top notch. <strong>Access to dev tools on mobile devices</strong> is more important than I can express! This one feature really is worth the subscription on it's own. </p></li>
<li><p>Zero setup &amp; it boots up super fast! Starting up a test laptop or VM can take longer and on a good connection BrowserStack feels fairly smooth!</p></li>
</ol>

<p>Bonus feature: Built in issue tracker, I haven't used this feature much but on a project where you're testing but not the developer, you can use this to keep screenshots as a list of issues for the designer/developer to fix. </p>

<h3 id="asidenotesontestingapps">Aside notes on testing apps</h3>

<p>I'll mention here BrowserStack is not the only tool out there for this, It's the one I use most and personally I believe it's the best tool for the job. It's worth knowing about other similar tools such as: <a href="http://browsershots.org/">Browsershots</a>, <a href="https://turbo.net/browsers">turbo.net/browsers</a> and <a href="https://www.browserling.com/">Browserling</a></p>

<p>It's no replacement if you already have the device in front of you, but you wont have all the different versions in front of you. You may have a couple iphones in the office, maybe even different models. But are they on different IOS versions and therefore different mobile safari versions? Don't forget about people who haven't upgraded their phones yet, and no, saying "they should just upgrade" is not an excuse! <em>(Something a friend once said to me with his design after I pointed out an IOS 5 issue, sighs)</em>.</p>

<p>Also worth noting, if browserstack is not available to you, or it's too slow, you can use VMs for windows / IE / Edge debugging, in fact <a href="https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/linux/">Microsoft provides these free</a>. </p>

<p>For mobile device debugging, you can use dev tools with chrome's remote debugging feature. <a href="https://developer.chrome.com/devtools/docs/remote-debugging">Follow this tutorial on how to set this up.</a></p>

<p><a id="testing"></a>  </p>

<h2 id="testinglikeapro">Testing like a pro</h2>

<p>These are some brief tips to testing, but all this boils down to using the site like a real user.</p>

<ol>
<li>Resize in and out on every page.  </li>
<li>Scroll up and down while resizing, don't just load it on small screen and assume because the top of the page is ok that the rest will be too.  </li>
<li>Click every link, to the point of trying to break the site.  </li>
<li>Following on from the previous tip, try to break the site! Don't just test the things you already know work, try to think outside the box, your users certainly will.  </li>
<li>Pay special extra attention to custom interactions you've added to the site. Just because it looks nice, doesn't always mean it works.  </li>
<li>When you do find bugs, use the browser dev tools like mentioned above, especially the console if it's an interaction / javascript issue.  </li>
<li>After testing, accept that you can't test everything perfectly, over time your testing skills will be better, but it's important you’re aware reports of bugs <em>will</em> come in. You need to be ready for those reports, ready to find out which browser has the issue if possible like we talked about above, and try to reproduce it in the same browser version. </li>
</ol>

<h3 id="additionaltestingforbonuspoints">Additional testing for bonus points</h3>

<ol>
<li>Test performance with <a href="https://developers.google.com/speed/pagespeed/insights/">Google Page Speed</a>.  </li>
<li>Test mobile friendliness using <a href="https://www.google.co.uk/webmasters/tools/mobile-friendly/">Google’s tool</a>.  </li>
<li>Check the SEO of pages, such as title tag, meta tags, single <code>&lt;h1&gt;</code> tag, alt tags on images etc. Moz offer some <a href="https://moz.com/blog/designing-for-seo">great information</a> on this. </li>
</ol>

<p>I hope this has been useful, please leave a comment below with any of your own tips on browser testing to help improve this resource for others. </p>]]></content:encoded></item><item><title><![CDATA[Using Makefiles for simple build scripts]]></title><description><![CDATA[<p>Makefiles are probably one of the most useful tools in my belt. They allow me to create repeatable tasks which I can run with a  simple command. </p>

<p>You may ask, why not just run the commands separately, which obviously works, but you need to remember all those commands and the</p>]]></description><link>https://blog.stapps.io/using-makefiles-for-simple-build-scripts/</link><guid isPermaLink="false">10ae02f4-2160-480d-8208-e6e6ef9dbcac</guid><category><![CDATA[Design]]></category><category><![CDATA[Development]]></category><category><![CDATA[php]]></category><category><![CDATA[Makefile]]></category><category><![CDATA[Build]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Sun, 29 May 2016 17:35:28 GMT</pubDate><content:encoded><![CDATA[<p>Makefiles are probably one of the most useful tools in my belt. They allow me to create repeatable tasks which I can run with a  simple command. </p>

<p>You may ask, why not just run the commands separately, which obviously works, but you need to remember all those commands and the order of which you run them, or write them in a README or similar. Instead, Makefiles offer a simple way to build repeatable commands for a single or series of other commands in a way that you can quickly run when you come to a project. <em>Especially useful when you have new people take over a project, or when you yourself come back to a project a few months or so later.</em></p>

<p>You use them via the terminal / command line like so:  </p>

<pre><code class="language-bash">cd ~/projects/my-project  
make do-something-cool  
</code></pre>

<p>
Where <code>do-something-cool</code> is the command you want to run in the file. </p>

<p>Many people use Makefiles in different ways, I often don't use many of the more complex features Makefiles have and a number of the tutorials start with a steep learning curve using them. <br>
Instead I'll show you a simple example file from a real project I have.</p>

<p>In this example, I have a project where I need to build / minify some javascript and css for performance. I want to run a linter over some files to be sure the sytnax is a-ok, and then I have written some tests for the code and need to be able to run them quickly after i make changes.</p>

<p>Here's an example of this in a <code>Makefile</code> file.  </p>

<pre><code class="language-bash">build:  
    jsmin js/app.js &gt; js/app.min.js
    cssmin &lt; css/app.css &gt; css/app.min.css

test: lint unit-test

lint:  
    find . -name \*.php | xargs -L1 -P4 php -l

unit-test:  
    phpunit .
</code></pre>

<p><strong><em>If you copy this code, make sure you use tabs instead of spaces as Makefiles require them.</em></strong></p>

<p>Let's break down the above.</p>

<ol>
<li><code>make build</code> runs 2 commands, <a href="https://www.npmjs.com/package/jsmin">jsmin</a> and <a href="https://www.npmjs.com/package/cssmin">cssmin</a>. These are npm modules i have installed globally. They minify my js and css code.  </li>
<li><code>make test</code> runs 2 other commands but these are other make commands. First it runs lint (which could separately be run as <code>make lint</code>, this checks the syntax of my php files for the project, using <code>find</code> to find all the php files, piped to <code>xargs</code> which then allows me to run <code>php -l</code> for each file. Then it runs unit-test, again this could be run on it's own as <code>make unit-test</code> which runs my phpunit tests. But having a single <code>make test</code> command allows me to run both with ease.  </li>
</ol>

<p>There's plenty more resources out there for learning more about Makefile's, but hopefully this will show how simple and useful they can be. </p>

<p>It's pre installed on Linux &amp; Mac OSX, and on windows you'll need to download something like <a href="http://www.mingw.org/">MinGW</a> to get it installed.</p>]]></content:encoded></item><item><title><![CDATA[REC FTP development using Atom editor]]></title><description><![CDATA[<p>Following on from my <a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/">post on FTP development with REC</a> where I used Sublime Text 2. I believe it's worth trying out other editors to find one that works well for you. Also this editor is FREE which is a big bonus ;).</p>

<p><strong>(UPDATE: Newer post <em>(2019)</em> for <a href="https://blog.stapps.io/livereload-with-ftp/">vscode &amp; live</a></strong></p>]]></description><link>https://blog.stapps.io/ftp-development-using-atom-editor/</link><guid isPermaLink="false">132d06b9-97f1-4121-ab8c-f1f91cbe547b</guid><category><![CDATA[REC]]></category><category><![CDATA[Template]]></category><category><![CDATA[FTP]]></category><category><![CDATA[Design]]></category><category><![CDATA[Development]]></category><category><![CDATA[Responsive]]></category><category><![CDATA[Atom]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Thu, 03 Dec 2015 11:36:56 GMT</pubDate><content:encoded><![CDATA[<p>Following on from my <a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/">post on FTP development with REC</a> where I used Sublime Text 2. I believe it's worth trying out other editors to find one that works well for you. Also this editor is FREE which is a big bonus ;).</p>

<p><strong>(UPDATE: Newer post <em>(2019)</em> for <a href="https://blog.stapps.io/livereload-with-ftp/">vscode &amp; live reload</a> now available too)</strong></p>

<p>In this tutorial we'll quickly get setup with <a href="https://atom.io">Atom</a>, it's is a newer editor from the guys at Github. Completely open source, free and built in javascript which makes it pretty interesting (to me at least).  </p>

<h2 id="stepstogetstartedforrecsitedevelopment">Steps to get started for REC site development:</h2>

<ol>
<li><p>Visit <a href="https://atom.io">Atom.io</a>, download and install</p></li>
<li><p>Now we have the editor installed, lets start installing some packages to begin development.</p>

<p>We need to head to the settings view, you can open this by navigating to Edit > Preferences (Linux), Atom > Preferences (OS X), or File > Preferences (Windows).
It's worth exploring some of the available settings, keybindings/shortcuts and other areas.</p>

<p>To install the package we want click on the "+ Install" tab on the left.</p>

<p>The first package we'll install if for Twig syntax highlighting. 
Search for "php-twig" and hit enter.</p>

<p>It's also worth setting up your theme as you'll spend a long time stairing at the screen, you'll want it to be nice :). Click the "Themes" tab on the left.
e.g. I've chosen to use "One Dark" for the UI Theme, and "Atom Dark" for the Syntax Theme.
You can also view and install other Themes from the "+ Install" tab, by clicking the Themes toggle next to the search input. </p></li>
<li><p>Back to installing packages, lets also install an FTP package to work with the REC files. <br>
I've chosen to use remote-sync for this demo, but there are several other ftp packages that may work well for you too. </p></li>
<li><p>Create a new empty folder for this project <br>
(However you normally create folder, e.g. via a file manager program on your computer, or via the terminal using <code>mkdir myproject</code>)</p></li>
<li><p>Add project folder to Atom, "File" > "Add Project Folder..." and select the folder</p></li>
<li><p>Right click on the folder on the left, > "Remote Sync" > "Configure"  </p>

<ul><li>Toggle FTP at the top (instead of SCP/SFTP)</li>
<li>Set Hostname as the site's domain name or IP if not live on domain</li>
<li>Port as 21</li>
<li>Target directory as /</li>
<li>Username as the ftp user (in the REC site > Admin > FTP Access > User, for the views@... account)</li>
<li>Enter password, also given in the admin ftp access area.</li>
<li>Tick to upload on save and to delete on local delete (if you'd like these settings)<br><br></li></ul></li>
<li><p>Right click again on the folder on the left, > "Remote Sync" > "Download Folder" <br>
(this may take a few minutes as there are many files)</p></li>
<li><p>Start editing files, (on save it should upload, if not after the first time you may need to restart Atom) <br>
Also after restarting Atom, the first save/upload can take a while, for me on a fairly fast internet connection it took almost 1 minute for this initial connection. But then all save/uploads after take less than a second so it's just a little wait at the start of each coding session which isn't so bad. You could also try out one of the other ftp packages available for Atom if this becomes too much of a pain. </p></li>
<li><p>From here you have your project folder ready to start development, and for a walk through on getting started with REC development please see my <a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/">previous post</a> on this, but just skip over the Sublime Text setup instructions.</p></li>
</ol>

<p>I hope this helps you get started with Atom, leave a comment below for any further help.</p>

<p>There's plenty details on <a href="https://atom.io/docs/v1.2.4/">using Atom here</a>, along with <a href="https://www.youtube.com/watch?v=bo5MM2N_3tw">this video</a> to help you get started.</p>]]></content:encoded></item><item><title><![CDATA[Responsive breakpoints preview tool]]></title><description><![CDATA[<p>I'll start by saying there really are loads of great tools out there to preview sites on different viewports / screen width. <br>
Such as: <a href="http://mattkersley.com/responsive/">http://mattkersley.com/responsive/</a>, <a href="https://www.responsinator.com/">https://www.responsinator.com/</a> and <a href="http://responsivedesignchecker.com/">http://responsivedesignchecker.com/</a>.</p>

<p>And even some tools that offer excellent detection of media queries / breakpoints and then automatically</p>]]></description><link>https://blog.stapps.io/responsive-breakpoints-preview-tool/</link><guid isPermaLink="false">6f7317d1-bd94-4146-bdf6-775238cf5661</guid><category><![CDATA[Responsive]]></category><category><![CDATA[Testing]]></category><category><![CDATA[Design]]></category><category><![CDATA[Development]]></category><category><![CDATA[CSS]]></category><category><![CDATA[REC]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Wed, 02 Dec 2015 23:59:00 GMT</pubDate><content:encoded><![CDATA[<p>I'll start by saying there really are loads of great tools out there to preview sites on different viewports / screen width. <br>
Such as: <a href="http://mattkersley.com/responsive/">http://mattkersley.com/responsive/</a>, <a href="https://www.responsinator.com/">https://www.responsinator.com/</a> and <a href="http://responsivedesignchecker.com/">http://responsivedesignchecker.com/</a>.</p>

<p>And even some tools that offer excellent detection of media queries / breakpoints and then automatically create iframes of each so you can quickly view them, such as: <a href="http://breakpointtester.com/">http://breakpointtester.com/</a> and <a href="http://re-view.emmet.io/">http://re-view.emmet.io/</a></p>

<p>The 1st set of tools are great, especially when demoing to clients to help them see different specific devices. <br>
While the 2nd set of tools are also really useful when developing to see the different breakpoints built in and to quickly demo them side by side too. <br>
The minor downside to these 2nd set of breakpoint tools however is they are either browser plugins or bookmarklets, which for some clients will not make a lot of sense. </p>

<p>Instead we need a tool like the 1st ones where you can link to it, but with breakpoint detection like the 2nd set of tools.</p>

<p>And so, here's a new tool you can use: <br>
<a href="http://responsive.stapps.io/">http://responsive.stapps.io/</a></p>

<p>Like the other tools, this only works on sites that don't block iframe access, e.g. google blocks it's site from being viewed in an iframe. </p>

<p>Also, unlike some of the other tools, it currently only works on sites with css breakpoints  / media queries. </p>

<p>It has 2 display modes, the default one is a slider of each display size, you can use the arrows on the side or keyboard to navigate between them. <br>
Then the other display mode is to show all the sizes next to each other, like the other breakpoint based tools, which is useful for quick comparisons. <br>
<em>You'll need to click "run" again to change the display modes.</em></p>

<p>It's pretty new so message me about any bugs, but enjoy :).</p>

<p><em>If you're an REC user, you can find a link to this under the preview url in Admin > Templates > Open/Edit Template</em></p>]]></content:encoded></item><item><title><![CDATA[Diving into FTP development with REC]]></title><description><![CDATA[<p>As well as via the admin interface, you can use FTP to gain a greater level of control over the design of your <a href="http://www.reallyeasycart.co.uk/">REC</a> site by being able to directly access the files. <a href="http://support.reallyeasycart.co.uk/support/solutions/articles/210152-ftp-access">Why is this useful?</a> </p>

<h3 id="contents">Contents</h3>

<ol>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#prerequisites">Prerequisites</a>  </li>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#startinganewproject">Starting a new project</a>  </li>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#firsttimenotes">First time notes</a>  </li>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#divingin">Diving in</a>  </li>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#nextsteps">Next steps</a></li></ol>]]></description><link>https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/</link><guid isPermaLink="false">0fd73fcd-11bb-4f05-af9f-10c3cde3d50b</guid><category><![CDATA[REC]]></category><category><![CDATA[Template]]></category><category><![CDATA[FTP]]></category><category><![CDATA[Design]]></category><category><![CDATA[Development]]></category><category><![CDATA[Responsive]]></category><dc:creator><![CDATA[Andrew Stilliard]]></dc:creator><pubDate>Wed, 25 Nov 2015 16:00:17 GMT</pubDate><content:encoded><![CDATA[<p>As well as via the admin interface, you can use FTP to gain a greater level of control over the design of your <a href="http://www.reallyeasycart.co.uk/">REC</a> site by being able to directly access the files. <a href="http://support.reallyeasycart.co.uk/support/solutions/articles/210152-ftp-access">Why is this useful?</a> </p>

<h3 id="contents">Contents</h3>

<ol>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#prerequisites">Prerequisites</a>  </li>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#startinganewproject">Starting a new project</a>  </li>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#firsttimenotes">First time notes</a>  </li>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#divingin">Diving in</a>  </li>
<li><a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#nextsteps">Next steps</a></li>
</ol>

<h2 id="prerequisites">Prerequisites</h2>

<p>We'll need an editor to work with the template files, for the purpose of this demo we'll be using <a href="http://www.sublimetext.com/2">Sublime Text 2</a>, although there are plenty others you may prefer such as <a href="http://brackets.io/">Brackets</a>, <a href="https://atom.io/">Atom</a>, <a href="http://www.adobe.com/uk/products/dreamweaver.html">Dreamweaver</a>, more info on <a href="http://blog.teamtreehouse.com/which-text-editor-should-i-use">choosing an editor here</a>.</p>

<p><strong>(UPDATE: I have a <a href="https://blog.stapps.io/ftp-development-using-atom-editor/">new post on using Atom</a>, a free text editor, instead of sublime in case you're interested. You can still use this post for getting started if you skip over the sublime references, down to <a href="https://blog.stapps.io/diving-into-ftp-devleopment-with-rec/#firsttimenotes">First time notes</a>)</strong></p>

<p><strong>(UPDATE 2: &amp; a newer post <em>(2019)</em> for <a href="https://blog.stapps.io/livereload-with-ftp/">vscode &amp; live reload</a>)</strong></p>

<p>With which ever editor you choose you'll need to use <a href="https://www.google.co.uk/search?q=ftp">FTP</a> to transfer files back and forward between your computer and the site, either setup within the editor or you can use a separate ftp client such as the <a href="https://filezilla-project.org/">Filezilla Client</a>. <br>
But here we'll use Sublime Text's excellent SFTP package. </p>

<p>Checklist: <br>
1. Sublime Text 2 installed (<a href="http://www.sublimetext.com/2">http://www.sublimetext.com/2</a>) <br>
2. Sublime Package Control installed (<a href="https://packagecontrol.io/installation#st2">https://packagecontrol.io/installation#st2</a>) <br>
3. Sublime SFTP plugin installed (<a href="https://wbond.net/sublime_packages/sftp/installation">https://wbond.net/sublime_packages/sftp/installation</a>)  </p>

<h2 id="startinganewproject">Starting a new project</h2>

<p>To start we'll want to create a new folder to work in and open Sublime Text with our site files in ready to begin coding. Follow these steps for Sublime Text.</p>

<ol>
<li>Create a folder for us to work in  </li>
<li>Open Sublime  </li>
<li>(In Sublime) "Projects" > "Add Folder to Project..."  </li>
<li>(In Sublime) right click on folder name in sidebar > "SFTP/FTP" > "Map to Remote..."  </li>
<li>Setup the sftp-config.json file <br>
<ul><li>set the type as either "ftps" or "ftp" instead of "sftp" (ftps is a more secure choice)</li>
<li>set your <code>host</code>, <code>user</code> and <code>password</code> (found in your REC site > Admin > FTP Account)</li>
<li><code>port</code> is 21</li>
<li>set file permissions: <code>"file_permissions": "666", "dir_permissions": "777",</code></li>
<li>choose other useful configuration, e.g. 
<ul><li><code>"upload_on_save": true,</code>  - To always upload back to the server when you save the file</li>
<li><code>"sync_down_on_open": true,</code>  - To always re-download the latest version of a file from the server on open</li></ul></li>
<li>Here's an <a href="http://support.reallyeasycart.co.uk/solution/articles/210164-sublime-text-2-3-example-setup">example config</a> for you to compare to if you'd like.</li></ul></li>
<li>Save the sftp-config.json file  </li>
<li>Now download the current files, (In Sublime) right click on folder name in sidebar > "SFTP/FTP" > "Download Folder"  </li>
<li>If everything was configured ok it should start to download all the template folders into your folder. <em>If you have any issues try switching from ftps to ftp, but please leave a comment at the bottom if you have any issues.</em></li>
</ol>

<h2 id="firsttimenotes">First time notes</h2>

<p>Things to keep in mind when developing within REC.</p>

<p><strong>File Permissions</strong></p>

<ul>
<li>The *-base folders are locked, you won't be able to change or delete these files and folders on the site.</li>
<li>but you can work within the *-site folders, by default you'll want to work in the "responsive-site" folder</li>
<li>and you can create new folders for new templates or variations on your design, e.g. a Christmas folder for any minor tweaks to promote extra Christmas sales</li>
</ul>

<p><strong>HTML files</strong></p>

<ul>
<li>These are the core template files</li>
<li>The 0-base, legacy-base and responsive-base are our officially updated themes. Legacy-base is for sites built before responsive-base came out. </li>
<li>Your files will sit in your template folder, and by default this is the "responsive-site" folder. </li>
<li>Files in a child template like responsive-site override the parent template files such as responsive-base.</li>
<li>E.g. When the system renders the middle section of the page (html/layouts/index.html.twig) it first looks for this file in the live template folder, e.g. responsive-site. If that file is found here it will use it, else it will check it's parent folder, responsive-base, if the files found here it will use it, else it will check in the parent of this parent template, 0-base.</li>
<li>The syntax used in these files in HTML + Twig.</li>
<li>Twig is a template language we use to allow you access to the system, e.g. to show variables such as a products name ( e.g. {{ product.name }} ) and price on the products page ( html/store/product_info.html.twig )</li>
<li>Documentation is available on <a href="http://twig.sensiolabs.org/doc/templates.html">Twig</a> and there's a <a href="http://twig.stapps.io/">playground</a> to test Twig ideas outside of REC. </li>
</ul>

<p><strong>CSS / JS files</strong></p>

<ul>
<li>Store your css in css/site.css.twig inside your template folder. </li>
<li>Same for your js, store inside js/site.js.twig</li>
<li>You can however include multiple other files into these files with Twig, we'll talk more about this later :)</li>
<li>The "responsive-base/css/" folder is full of useful css files, mainly in the "modules/" folder, where all the style of the site is stored.</li>
<li>Like the html files you can place a file in the same location but in your responsive-site folder and it will override it, but if you do you'll loose updates to this file as you'll be overriding it.</li>
<li>This works well such as for replacing the nav styling entirely, you'd want to remove the default style and you would not care about the upgrades to it, as you'd be using your own custom version.</li>
<li>But if you wanted to keep using the same nav and only make a minor change to it would be best to make your changes in a separate file loaded from site.css.twig</li>
<li>The css/main.css.twig and js/main.js.twig files as seen in the responsive-base folder are the main files used to include all the other files we use to build the template. <strong>Don't</strong> override these files, as you'd loose new files being included and any other updates to it. Instead use the css/site.css.twig and js/site.js.twig files. These site files are included at the bottom of the main files. You can use them to include other files in the same way but we leave these files blank purposefully for you to use. </li>
</ul>

<p><strong>Javascript / jQuery</strong></p>

<ul>
<li>jQuery comes pre-installed in all REC sites.</li>
<li>We currently use version 1.11.3, and you can change this by overriding the html/sections/head/jquery.html.twig file like all others.</li>
<li>However in REC <code>$</code> does not by default reference to jQuery as we have an older javascript lib also included called Prototype.js. In time we'll remove Prototype.js but when using jQuery you'll need to wrap your code so that you <code>$</code> is jQuery for you. 
This can be done with:  </li>
</ul>

<pre><code class="language-javascript">(function ($) {

// your code... executed immediately, before dom ready

}(jQuery));
</code></pre>

<p>Or  </p>

<pre><code class="language-javascript">jQuery(function ($) {

// your code... executed on dom ready
// same as using jQuery(document).ready(function ($) { ... });

});
</code></pre>

<p>&nbsp;</p>

<p><strong>Caching</strong></p>

<ul>
<li>Our css/js/images etc. all cache in the browser for 1 month. </li>
<li>This is great for performance, but during development you'll want to always see your latest code changes.</li>
<li>You'll either want to always use <a href="http://wiki.scratch.mit.edu/wiki/Hard_Refresh">hard refreshes</a></li>
<li>or set your browser to not cache (e.g. in chrome's developer tools, on the network tab you can tick to disable cache, this will force hard refreshes for you automatically when)</li>
<li>Also once you've finished work via ftp you'll want to bump the version for users browsing the site if it's already live. You can do this in REC site > Admin > Templates > "Bump Cache Buster". </li>
</ul>

<h2 id="divingin">Diving in</h2>

<p>Currently I'm working on a redesign of <a href="http://www.impkids.co.uk/">Impkids</a> clothing site. <br>
I have a few tasks to work through with you here including:</p>

<ol>
<li>Enable preview mode, as this is a live site currently running the legacy-site template and I don't want the changes to show till I'm done.  </li>
<li>Move the slider next to the sidebar above the main content, instead of above the entire middle section as it is by default.  </li>
<li>Style the outer design of the site in css.</li>
</ol>

<p><strong>Preview mode</strong></p>

<p>First, lets enable the preview mode. REC site > Admin > Templates > Hover over the responsive-site template folder and click "Preview". <br>
This will open a new tab with the site in for you, and you're ready to start work in this folder in a preview that only you can see. </p>

<p><strong>Moving the slider</strong></p>

<p>Now we'll work on moving that slider. <br>
If we look in responsive-base, the default layout file that loads in the slider is at <code>html/layouts/index.html.twig</code>. So we need to create a file at this same path, and the <code>layouts</code> directory it's in. </p>

<blockquote>
  <p>In Sublime you can create a new folder by right clicking on the parent folder, in our case responsive-site/html/ and then select "New Folder...". Then the same to create a new file except click "New file...".</p>
</blockquote>

<p>In this file we'll copy the contents from the responsive-<em>base</em> version and paste into our new responsive-<em>site</em> file. <br>
With this file copied in we can take the slider block and move it down to under the <code>&lt;main&gt;</code> element.</p>

<p>Lines 12 to 17 should be:  </p>

<pre><code class="language-twig">{# slider #}
{% block content_slider %}
    {% if page.show_content_slider %}
        {{ page.content_slider }}
    {% endif %}
{% endblock %}
</code></pre>

<p>Which is inside the middle div/section of the page, but we want it to the side of the sidebar so if you cut this chunk out and paste onto what is now line 26, just above the <code>{% if page.show_content %}</code> area. <br>
Save the file and with our FTP sync setup previously it should send this file up to the server.</p>

<p><strong>Styling the layout</strong></p>

<p>The existing Impkids site has a nice outer design where the main column has a white background with a shadow over a light orange background. <br>
We can use css to recreate this in our responsive design. <br>
As mentioned above, we will be putting our CSS into the <code>css/site.css.twig</code> file in responsive-site. </p>

<p>The responsive-site directory comes with this file ready and left blank for you. </p>

<pre><code class="language-css">/* ----- Main outer theme ----- */
body {  
    /* light orange background */
    background-color: #FDC288;
}
/* the layout container is used for the main 3 sections of the page, the header, middle and footer */
.layout-container {
    /* We want the main content on a white background */
    background: #FFF;
    /* with a semi-transparent shadow to the sides */
    box-shadow: 0 20px 20px rgba(0, 0, 0, 0.3);

    /* Add some margin to reveal the box-shadow too */
    margin: 0 15px;
    /* and some padding so content inside the layout is not too close to the edge */
    padding: 0 15px;
}
</code></pre>

<p>This gives us the outer design, but lets also talk about the header design. <br>
Impkids logo image is a little unusual, usually the site's logo is uploaded via Admin > Site Setup, however for Impkids it's not and we don't want to upload it now as to not affect the live site in any way. <br>
Instead we will set the logo on the currently blank header-logo element in the header and size it like so:  </p>

<pre><code class="language-css">/* header logo */
.header-logo {
    background: url("/userfiles/impkids/images/IMPLOGO.png");
    position: absolute;
    width: 185px;
    height: 140px;
    left: 32px;
    top: -3px;
    z-index: 999;
    color: #FDC288;
}
</code></pre>

<p>This gives us our header logo image, and next we can move onto the navigation...</p>

<p>We want to move the navigation over to the side of the logo on larger screens and style it like the current site. </p>

<p>I won't go through all the css here but you can see we're moving the nav over (leaving space for our logo), making the nav top of the nav transparent by default and the sub links have a white background. <br>
Then the active link and hover links are large orange bubbles around white text. </p>

<p>The difference here is I only want to change this on larger screens, on the phone and small tablet size we want to use the default nav as it's optimised for touch. </p>

<p>We use media queries to change the display as the screen size increases. <br>
The default screen breakpoints we use are: 35.5em, 48em, 64em, 80em. <br>
A great example of this is in responsive-base/css/modules/pull.css</p>

<pre><code class="language-css">.pull-left { float: left; }
.pull-right { float: right; }

/* same sizes as defined here: http://purecss.io/grids/#pure-responsive-grids */
@media screen and (min-width: 35.5em) {
    .pull-left-sm { float: left; }
    .pull-right-sm { float: right; }
}
@media screen and (min-width: 48em) {
    .pull-left-md { float: left; }
    .pull-right-md { float: right; }
}
@media screen and (min-width: 64em) {
    .pull-left-lg { float: left; }
    .pull-right-lg { float: right; }
}
@media screen and (min-width: 80em) {
    .pull-left-xl { float: left; }
    .pull-right-xl { float: right; }
}
</code></pre>

<p>The above is from that pull.css file, it sets up default classes in css we can use in our html templates to pull elements to the left or right but maybe only at specific screen breakpoints. </p>

<p>It's worth exploring the css/modules/ directory in responsive-base as there are plenty files. </p>

<p>Back to this design though, our end navigation style looks like:  </p>

<pre><code class="language-css">@media screen and (min-width: 48em) {

    /* ----- nav ----- */
    #header .nav {
        left: 240px;
        bottom: 0px;
    }
    /* nav background to transparent*/
    #header .nav ul {
        background-color: transparent;
    }
    #header .nav ul ul {
        background-color: #FFF;
    }
    /* active link */
    #header .nav &gt; ul &gt; li:hover,
    #header .nav &gt; ul &gt; li.is-focused,
    #header .nav &gt; ul &gt; li.is-current {
        background-color: #F78F1E;
        border-radius: 10px;
    }
    #header .nav &gt; ul &gt; li:hover &gt; a,
    #header .nav &gt; ul &gt; li.is-focused &gt; a,
    #header .nav &gt; ul &gt; li.is-current &gt; a {
        color: #FFF;
    }

}
</code></pre>

<p>Now the outer and header styling is pretty close. <br>
There's still plenty for me to work on but I hope this helps you get started with your own designs. </p>

<p><strong>Cleaning up our work</strong></p>

<p>So far our CSS has all been added to our site.css.twig file, but we can actually separate it into multiple files. </p>

<p>e.g. we could take the outer "Main outer theme" part, the <code>body</code> and the <code>.layout-container</code> and put this into a <code>css/outer-layout.css</code> file, the same for the header styles into a <code>css/header.css</code> file.</p>

<p>Then back in the site.css.twig file you'll need to include the newly created files where the css used to be. We can do this with Twig so that we still end up with a single css file being sent to the browser e.g:  </p>

<pre><code class="language-twig">{{ source("css/outer-layout.css") }}
{{ source("css/header.css") }}
</code></pre>

<p>This part is up to you as it's your project. It's fine to leave all your style at first in the site.css.twig file, especially on a small project. But as this file grows you may want to look into doing this. </p>

<p>At this point we have a working responsive site, it's simple and though for my Impkids redesign I have much left to work on, this has just been a small dive into what's needed. The most important next step is to try out different designs, use your css skills and you have pretty much free reign over the style of the site. <br>
Feel free to contact me about any questions you may have on this or on anything to help improve this post for future readers, thank you.</p>

<h2 id="nextsteps">Next steps</h2>

<p>Where can you go from here?</p>

<ul>
<li>Read up on <a href="http://www.smashingmagazine.com/2011/01/guidelines-for-responsive-web-design/">Responsive design</a> (css, designing and workflow ideas)</li>
<li>Browser testing (e.g. using <a href="http://www.browserstack.com/">browserstack</a> or emulators or real devices)</li>
<li><a href="http://blog.teamtreehouse.com/git-for-designers-part-1">Version control</a>, it's useful to have a history of your changes
e.g. After downloading the files in step 6 you could use git to start a history of the files.</li>
</ul>]]></content:encoded></item></channel></rss>