Payment of ₹ requested by HONEY VIG. Click the link to pay securely via Razorpay: Make 5000 payment Payment of ₹ requested by HONEY VIG. Click the link to pay securely via Razorpay: Make 5000 payment ⭐ If you would like to buy me a coffee, well thank you very much that is mega kind! : https://www.buymeacoffee.com/honeyvig
Hire a web Developer and Designer to upgrade and boost your online presence with cutting edge Technologies

Tuesday, September 6, 2016

Using Testimonials to Increase Sales

 

Among the variety of techniques available to you as a marketer, there is one that is virtually guaranteed to increase your business…testimonials !

To clearly understand why testimonials are so powerful we must first look at the basic perceptions of our audience.

Here’s how "John Q. Customer" might describe his attitude:

"In addition to making me an enticing offer, you must prove to me that you are okay to do business with. You must eliminate any fear that I have about doing business with you. The basis of my fear is doubt and skepticism…two essential components for survival in today’s tough business marketplace.

I come by my fears honestly and from experience. I have been conned before. I have been lied to before. The quality of products and services that I have purchased in the past have not always lived up to the claims made for them.

Hardly a day passes that the nation’s press doesn’t reveal some major breech of ethics by business and political leaders. Dishonesty and misrepresentation are commonplace. So why, in the face of all this negative experience, should I believe your advertising claims? "

These are sobering conditions in which to operate. It’s easy to understand why customers temper their buying decision with caution. They don’t want to lose money and, more importantly, they don’t want to feel foolish. Eliminating this natural fear and skepticism is the job that testimonials do best. The reason is simple: If you say you are good, people ignore your self-serving back-patting. When others say you are good…it’s credible. This goes to the very heart of why testimonials are so powerful…they give us credibility and believability.

When you deliver a good compelling offer that is both credible and believable, your sales and profits will increase.

Types of Testimonials

There are four different types of testimonials. They are:

Customer: By far the strongest category of testimonial is the satisfied customer. In consumer offers a 30% increase in business is not unusual, and business-to-business offers often double or triple results through the use of good customer testimonials.

Celebrities: Celebrities are not as believable as customers. They are not credible because they are paid. I may not like the celebrity which could negatively affect my attitude towards your company or product. They generally increase awareness, but it may not be good awareness.

Experts: If you are selling artificial hearts, then a testimonial from Dr. Denton Cooley would probably boost business. Even though he might be paid, he is so credible that it would probably work. Your expert must be an expert in a relevant field.

Expert Organizations: A trade association, a magazine in your field, a chamber of commerce, a newsletter, etc. Expert organizations carry a lot of weight because people believe that their opinion cannot be bought.

What makes a good customer testimonial?

To maximize the selling power of testimonials, you should keep a few tips in mind:

Tip#1 – Be Specific

Testimonials phrased in specific terms pull more weight than more general statements. For example…

"I increased my companies profits by $78,350 last year using your advice!"

is a lot more effective than..

"I enjoy working with your company."

Tip#2 – Cite Complete Attributions

"Mr. John Jones, President SMITH MANUFACTURING Chicago, ILrather than

" J. Jones, Chicago"

The more complete the attribution the more believable the testimonial.

Tip#3 – Use Customer Terminology and Phrasing

Resist any temptation to rephrase you customers’ words. You’ll generally lower the believability factor.

Tip#4 – Use Photos of the Testimonial Writer

You will triple the believability and selling power if you print a photo along with the words. Photographs of the person using your product work best.

How To Collect Usable Testimonials…

Collecting usable testimonials should be an organized and on-going marketing function.

First…Read the in-coming mail carefully and keep a file of customer comments. Follow-up on those with potential and put them in usable form.

Second…Analyze your customer list and develop a sub-list of your top 10% of customers by sales volume and frequency of ordering. Carefully craft a letter to this select list "Asking for their help". Suggest to them what you are looking for in the way of comments and then let them provide you with the raw material. The important lesson here: You can’t sit casually back and hope for testimonials to come your way. You have to go out and get them.

The reward, however, is always worth the effort. The time you spend nurturing your testimonial program will result in increased sales and profits, an improved image, more sales leads, lower sales costs, shortened selling cycles, and improved cash flow.

Saturday, September 3, 2016

Dump That Free Hit Counter And Start Tracking

 

Key Takeaways

  • Free hit counters, while providing a rough estimate of site visitors, can be detrimental to a site’s image and do not provide comprehensive data.
  • Successful websites, like Yahoo and Infoseek, do not display visible hit counters, indicating that this tool is not necessary for success.
  • Tracking visitors’ actions on a website provides valuable insight into user behavior, allowing for necessary adjustments and improvements to increase visitor-to-sales ratios.
  • CGI scripts, like AXS by Fluid Dynamics and Darryl Burgdorf’s WebLog, are recommended for detailed site tracking and can be implemented for free.

Dump That Free Hit Counter And Start Tracking

It seems that every other web site we visit has some sort of hit counter on the main page, supposedly telling us how many people have been there before us. This week we’re going to address this popular trend, explain why you don’t need one, and what you should be doing instead.

Most Internet marketers will normally implement a hit counter on their site for one or both of two reasons — to give them a rough estimate of the number of visitors, and/or to give visitors the impression that their site is popular and thus worthy of a good look.

Let’s consider the first reason. There is nothing wrong with wanting to know how many people have visited your web site, in fact it’s something that you really do need to know. But putting a visible hit counter on your home page is not the answer, especially not one of those free services.

For one thing, the free services require you to in some way promote their site. For another, they are normally slow and increase the time it takes for your pages to load. But most importantly, a hit counter doesn’t provide you with all of the information you need.

Just look at any of the top web sites on the Internet. We promise that you will not find a visible hit counter on any of them! That alone should tell you that the common hit counter is worthless. If a visible counter was worthwhile, don’t you think Yahoo or Infoseek would have one?

You just can’t win with a visible hit counter. If your site does not get many visitors, all it’s going to do is make sure that the visitors you do get know that they are not visiting a popular site. If anything, all this will do is discourage them from exploring your web site in detail.

On the other hand, maybe your site gets 50,000 visitors a day and you think that letting people know this via a hit counter is a good idea. Not really. If your web site gets lots of traffic it is because you are doing something right, and having a hit counter isn’t going to affect this.

Unfortunately, what normally happens is that the misguided Internet marketer will set up a visible hit counter on their home page and then artificially inflate their visitor count. This is done in the hopes that it will impress people, but it’s a terribly bad idea and does not work.

In the early days of the web it was “cool” to have a hit counter on your home page, but they are so commonplace these days that no one pays them any attention anyway. No matter what your reason for using a visible hit counter, we say dump it and start tracking!

Tracking Visitors’ Footsteps

While Yahoo and Infoseek don’t have visible counters on their pages, rest assured that they know your every move. No other advertising medium allows you to do the things the Internet does, and it amazes us that more marketers do not take advantage of serious site tracking.

Part of the problem seems to be that many Internet marketers are only concerned with promoting their web site and getting more people to visit. More visitors equals more sales right? Well yes that is true, but only if your web site leads visitors through the sales process.

Before you even begin promoting a web site, you should have in your mind the path that you want visitors to take through your site. Sales is a process. One step leads to the next, until finally the end result is hopefully that what was once just a prospect is now a customer.

Tracking your visitor’s footsteps throughout your web site is the best way to determine why they didn’t take the action that you wanted them to take. Who knows, maybe 80% of your visitors aren’t even making it past your introductory page? You’ll never know unless you track them.

Consider this another Internet marketing rule that is written in stone. If you’re not tracking your entire web site and tweaking it on a regular basis, you’re throwing money down the proverbial drain. From a profit standpoint, it is critical that you know the answers to questions like:

  1. How do visitors find your site in the first place?
  2. How many of them make it past the main page?
  3. Which page of your site is the most popular?
  4. How long does the average visitor stick around?
  5. What is the average number of pages viewed?
  6. What path do visitors take through your site?
  7. What links do they use to leave your site?

If you don’t know the answers to these simple questions, here’s an easy way to increase your profits starting immediately. And the good news is that it may not cost you anything other than some time. We’re going to show you how to use free CGI scripts to ultimately increase sales!

While you don’t really need to learn anything technical to use the scripts we’re going to suggest, you do need to be able to run CGI scripts on your web server. If you have no idea what CGI scripts are, ask your ISP. If they say no, we strongly suggest that you find a new ISP.

If you haven’t realized it by now, we are a big fan of CGI scripts because they are what allows you to add interactivity to your web site. But CGI scripts can also help you do many other things, like track your visitors’ footsteps.

  1. Go to http://www.cgi-resources.com
  2. Click on “Programs and Scripts”
  3. Click on “Perl”
  4. Click on “Logging Accesses and Statistics”

You’ll be presented with no less than 30 CGI script packages which will help you gather valuable information about your visitors, and believe it or not, most of them are free! We looked at all of them, so we’ll save you the time and suggest the two we like best to help you get started.

One of the first scripts we tried, and still one of our favorites, is AXS by Fluid Dynamics. It’s one of the first scripts listed and you can’t miss it. You can download it for free, and with a minimal amount of effort you could be tracking your entire web site within the next few hours.

The direct URL to the AXS site is http://www.xav.com/scripts/axs Rather than going into detail about it here, we’ll let you discover it for yourself. It’s a great system and the only thing we don’t like about it is that it creates it’s own log files, and they get huge if your site is busy.

The alternative is to use something like Darryl Burgdorf’s WebLog. The direct URL to this great script is http://awsd.com/scripts/weblog. It does everything AXS does, but it runs off of your existing server logs which makes it easier to set up for most. It’s also more efficient.

Both AXS and WebLog will give you all of the information you could ever want about your visitors, and both display this information in a way that is easy for you to interpret using graphs, etc. We encourage you to download and set up one of these scripts to track your web site.

My Site Is Being Tracked, What Next?

The point of tracking your site is to act on the information you gather and use it to improve your web site’s effectiveness. If you discover that 80% of your visitors aren’t making it past your home page, or that the average person leaves within 2 minutes, you now have your work cut out for you.

The real value of tracking your visitor’s footsteps is that it will help you determine why they did not take the action that you wanted them to take. Once you see how most people navigate your web site, you can then make changes until the path they take is the one you want.

Spend some time implementing a good tracking system on your site, because if you can increase your visitor-to-sales ratio even just a few percentage points it will be more than worth your time. Remember, it doesn’t matter how many hits you get if your site doesn’t do its job.

Frequently Asked Questions (FAQs) about Hit Counter and Website Tracking

How does a hit counter work?

A hit counter works by tracking and displaying the number of visitors or hits a website receives. It is a simple piece of code embedded in the website’s HTML. Each time a user visits the site, the counter increases by one. This provides a real-time count of the number of visitors to the website.

Why is a hit counter important for my website?

A hit counter is a valuable tool for understanding your website’s traffic. It helps you know how many people are visiting your site, which can be useful for marketing and SEO purposes. It can also help you identify peak traffic times and understand the effectiveness of your promotional efforts.

How can I install a hit counter on my website?

Installing a hit counter is relatively straightforward. You need to choose a hit counter service, sign up, and then you’ll be provided with a piece of code. This code should be embedded in your website’s HTML, usually in the footer or header section. Once installed, the counter will start tracking your website’s visitors.

Are hit counters accurate?

While hit counters provide a general idea of your website’s traffic, they may not be 100% accurate. This is because they count every visit, including multiple visits from the same user. However, they still provide a useful gauge of your website’s popularity and traffic trends.

Can a hit counter slow down my website?

Generally, a hit counter should not significantly slow down your website. The code used is usually lightweight and designed to load quickly. However, if you notice a slowdown after installing a hit counter, you may want to consider a different service or check for other issues with your website.

Can I customize the look of my hit counter?

Yes, many hit counter services allow you to customize the appearance of your counter. You can often choose from different designs, colors, and fonts to match your website’s aesthetic.

Does a hit counter track individual users?

A hit counter typically tracks the number of visits to your website, not individual users. However, some services may offer more advanced tracking features, such as tracking unique visitors or providing demographic information.

Can I use a hit counter on multiple pages of my website?

Yes, you can use a hit counter on multiple pages of your website. Each page will have its own count, allowing you to see which pages are the most popular.

Is a hit counter the same as a website analytics tool?

While a hit counter provides basic information about your website’s traffic, it is not as comprehensive as a website analytics tool. Analytics tools provide more detailed data, such as user behavior, bounce rate, and conversion rate.

Are hit counters free?

Many hit counter services are free, but some may offer premium features for a fee. These could include ad-free counters, advanced analytics, or more customization options.

Copyright For The Webmaster

 

Intellectual property theft is a growing problem on the Internet. Anyone can right-click on an image, save it to their hard drive, and then use it on their web site. Anyone can copy and paste an article or review from your site, reproduce it, and claim authorship of it. This article serves as a basic introduction to copyright law, and what you can do to protect your work. 

 What Is Copyright?

Copyright is a form of law protecting an author from having his or her work reproduced without authorization. Please note that copyright law does not cover names, ideas and in some cases logos. It does apply to written works, images, music, and photographs.

When Is My Work Copyrighted?

For starters, all work, with the exceptions of the types listed above, is copyrighted from the moment you create it. You don’t have to put a copyright sign on your work, nor register it in order for it to be protected under copyright law. Nevertheless, doing both of those things will help your case if you ever have to take anyone to court. Here’s the text that you should put at the bottom of every page on your site:

The contents of this site are copyright (c) 1999, Your Name. All Rights Reserved.

Be sure to replace (c) with the copyright symbol, which in HTML is “©” – without the quotation marks.

Registering With The US Copyright Office

Since copyright law prohibits the reproduction of work “in part or in whole” you can register your entire site and all its images as a single work with the US Copyright Office, and you’ll be protected under copyright law. The price of registration is $30. You can find more information at: http://lcweb.loc.gov/copyright/

If you’re in Canada, like me, go to: http://strategis.ic.gc.ca/. You’ll find a wealth of information on that page regarding Canadian copyright law, and how it applies to the Internet.

What’s “Fair Use”?

Fair Use law allows you to reproduce a small part of someone else’s work. For example, it is legal to quote a paragraph or two from a book for a report. It would also be legal to take two or three sentences from this article, or one of my reviews, and use the quote on your site. Just remember, that the content has to be attributed to the creator. Take a look at how Sausage Software quotes reviews on their site. That is completely legal.

Can I Prevent My Text/Images From Being Taken?

There is absolutely nothing that you can do to prevent someone from taking an image from your site, from viewing your source-code, or from copying and pasting content from your site. There are JavaScripts out there that will disable right-clicking on images, but these and every other method can be very easily bypassed. However, there is a service out there that will “watermark” your images, and then constantly scan the web looking for sites with images that contain your watermark. You can find more information about this innovative product and service at DigiMarc.com.

How Do I Avoid Getting Into Trouble?

Either create all of your own content, or get permission to reproduce the work of others and give them credit for it on your site.

Ask permission before using ANYTHING on your site that you didn’t create. If you can’t contact the creator of it, or you don’t know who the creator is, don’t use it. It’s better to play it safe, than have your site shut down by your web hosting company, getting sued, and potentially being convicted of a Federal crime.

Be sure to note that taking someone else’s work, and making modifications to it, and then claiming ownership is also illegal. The changes would have to be very substantial, and even then, if it has a resemblance to another work, you’d have a hard time proving your case in court.

What Should I Do If My Work Gets Stolen?

Follow the steps below, in order, until your work is removed from the offending site:

1. Contact the site owner and ask nicely for the content to be removed. If you can’t find an email address on the site go to: http://www.networksolutions.com/cgi-bin/whois/whois and contact the administrative contact of the domain name. If after 24-72 hours the content isn’t removed, move on to step two.

2. Contact the web hosting company. Once again go to: http://www.networksolutions.com/cgi-bin/whois/whois/ and look up the domain name of the offending site. This time look at the technical contact. You’ll see an email address listed there similar to this: joeshmoe@webhostingcompany.com . You now know the hosting company of the site. Fire off an email to abuse@webhostingcompany.com, complaining about one of their customers, citing specific examples of how the content on one of their customers sites resembles yours. If the hosting company refuses to take action move on to step three.

3. Contact an intellectual property lawyer and pay him/her to send a letter via certified mail to both the web hosting company and the owner of the site explaining your position. This is as far as this will likely go. Most hosting companies will remove the offending site after receiving a letter from a lawyer. If not, move to step four.

4. Sue the hosting company and site owner.

The Disclaimer

I am not a lawyer. This article is not meant to replace the advice from a qualified intellectual property lawyer.

What is copyright infringement and how does it affect webmasters?

Copyright infringement is the use of works protected by copyright law without permission, infringing certain exclusive rights granted to the copyright holder, such as the right to reproduce, distribute, display, or perform the protected work. For webmasters, this could mean using copyrighted images, text, videos, or other content on their website without the necessary permissions. This could lead to legal consequences, including fines and penalties.

How can I protect my website content from copyright infringement?

There are several ways to protect your website content from copyright infringement. Firstly, clearly state on your website that your content is protected by copyright. You can also use a watermark or other visible mark on images and videos. Additionally, you can use digital rights management (DRM) tools to prevent unauthorized copying or sharing of your content. Lastly, regularly monitor your content online to ensure it’s not being used without your permission.

What should I do if I find my copyrighted content on another website?

If you find your copyrighted content on another website, you can send a cease and desist letter to the website owner or webmaster. If the content is not removed, you can file a DMCA (Digital Millennium Copyright Act) takedown notice with the website’s hosting provider. If all else fails, you may need to take legal action.

How can I find out who the webmaster of a website is?

You can find out who the webmaster of a website is by checking the website’s ‘Contact Us’ or ‘About Us’ page. If this information is not available, you can use a WHOIS lookup service to find the registered owner of the domain.

What is a DMCA takedown notice and how does it work?

A DMCA takedown notice is a legal request to remove copyrighted content from a website. It is sent to the website’s hosting provider or the webmaster of the website. The notice must include specific information, including a statement that the complaining party has a good faith belief that the use of the material is not authorized by the copyright owner.

Can I use copyrighted material on my website if I give credit to the original author?

Simply giving credit to the original author does not necessarily protect you from copyright infringement. You still need to obtain permission from the copyright owner to use their material on your website.

What is fair use and how does it apply to webmasters?

Fair use is a legal doctrine that allows limited use of copyrighted material without permission from the copyright owner. It applies to situations such as criticism, comment, news reporting, teaching, scholarship, and research. For webmasters, fair use might apply if they are using copyrighted material for one of these purposes, but it’s a complex area of law and it’s always best to seek legal advice.

How can I obtain permission to use copyrighted material on my website?

To obtain permission to use copyrighted material on your website, you need to contact the copyright owner directly. This could be the author, publisher, or other rights holder. You should clearly state how and why you want to use the material, and any agreement should be made in writing.

What are the penalties for copyright infringement?

Penalties for copyright infringement can be severe, including substantial fines and even imprisonment. The exact penalties can vary depending on the nature and extent of the infringement.

Can I copyright my website?

Yes, you can copyright your website. In fact, your website is automatically protected by copyright law as soon as it is published. However, registering your copyright can provide additional legal protection and make it easier to enforce your rights.

Saturday, January 9, 2016

Free SSL For Any WordPress Website

If you have an e-commerce website, then SSL is mandatory for safely processing credit cards. But even if you aren’t processing payments, you should still seriously consider secure HTTP (or HTTPS), especially now that I’m going to show you how to set it up quickly, for free. Let’s get started.

What Is SSL And Why Should I Care?

In short, SSL is the “S” in HTTPS. It adds a layer of encryption to HTTP that ensures that the recipient is actually who they claim to be and that only authorized recipients can decrypt the message to see its contents.
Sensitive information such as credit-card numbers — basically, anything private — should always be served via HTTPS. However, there is an increasing trend towards serving all content via HTTPS, as we’re seeing on news website, blogs, search engines and the websites of most mainstream brands. So, even if your website isn’t processing payments, there are good reasons to consider HTTPS, a few of which are listed here:
  • Credibility
    Even non-technical audiences associate the little green padlock in the browser’s address bar with trust and reliability.
  • Password protection
    Perhaps your website only hosts kitten videos. But if users are logging into your website via Wi-Fi with a password that they also use for online banking, then you are potentially facilitating a serious security breach by broadcasting those credentials publicly.
  • Future-proofing
    Many websites are still served via HTTP, but there is an undeniable trend towards HTTPS, and this will only increase as users become increasingly educated about web security. Be on the right side of history.
  • SEO
    Google officially announced that HTTPS is used as a ranking signal. In other words, Google is rewarding HTTPS websites by boosting their rankings in search results.
A common argument against HTTPS is that it reduces performance. True, the process of encrypting and decrypting does cost additional milliseconds, but in most situations it is negligible, as evidenced by the fact that performance-conscious companies such as Google and Facebook serve all of their content via HTTPS. And, true, HTTPS can exacerbate existing performance problems, like many CSS files being served individually, but this is mitigated by following basic best practices for performance. And with the adoption of HTTP/2, the performance cost of HTTPS is even lower. The bottom line is that the reduction in performance is a meaningful deterrent only if your website is either hyperoptimized or so underperforming that every millisecond matters.

How To Set Up HTTPS For Free

The first step to setting up HTTPS for free is to sign up for a cloud DNS service. If you have no idea what DNS is, I recommend that you take a minute to learn before proceeding. The delightful How DNS Works does a great job of breaking it down into a quippy cartoon. Otherwise, simply know that DNS is the system whereby domain names like example.com (which humans understand) get linked to IP addresses like 104.28.2.167 (which computers understand). You have many options, but I’m a fan of CloudFlare because it’s really fast to set up, the dashboard is intuitive, and a free plan is available with many powerful features.

Setting Up CloudFlare

After registering for a CloudFlare account, you’ll be walked through an easy wizard to configure your first website, which will conclude with instructions on how to log into your domain registrar and point the nameservers to CloudFlare. The change will take some time to propagate, but when it’s complete, CloudFlare will be hosting your website’s DNS records. Next, turn on CloudFlare’s “flexible SSL” feature.
Choosing the “flexible SSL” setting is important because it doesn’t require you to buy and install your own SSL certificate on your website’s server.

As you can see, CloudFlare is acting as the middleman to secure traffic between your website and the client. If this were a static HTML website, you would now be able to connect to it via HTTPS (https://yourdomain.com). WordPress, however, requires additional configuration in order to work with the modified protocol.

Reconfiguring WordPress From HTTP To HTTPS

You will first need to update the “WordPress Address” and “Site Address” settings in the dashboard, under “Settings” → “General.” When you do this, you will have to log into the dashboard again.

Proceed cautiously. If you update these settings prematurely, you risk locking yourself out. For example, if the website isn’t yet properly configured for HTTPS and the settings are updated, you could cause a redirect loop that breaks the website and prevents you from accessing the dashboard.
At this point, you should be able to visit the home page of the website via HTTPS. However, page links will still point to the HTTP URLs. WordPress stores links to pages and images as absoute URLs, meaning that the full URL, including the protocol, is saved in the database. To ensure that the entire website is consistently served via HTTPS (without spitting up warnings about mixed content), you will need to update your legacy content.

Updating Legacy Content

On a small website with only a few pages, the quickest option might be simply to manually update the URLs by editing existing pages in the admin interface. If the website is large or has a highly active blog, then manual editing likely isn’t practical. If your host provides phpMyAdmin or some other interface to run MySQL queries, you could do this pretty easily with a few MySQL queries in the SQL tab. Alternatively, you could follow The Customize Windows’ instructions to do it from the command line.
At the risk of stating the obvious, replace yourdomain.com in the following queries with your actual domain. Also, if you’ve customized WordPress’ table prefix, replace wp_ with the relevant prefix.
First, update the URLs of the posts and pages.

UPDATE wp_posts SET guid = replace(guid, 'http://yourdomain.com','https://yourdomain.com');
[UPDATE: As discussed in the comments, the guid field should not be edited.]
Update the wp_postmeta table, too.
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://yourdomain.com','https://yourdomain.com');
Finally, update the actual contents of posts or pages. This will update any backlinks to HTTPS.
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://yourdomain.com', 'https://yourdomain.com');
After running these queries, you will want to refresh your permalinks by going to “Settings” → “Permalinks.” Simply change the setting back to the default, and then set it back to whatever setting you were originally using.
Now, you should be able to click the menus and links throughout the website, and the protocol should remain HTTPS.

Troubleshooting Mixed-Content Warnings

Depending on the theme and plugins in use, you might get a warning in the address bar stating that certain resources are not being served securely. If the errors are associated with assets added by your own custom theme or plugin, make sure to properly enqueue JavaScript and CSS files and not to hardcode URLs that begin with HTTP. Most browsers will let you expand the warning to show the specific requests that are causing the error. You could also try a free plugin such as SSL Insecure Content Fixer, which will attempt to correct third-party plugins that have failed to do this.
By this point, you should see the green padlock in the URL bar when visiting your website. If you aren’t using an e-commerce plugin such as WooCommerce or WP eCommerce, you’re done! If you are, there is an important last step.

Getting Flexible SSL To Work With E-Commerce Plugins

WordPress has a core function named is_SSL() that plugins rely on to determine whether traffic is encrypted with SSL. With the method above alone, this function will return false because the encryption is only between CloudFlare and the client. The traffic that PHP interacts with is unencrypted, so the super global that that function checks (i.e. $_SERVER['HTTPS']) would not be useful. For our purpose, the relevant variable is $_SERVER['HTTP_X_FORWARDED_PROTO'], which, at the time of writing, WordPress does not recognize. The request to change this is long-standing, but it is yet to be resolved.
Fortunately, a free plugin will fix this for you immediately, CloudFlare Flexible SSL. Simply install the plugin and activate it. Remember that this technique does not add any more security. Traffic between CloudFlare and your website’s server is still unencrypted and, therefore, still vulnerable to sniffing.

Flexible SSL Is Not Full SSL

CloudFlare’s “Universal SSL” initiative is an interesting attempt to make the Internet more secure, but it is not without controversy. The primary concern is that flexible SSL does not encrypt the second half of the traffic’s journey (to your server), yet the browser currently still shows the same green padlock that we have come to associate with complete SSL. CloudFlare offers the following justification on its blog:
Having cutting-edge encryption may not seem important to a small blog, but it is critical to advancing the encrypted-by-default future of the Internet. Every byte, however seemingly mundane, that flows encrypted across the Internet makes it more difficult for those who wish to intercept, throttle, or censor the web. In other words, ensuring your personal blog is available over HTTPS makes it more likely that a human rights organization or social media service or independent journalist will be accessible around the world. Together we can do great things.
For better or worse, flexible SSL is here, and the Internet will have to adapt. In the meantime, the burden is on website owners to be educated and to make responsible decisions.

Redirecting HTTP Requests To HTTPS

Enabling a website to run on HTTPS does not ensure that requests will actually use the protocol. If your website has been around for a while, users might have already bookmarked it with HTTP. You can redirect all HTTP requests to the new protocol by adding the following snippet to the top of the .htaccess file in the root of your website. If the file does not exist, you can safely add it.
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule (.*) https://yourdomain.com/$1 [R=301,L]
</IfModule>
If an .htaccess file already exists, be careful not to change anything between the # BEGIN WordPress and # END WordPress lines in that file. Those lines are managed by WordPress, and whenever the permalinks get refreshed, the contents in that section get overwritten.

Congratulations

By upgrading your website to HTTPS, you have improved your website, protected users and participated in the advancement of the Internet. And it didn’t cost you anything!

Friday, January 8, 2016

Improving UX For Color-Blind Users

According to Colour Blind Awareness 4.5% of the population are color-blind. If your audience is mostly male this increases to 8%. Designing for color-blind people can be easily forgotten because most designers aren’t color-blind. In this article I provide 13 tips to improve the experience for color-blind people – something which can often benefit people with normal vision too.

What Is Color Blindness?

There are many types of color blindness but it comes down to not seeing color clearly, getting colors mixed up, or not being able to differentiate between certain colors.
These problems can also be exacerbated by the environments in which people use websites. This could include low-quality monitors, bad lighting, screen glare, tiny mobile screens and sitting far away from a huge television screen.
Relying solely on color for readability and affordance makes a website difficult to use, which ultimately affects readership and sales.
While the following tips aren’t exhaustive, they do cover the majority of problems color-blind people experience when using websites.

1. Text Readability

To ensure text is readable it should pass accessibility guidelines based on the combination of text color, background color and text size as follows:
“WCAG 2.0 level AA requires a contrast ratio of 4.5:1 for normal text and 3:1 for large text (14 point and bold or larger, or 18 point or larger).”
— WebAim color contrast checker

2. Text Overlaid On Background Images 

Text overlaid on imagery is tricky because some or all of the image may not have sufficient contrast in relation to the text.
Alternatively, you can style the text itself to have a solid color or a drop shadow, or anything else that matches your brand guidelines.

3. Color Filters, Pickers And Swatches

The screenshot below shows the color filter on Amazon as seen by someone with and without protanopia (red–green color blindness). Without descriptive text it is impossible to differentiate between many of the options available.
Amazon shows descriptive text when the user hovers, but hover isn’t available on mobile.
Gap solves this problem by adding a text label beside each color.
This happens to be beneficial for people with normal vision too. For example, black and navy are difficult colors to differentiate on screen. A text label takes the guesswork out of it.

4. Photographs Without Useful Descriptions

The screenshot below shows a SuperDry T-shirt for sale on its website. It is described as “Leaf Jaspe” which is ambiguous as leaves can come in an assortment of colors (green, yellow, brown. etc.).
Jaspe (or rather “jaspé”) means randomly mottled or variegated, so using this in addition to the specific color would be useful: “Gray Green Leaf Jaspe.”
Links should be easy to spot without relying on color. The screenshot below simulates the vision of somebody with achromatopsia (can’t see color) viewing the UK Government Digital Service (GDS) website. Many of the links are hard to see. For example, did you notice that “GDS team, User research” (located under the heading) are links?
To find a link, users are left having to hover with their mouse waiting for the cursor to change to a pointer. On mobile, they are left to tap on text hoping it will make a page request.
The links above with icons are easier to see. For those without, it would be a good idea to add an underline, which is exactly what GDS does within the body of its articles.

6. Color Combinations

In the physical world you can’t always control which colors appear next to one another: a red apple may have dropped and nestled itself into some green grass. However, we can control the colors we use to design our website. The following color combinations should be avoided where possible:
  • green/red
  • green/brown
  • blue/purple
  • green/blue
  • light green/yellow
  • blue/grey
  • green/grey
  • green/black

7. Form Placeholders

Using a placeholder without a label is problematic because placeholder text usually lacks sufficient contrast. Apple has this problem with their registration form. Apple’s registration form uses a placeholder without a label.
Increasing the contrast is not advisable because it will then be hard to tell the difference between placeholder text and user input.
It’s better to use labels – a good practice anyway – with sufficient contrast, which is exactly what Made.com does. Made.com uses labels with good contrast.

8. Primary Buttons

Often, primary buttons use color alone to present themselves as such, and Argos does just this on its login screenThe Argos login screen relies on color to emphasize the primary button.
Instead, consider using size, placement, boldness, contrast, borders, icons and anything else that will help – within the bounds of your brand guidelines. As an example, Kidly uses size, color and iconography)

9. Alert Messaging

Success and error messages are often colored green and red respectively. Most color-blind people don’t suffer from achromatism, and so will naturally associate different colors with different messages. However, using prefix text such as “Success” or, my preference, an icon makes it quick and easy to read.

10. Required Form Fields

Denoting required fields with color is a problem because some people may not be able to see the differences.
Instead, you could consider:
  • Marking required fields with an asterisk.
  • Even better, marking required fields with “required.”
  • Where possible, remove optional fields altogether.

11. Graphs

Color is often used to signify different segments of a graph.
Using patterns and, where possible, placing text within each segment makes graphs easy to understand. When text doesn’t fit – as is often the case with a small pie chart segment – using a key will suffice.

12. Zoom 

One accessibility feature that browsers have, is enabling someone to zoom in as much as they need. This improves readability–which is especially helpful on a mobile device.
Unfortunately, zoom can be disabled using the Viewport Meta Tag, which is problematic. For example, text size may be too small to read in relation to the color contrast—but zooming in effectively increases the font size, making it easier to read. So don’t disable zoom on your website.

13. Relative Font Size Link

Similarly to the previous point, browsers provide the ability to increase text size (instead of zooming the entire page as a whole), in order to improve readability. However, some browsers disable this functionality when the font-size is specified in absolute units such as pixels. Using a relative font size unit, such as ems, ensures that all browsers afford this capability.

Tooling 

There are lots of tools available to help you design for color-blind people:
  1. Check My Colours: if you have an existing website, you can just enter a URL and receive feedback of what needs to be improved.
  2. WebAim’s color contrast checker: provide two colors to see if they pass accessibility guidelines.
  3. I Want To See Like The Color Blind: apply color blindness filters to your web page right within Chrome.
  4. Color Oracle: a color blindness simulator for Windows, Mac and Linux, showing you what people with common color vision impairments will see.

Conclusion

The tips in this article are not exhaustive, and they are not necessarily applicable to every situation. However, they do cover the majority of problems color-blind people experience when using websites.
It’s more important to take away the principles, so that you can integrate them into your own design process. Ultimately, websites aren’t just meant to look good – they are meant to be easy to use for everyone, including people who are color-blind.

Thursday, January 7, 2016

How To Harness The Machines: Being Productive With Task Runners

Task runners are the heroes (or villains, depending on your point of view) that quietly toil behind most web and mobile applications. Task runners provide value through the automation of numerous development tasks such as concatenating files, spinning up development servers and compiling code. In this article, we’ll cover Grunt, Gulp, Webpack and npm scripts. We’ll also provide some examples of each one to get you started. Near the end, I’ll throw out some easy wins and tips for integrating ideas from this post into your application.
There is a sentiment that task runners, and JavaScript advances in general, are over-complicating the front-end landscape. I agree that spending the entire day tweaking build scripts isn’t always the best use of your time, but task runners have some benefits when used properly and in moderation. That’s our goal in this article, to quickly cover the basics of the most popular task runners and to provide solid examples to kickstart your imagination regarding how these tools can fit in your workflow.

A Note on the Command Line

Task runners and build tools are primarily command-line tools. Throughout this article, I’ll assume a decent level of experience and competence in working with the command line. If you understand how to use common commands like cd, ls, cp and mv, then you should be all right as we go through the various examples.Let’s kick things off with the granddaddy of them all: Grunt.

Grunt

Grunt was the first popular JavaScript-based task runner. I’ve been using Grunt in some form since 2012. The basic idea behind Grunt is that you use a special JavaScript file, Gruntfile.js, to configure various plugins to accomplish tasks. It has a vast ecosystem of plugins and is a very mature and stable tool. Grunt has a fantastic web directory that indexes the majority of plugins (about 5,500 currently). The simple genius of Grunt is its combination of JavaScript and the idea of a common configuration file (like a makefile), which has allowed many more developers to contribute to and use Grunt in their projects. It also means that Grunt can be placed under the same version control system as the rest of the project.
Grunt is battle-tested and stable. Around the time of writing, version 1.0.0 was released, which is a huge accomplishment for the Grunt team. Because Grunt largely configures various plugins to work together, it can get tangled (i.e. messy and confusing to modify) pretty quickly. However, with a little care and organization (breaking tasks into logical files!), you can get it to do wonders for any project.
In the rare case that a plugin isn’t available to accomplish the task you need, Grunt provides documentation on how to write your own plugin. All you need to know to create your own plugin is JavaScript and the Grunt API. You’ll almost never have to create your own plugin, so let’s look at how to use Grunt with a pretty popular and useful plugin!

Let’s look at how Grunt actually works. Running grunt in the command line will trigger the Grunt command-line program that looks for Gruntfile.js in the root of the directory. The Gruntfile.js contains the configuration that controls what Grunt will do. In this sense, Gruntfile.js can be seen as a kind of cookbook that the cook (i.e. Grunt, the program) follows; and, like any good cookbook, Gruntfile.js will contain many recipes (i.e. tasks).
We’re going to put Grunt through the paces by using the Grunticon plugin to generate icons for a hypothetical web app. Grunticon takes in a directory of SVGs and spits out several assets:
  • a CSS file with the SVGs base-64-encoded as background images;
  • a CSS file with PNG versions of the SVGs base-64-encoded as background images;
  • a CSS file that references an individual PNG file for each icon.
The three different files represent the various capabilities of browsers and mobile devices. Modern devices will receive the high-resolution SVGs as a single request (i.e. a single CSS file). Browsers that don’t handle SVGs but handle base-64-encoded assets will get the base-64 PNG style sheet. Finally, any browsers that can’t handle those two scenarios will get the “traditional” style sheet that references PNGs. All this from a single directory of SVGs!
The configuration of this task looks like this:
module.exports = function(grunt) {

  grunt.config("grunticon", {
    icons: {
      files: [
        {
          expand: true,
          cwd: 'grunticon/source',
          src: ["*.svg", ".png"],
          dest: 'dist/grunticon'
        }
      ],
      options: [
        {
          colors: {
            "blue": "blue"
          }
        }
      ]
    }
  });

  grunt.loadNpmTasks('grunt-grunticon');
};
Let’s walk through the various steps here:
  1. You must have Grunt installed globally.
  2. Create the Gruntfile.js file in the root of the project. It’s best to also install Grunt as an npm dependency in your package.json file along with Grunticon via npm i grunt grunt-grunticon --save-dev.
  3. Create a directory of SVGs and a destination directory (where the built assets will go).
  4. Place a small script in the head of your HTML, which will determine what icons to load.
Here is what your directory should look like before you run the Grunticon task:
|-- Gruntfile.js
|-- grunticon
|   `-- source
|       `-- logo.svg
`-- package.json

Once those things are installed and created, you can copy the code snippet above into Gruntfile.js. You should then be able to run grunt grunticon from the command line and see your task execute.
The snippet above does a few things:
  • adds a new config object to Grunt on line 32 named grunticon;
  • fills out the various options and parameters for Grunticon in the icons object;
  • finally, pulls in the Grunticon plugin via loadNPMTasks.
Here is what your directory should look like post-Grunticon:
|-- Gruntfile.js
|-- dist
|   `-- grunticon
|       |-- grunticon.loader.js
|       |-- icons.data.png.css
|       |-- icons.data.svg.css
|       |-- icons.fallback.css
|       |-- png
|       |   `-- logo.png
|       `-- preview.html
|-- grunticon
|   `-- source
|       `-- logo.svg
`-- package.json

There you go — finished! In a few lines of configuration and a couple of package installations, we’ve automated the generation of our icon assets! Hopefully, this begins to illustrate the power of task runners: reliability, efficiency and portability.

Gulp: LEGO Blocks For Your Build System

Gulp emerged sometime after Grunt and aspired to be a build tool that wasn’t all configuration but actual code. The idea behind code over configuration is that code is much more expressive and flexible than the modification of endless config files. The hurdle with Gulp is that it requires more technical knowledge than Grunt. You will need to be familiar with the Node.js streaming API and be comfortable writing basic JavaScript.
Gulp’s use of Node.js streams is the main reason it’s faster than Grunt. Using streams means that, instead of using the file system as the “database” for file transformations, Gulp uses in-memory transformations. For more information on streams, check out the Node.js streams API documentation, along with the stream handbook.

As in the Grunt section, we’re going to put Gulp through the paces with a straightforward example: concatenating our JavaScript modules into a single app file.
Running Gulp is the same as running Grunt. The gulp command-line program will look for the cookbook of recipes (i.e. Gulpfile.js) in the directory in which it’s run.
Limiting the number of requests each page makes is considered a web performance best practice (especially on mobile). Yet collaborating with other developers is much easier if functionality is split into multiple files. Enter task runners. We can use Gulp to combine the multiple files of JavaScript for our application so that mobile clients have to load a single file, instead of many.
Gulp has the same massive ecosystem of plugins as Grunt. So, to make this task easy, we’re going to lean on the gulp-concat plugin. Let’s say our project’s structure looks like this:
|-- dist
|   `-- app.js
|-- gulpfile.js
|-- package.json
`-- src
    |-- bar.js
    `-- foo.js
Two JavaScript files are in our src directory, and we want to combine them into one file, app.js, in our dist/ directory. We can use the following Gulp task to accomplish this.
var gulp = require('gulp');
var concat = require('gulp-concat');

gulp.task('default', function() {
  return gulp.src('./src/*.js')
    .pipe(concat('app.js'))
    .pipe(gulp.dest('./dist/'));
});
The important bits are in the gulp.task callback. There, we use the gulp.src API to get all of the files that end with .js in our src directory. The gulp.src API returns a stream of those files, which we can then pass (via the pipe API) to the gulp-concat plugin. The plugin then concatenates all of the files in the stream and passes it on to the gulp.dest function. The gulp-dest function simply writes the input it receives to disk.
You can see how Gulp uses streams to give us “building blocks” or “chains” for our tasks. A typical Gulp workflow looks like this:
  1. Get all files of a certain type.
  2. Pass those files to a plugin (concat!), or do some transformation.
  3. Pass those transformed files to another block (in our case, the dest block, which ends our chain).
As in the Grunt example, simply running gulp from the root of our project directory will trigger the default task defined in the Gulpfile.js file. This task concatenates our files and let’s us get on with developing our app or website.

Webpack

The newest addition to the JavaScript task runner club is Webpack. Webpack bills itself as a “module bundler,” which means it can dynamically build a bundle of JavaScript code from multiple separate files using module patterns such as the CommonJS pattern. Webpack also has plugins, which it calls loaders.
Webpack is still fairly young and has rather dense and confusing documentation. Therefore, I’d recommend Pete Hunt’s Webpack repository as a great starting point before diving into the official documentation. I also wouldn’t recommend Webpack if you are new to task runners or don’t feel proficient in JavaScript. Those issues aside, it’s still a more specific tool than the general broadness of Grunt and Gulp. Many people use Webpack alongside Grunt or Gulp for this very reason, letting Webpack excel at bundling modules and letting Grunt or Gulp handle more generic tasks.
Webpack ultimately lets us write Node.js-style code for the browser, a great win for productivity and making a clean separation of concerns in our code via modules. Let’s use Webpack to achieve the same result as we did with the Gulp example, combining multiple JavaScript files into one app file.
Webpack is often used with Babel to transpile ES6 code to ES5. Transpiling code from ES6 to ES5 lets developers use the emerging ES6 standard while serving up ES5 to browsers or environments that don’t fully support ES6 yet. However, in this example, we’ll focus on building a simple bundle of our two files from the Gulp example. To begin, we need to install Webpack and create a config file, webpack.config.js. Here’s what our file looks like:
module.exports = {
    entry: "./src/foo.js",
    output: {
        filename: "app.js",
        path: "./dist"
    }
};
In this example, we’re pointing Webpack to our src/foo.js file to begin its work of walking our dependency graph. We’ve also updated our foo.js file to look like this:
//foo.js
var bar = require("./bar");

var foo = function() {
  console.log('foo');
  bar();
};

module.exports = foo;
And we’ve updated our bar.js file to look like this:
//bar.js
var bar = function() {
  console.log('bar');
};

module.exports = bar;
This is a very basic CommonJS example. You’ll notice that these files now “export” a function. Essentially, CommonJS and Webpack allow us to begin organizing our code into self-contained modules that can be imported and exported throughout our application. Webpack is smart enough to follow the import and export keywords and to bundle everything into one file, dist/app.js. We no longer need to maintain a concatenation task, and we simply need to adhere to a structure for our code instead. Much better!

Extending

Webpack is akin to Gulp in that “It’s just JavaScript.” It can be extended to do other task runner tasks via its loader system. For instance, you can use css-loader and sass-loader to compile Sass into CSS and even to use the Sass in your JavaScript by overloading the require CommonJS pattern! However, I typically advocate for using Webpack solely to build JavaScript modules and for using another more general-purpose approach for task running (for example, Webpack and npm scripts or Webpack and Gulp to handle everything else).

npm Scripts

npm scripts are the latest hipster craze, and for good reason. As we’ve seen with all of these tools, the number of dependencies they might introduce to a project could eventually spin out of control. The first post I saw advocating for npm scripts as the entry point for a build process was by James Halliday. His post perfectly sums up the ignored power of npm scripts (emphasis mine):
There are some fancy tools for doing build automation on JavaScript projects that I’ve never felt the appeal of because the lesser-known npm run command has been perfectly adequate for everything I’ve needed to do while maintaining a very tiny configuration footprint.
Did you catch that last bit at the end? The primary appeal of npm scripts is that they have a “very tiny configuration footprint.” This is one of the main reasons why npm scripts have started to catch on (almost four years later, sadly). With Grunt, Gulp and even Webpack, one eventually begins to drown in plugins that wrap binaries and double the number of dependencies in a project.
Keith Cirkel has the go-to tutorial on using npm to replace Grunt or Gulp. He provides the blueprint for how to fully leverage the power of npm scripts, and he’s introduced an essential plugin, Parallel Shell (and a host of others just like it).

An Example

In our section about Grunt, we took the popular module Grunticon and created SVG icons (with PNG fallbacks) in a Grunt task. This used to be the one pain point with npm scripts for me. For a while, I would keep Grunt installed for projects just to use Grunticon. I would literally “shell out” to Grunt in my npm task to achieve task-runner inception (or, as we started calling it at work, a build-tool turducken). Thankfully, The Filament Group, the fantastic group behind Grunticon, released a standalone (i.e. Grunt-free) version of their tool, Grunticon-Lib. So, let’s use it to create some icons with npm scripts!
This example is a little more advanced than a typical npm script task. A typical npm script task is a call to a command-line tool, with the appropriate flags or config file. Here’s a more typical task that compiles our Sass to CSS:
"sass": "node-sass src/scss/ -o dist/css",
See how it’s just one line with various options? No task file needed, no build tool to spin up — just npm run sass from the command line, and you’re Sass is now CSS. One really nice feature of npm scripts is how you can chain script tasks together. For instance, say we want to run some task before our Sass task runs. We would create a new script entry like this:
"presass": "echo 'before sass',
That’s right: npm understands the pre- prefix. It also understands the post- prefix. Any script entry with the same name as another script entry with a pre- or post- prefix will run before or after that entry.
Converting our icons will require an actual Node.js file. It’s not too serious, though. Just create a tasks directory, and create a new file named grunticon.js or icons.js or whatever makes sense to those working on the project. Once the file is created, we can write some JavaScript to fire off our Grunticon process.
Note: All of these examples use ES6, so we’re going to use babel-node to run our task. You can easily use ES5 and Node.js, if that’s more comfortable.
import icons from "grunticon-lib";
import globby from "globby";

let files = globby.sync('src/icons/*');
let options = {
  colors: {
    "blue": "blue"
  }
};

let icon = new icons(files, 'dist/icons', options);

icon.process();
Let’s get into the code and figure out what’s going on.
  1. We import (i.e. require) two libraries, grunticon-lib and globby. Globby is one of my favorite tools, and it makes working with files and globs so easy. Globby enhances Node.js Glob (select all JavaScript files via ./*.js) with Promise support. In this case, we’re using it to get all files in the src/icons directory.
  2. Once we do that, we set a few options in an options object and then call Grunticon-Lib with three arguments:
    • the icon files,
    • the destination,
    • the options.
    The library takes over and chews away on those icons and eventually creates the SVGs and PNG versions in the directory we want.
  3. We’re almost done. Remember that this is in a separate file, and we need to add a “hook” to call this file from our npm script, like this: "icons": "babel-node tasks/icons.js".
  4. Now we can run npm run icons, and our icons will get created every time.
npm scripts offer a similar level of power and flexibility as other task runners, without the plugin debt.

Breakdown Of Task Runners Covered Here

Tool Pros
Grunt No real programming knowledge needed
Gulp Configure tasks with actual JavaScript and streams
   
Webpack Best in class at module-bundling
npm scripts Direct interaction with command-line tools.

Some Easy Wins

All of these examples and task runners might seem overwhelming, so let’s break it down. First, I hope you don’t take away from this article that whatever task runner or build system you are currently using needs to be instantly replaced with one mentioned here. Replacing important systems like this shouldn’t be done without much consideration. Here’s my advice for upgrading an existing system: Do it incrementally.

Wrapper Scripts!

One incremental approach is to look at writing a few “wrapper” npm scripts around your existing task runners to provide a common vocabulary for build steps that is outside of the actual task runner used. A wrapper script could be as simple as this:
{
  "scripts": {
    "start": "gulp"
  }
}
Many projects utilize the start and test npm script blocks to help new developers get acclimatized quickly. A wrapper script does introduce another layer of abstraction to your task runner build chain, yet I think it’s worth being able to standardize around the npm primitives (e.g. test). The npm commands have better longevitiy than an individual tool.

Sprinkle in a Little Webpack 

If you or your team are feeling the pain of maintaining a brittle “bundle order” for your JavaScript, or you’re looking to upgrade to ES6, consider this an opportunity to introduce Webpack to your existing task-running system. Webpack is great in that you can use as much or as little of it as you want and yet still derive value from it. Start just by having it bundle your application code, and then add babel-loader to the mix. Webpack has such a depth of features that it’ll be able to accommodate just about any additions or new features for quite some time.

Easily Use PostCSS With npm Scripts 

PostCSS is a great collection of plugins that transform and enhance CSS once it’s written and preprocessed. In other words, it’s a post-processor. It’s easy enough to leverage PostCSS using npm scripts. Say we have a Sass script like in our previous example:
"sass": "node-sass src/scss/ -o dist/css",
We can use npm script’s lifecycle keywords to add a script to run automatically after the Sass task:
"postsass": "postcss --use autoprefixer -c postcss.config.json dist/css/*.css -d dist/css",
This script will run every time the Sass script is run. The postcss-cli package is great, because you can specify configuration in a separate file. Notice that in this example, we add another script entry to accomplish a new task; this is a common pattern when using npm scripts. You can create a workflow that accomplishes all of the various tasks your app needs.

Conclusion 

Task runners can solve real problems. I’ve used task runners to compile different builds of a JavaScript application, depending on whether the target was production or local development. I’ve also used task runners to compile Handlebars templates, to deploy a website to production and to automatically add vendor prefixes that are missed in my Sass. These are not trivial tasks, but once they are wrapped up in a task runner, they became effortless.
Task runners are constantly evolving and changing. I’ve tried to cover the most used ones in the current zeitgeist. However, there are others that I haven’t even mentioned, such as Broccoli, Brunch and Harp. Remember that these are just tools: Use them only if they solve a particular problem, not because everyone else is using them. Happy task running!

Wednesday, January 6, 2016

How to Install Octopress

In this tutorial I’m going to show you how I’ve installed Octopress. Installing Octopress was a fun experience especially for those without prior knowledge of Ruby tools such as gems, rake and stuff.
As you might probably know Octopress is a blogging framework for hackers and the customizability(I don’t know if that word exists) is pretty flexible you can almost do anything that you want.
The documentation for Octopress is actually pretty readable and easy to follow. You can actually go ahead and read it up and see if you can follow. Just come back here if you think you cannot and I’ll make things easier for you. I promise.

Tools you’re going to need

Download and install the first 2 tools(Ruby and Ruby Gems). It’s not that difficult. The third one(Ruby Dev Kit) is a little bit harder in my opinion so I’m going to show it to you.

Installing the Ruby Dev Kit

Extract the zip file anywhere then open up a new terminal inside the root directory where its contents has been extracted.
Execute this command:
ruby dk.rb init
Edit the config.yml file that it has generated. On the last line specify the directory where Ruby is installed:
- D:/web_files/github/yari/ruby-1.9.3-p194-i386-mingw32
Execute the following command(still inside the ruby dev kit folder):
ruby dk.rb install
Once that’s done you can actually go ahead and follow the Octopress Setup Guide.
The Octopress docs will pretty much guide you what to do next so it’s actually pretty easy and straightforward.
Just go through the following guides in order. The following steps assumes that you have already installed Git on your computer. If you haven’t done it yet just follow this guide from Github on setting up Git. If you’re on Windows its actually a lot more easier because all you have to do is to download the Github installer for Windows and install it just like how you install most of the programs on Windows(click next until you hit finish).
If you’re having trouble you can seek help at Stackoverflow(don’t forget to use the octopress tag), Twitter(they’re pretty fast at responding) or Octopress Github Page and post an issue.
Good luck