Monday, February 16, 2015

Top tips for Ruby on Rails beginners

Ruby forms the foundation of many top websites. If you fancy learning more about the language, here's some tips to get you started.         




You've probably heard the name – Ruby on Rails. But what is it, why is it so poplar and how do you start learning about it? Ruby, like JavaScript, is a general purpose programming language that's best known for is use in web programming. It was created around twenty years ago by Yukihiro "Matz" Matsumoto.

Along the way, you've probably heard the term Rails too – Ruby on Rails. Rails, in this context, is an extension – or a software library – that's designed to expand the Ruby Programming language. The Rails framework is for building websites.

Under the hood, Rails combines CSS, HTML and JavaScript. It's let you create web applications that live on web servers. As such, it's generally considered a 'back-end' or 'server side' platform. If you fancy learning more about Ruby, our guest experts - Rik Lomas and Ben Scofield - give three piece of priceless advice...  

01. Choosing a language  


Why should I choose to learn Ruby over the other languages out there?  

Rik Lomas: "I went through several languages before settling on Ruby. I like it because its syntax is simple and readable, and you can do a lot more with less code – I don’t want to be writing five lines of code when I can write one. The Ruby community is very open with lots of gems (Rubylibraries and plugins), and it’s friendly to coding beginners."

 02. Define your terms  


What is Rails and what's special about it?  

Rik Lomas: "Rails is a library that is built on top of Ruby to make building complex web applications easier. It was created by David Heinemeier Hansson from Basecomp when he was building the company's web app.  If you want to create your own social network, shop or any kind of site where users can sign up, look into Rails. It's bit of a steep learning curve to begin with, but once you start seeing the same patterns repeat, it gets easier and easier."

03. On the right track  


What’s the best way to start learning Ruby on Rails? 

 Rik Lomas: "There are some great guides online to help you. For learning Ruby itself, there's a funny-but-weird guide called Why’s (Poignant) Guide to Ruby. The official Rails guides are well written compared to most technical documentation, too.  The best way, of course, is to have a project and get stuck in. It can be tough but keep checking Stack Overflow and RailsCasts for help, and stay determined."  

04. Different operating systems  


How do we set up for Windows? 

The majority of tutorials seem to be Mac focused.  Ben Scofield: "Honestly, this is hard. If you're already comfortable with virtualization, I would strongly recommend using VirtualBox and Vagrant to run a Linux virtual machine on your PC. That's a significant commitment, though, so if you want to get started with something simpler your best bet is to look at RailsInstaller or RailsFTW. Neither will give you the latest and greatest versions of Ruby and Rails, but they should be enough to get you started."

05. Find inspiration 


What’s the best way to get started?  

Ben Scofield: "From what I've heard over the past few years, Michael Hartl's Ruby on Rails Tutorial is the gold standard for getting started learning Ruby and Rails on your own. The current version of the tutorial covers Rails 4.0, but the previous edition (which covers Rails 3.2) may be helpful as well. Beyond that, your best bet is to look for topic-specific content -- as you need to learn more about, for instance, sending email, you can check the Rails Guides, RailsCasts, or more recent blog posts."

06. Working with scaffolding tools  


What's your advice for developing and deploying Rails apps where front end build is done by one of Gulp/Grunt/Yeoman?  

Ben Scofield: "My personal preference is to separate the two pieces as much as possible; over the past year or so, I've seen a lot of promise in building a Rails application to provide an API, and building a pure JavaScript front-end to consume that API. In that sort of setup, you wouldn't need the front-end build tools on the Rails app, and you're free to build the front end in whatever style you favor."

Friday, February 13, 2015

Strategies for a small business online presence,

How many times have you searched for a small business or organization and found that they do not have a website? Or if they do have an online presence, it exists in very limited form, with little information about them or what they provide. Finding simple information such as hours of operation for a brick-and-mortar shop, location information, or even a phone number can be like pulling teeth. But, it doesn't have to be that way, right?

Small businesses arrive in as many shapes, sizes, flavors, and purposes as their title, and while their main objective is to provide a product or service, their approaches to an online presence are probably as varied as their business names and individual objectives. So how does one develop a strategy for an online presence for new and existing small businesses?

A one-size-fits-all approach is not likely to succeed; there will always be a certain strategy that works well for some but not for others. Strategies can be tailored to fit a business to business (B2B) approach, a single or small restaurant chain, or a mom-and-pop retail store. Other differentiators will be founded on legal status, company size, location, and whether the business exists as a physical storefront or only online.

This two part piece will distill several strategies that might be considered for these three types of small businesses:

•B2B
•Local restaurant
•Small retailer

Each type can have overlapping strategies, and some will include specific strategies suited to their type of business. The second part wraps up with a list of resources for further study on the subjects of small business online strategies.




Business To Business (B2B)


One of the hurdles of establishing a B2B business model is gaining the trust of other businesses to work with you, especially since much of the commerce is conducted by interstate and foreign transactions; therefore, it's hard to authenticate the validity of an organization without some form of online presence.

At a bare minimum, you would want to include your physical office location, including directions along major routes and local landmarks to let your visitors know where you are on the map. Then you need to have some contact information such as your main business phone number and fax number(s), and email addresses for the main points of communication into your company.

Next, you would want to include intermediate content that helps to describe your business. A separate web page document, tab, or section should offer more details about the services and products you offer. Another section could contain a history and background of your company and list any awards or major projects that you want to highlight. Also, provide links to mentions in the press, customer testimonials, or other information that helps to promote the business.

Local restaurant


It still amazes me how many local restaurants do not have an online presence, not even a simple Facebook page, and perchance only a listing in the online yellow pages or local Yelp, or Urbanspoon. While limiting your online presence to these listings and reviews that others post about your restaurant might be all you need to keep your business running, it helps if you have control over your own online presence too.

For the absolute basics, you will want to include the same content set as the B2B business, including the restaurant location, directions, main phone number, fax number, and email contact. In addition, you will want to include your hours of operation for each meal time, including separate dining and lounge service periods if applicable.

Your next step would be to include an online version of your complete menu including food and beverages and any special menus such as brunch, buffets, or holiday and event menus.

Small retailer


Most retailers exist as brick and mortar locations, and some exist as virtual only ventures, and being able to compete against them can be a huge battle for the traditional retailer business model especially if there is no online presence. The physical mall is being eroded more as virtual online establishments continue to add eCommerce to their portfolio of tools that attract more customers away from shopping centers and strip malls.

At a bare minimum you need to have all the similar strategies as the other business models described here, a store location with directions, hours of operation, phone and fax numbers, and a contact email address.

Wednesday, February 11, 2015

Best Tool to Audit and Optimize Your CSS Codes


       Once your website starts to grow, so will your code. As your code expands, CSS may suddenly become hard to maintain, and you may end up overwriting one CSS rule with another. This complicates things and you will probably end up with plenty of bugs. If this is happening to you, it’s time for you to audit your site’s CSS. Auditing your CSS will allow you to identify portions of your CSS that is not optimized. You can also reduce the style sheet file size by eliminating lines of code that is slowing down your site’s performance.

Here are 5 good tools to help you audit and optimize CSS.

1. Type-O-Matic

Type-o-matic is a Firebug plugin to analyze fonts that are being used in a website. This plugin gives a visual report in a table, bearing font properties such as the font family, the size, weight, color, and also the number of times the font is used in the web page. Through the report table, you can easily optimize the font use, remove what is unnecessary, or combine styles that are way too similar.

2. CSS Lint 

CSS Lint is a linting tool that analyzes the CSS syntax based on specific parameters that address for performance, accessibility, and compatibility of your CSS. You would be surprised with the results, expect a lot of warnings in your CSS. However, these errors will eventually help you fix the CSS syntax, and make it more efficient. Additionally, you will also be a better CSS writer.

3. CSS ColorGuard 

CSS ColorGuard is a relatively new tool. It’s built as a Node module and it runs across all platforms: Windows, OS X, and Linux. CSS Color Guard is a command line tool that will notify you if you are using similar colors in your style sheet; e.g. #f3f3f3 is pretty close to #f4f4f4, so you might want to consider merging the two. CSS ColorGuard is configurable, you can set the similarity threshold as well as set the colors you want the tool to ignore.

4. CSS Dig 

CSS Dig is a Python script and works locally on your computer. CSS Dig will run a thorough examination in your CSS. It will read and combine properties e.g. all background color declarations will go underneath the background section. That way you can easily make decisions based on the report when trying to standardize your CSS syntax e.g. you may find color across styles with the following color declaration. 

These color declarations do the same thing. You might as well go with the #ccc or with the capital #CCC as the standard. CSS Dig can expose this redundancy for other CSS properties too, and you will be able to make your code be more consistent.

5. Dust-Me 

Dust-Me is an add-on for Firefox and Opera that will show unused selectors in your stylesheet. It will grab all the styles heets and selectors that are found in your website and find which selectors you are actually using in the web page. This will be shown in a report, you can then press the Clean button and it will clean up those unused selectors and save it to a new CSS file. You can download this tools from Firefox Addons page or the developer’s site, and if you are Opera fans you can get it from the Opera Extensions Gallery page.