Tuesday, February 9, 2016

Aspects to Consider Before Starting an Online Marketplace


Presents, souvenirs, desired things and basic necessities make us visit various stores and shopping malls, as we want to satisfy our needs and do something nice for our relatives and friends. In this age of information and communication technologies, most people can't go shopping without assistance of modern technological devices, such as tablets, smartphones and desktops. As for the last several years, a number of online customers has increased drastically, plenty of businessmen also try to launch online stores and establish branch offices of their companies in Internet. Being an online business owner, you will be able to earn much more money, get high popularity and even interact with thousands of buyers from all over the world. However, if you want to reach these goals and become a successful online businessman, so you will have to be ready to compete against a large number of different web business companies and corporations. As a rule, not all online vendors and entrepreneurs are able to create strong business brands and participate in competitive races within the ecommerce marketplace during a long period of time. Knowing these facts, some web businessmen combine their financial assets and efforts with other merchants to create online multiple marketplaces. Such web business projects have already helped plenty of online businessmen not only get desired revenues and stand in cruel conditions of high competition, but also start their business careers and get valuable knowledge in marketing and management fields.

by Guest Author via Digital Information World

Quick Tip: Synch a GitHub Fork via the Command Line

When you fork someone’s repository on GitHub, you’ll want to update your fork with any changes made to the original. There are various ways to do this. In this quick tip, Shaumik describes how to update your fork via the command line. Another option is to update your fork via the GitHub web interface.

Git is a distributed version control system, which means that each copy of a repository is complete with its own history. GitHub, on the other hand, is an online collection of Git repositories. GitHub introduces the concept of forking, which involves making a copy of the main repository.

GitHub Workflow

GitHub workflow

To understand the concept of updating a fork, one must first know why this is necessary.

An organization can’t grant every potential contributor write access to its main repository, so the public can only view the central repository. A fork is a copy of this repository that a user can create. Users have read and write access to their own forks.

Normally, programming happens on a local machine (or a VM) instead of the GitHub interface directly, so a clone of the fork will normally be created.

Once a contributor has made a commit to a local copy, it then needs to be pushed to the fork on GitHub (which is possible due to the write access). Then, a pull request is created from the fork to the central repository.

Keeping Your Fork Up to Date

When the central repository is updated with someone else’s code (after the fork was created), these new commits do not magically appear on the fork. One must first download and merge these changes with the local repository, and then push it to the fork.

For legacy reasons, in our local repository, we name the central repository remote as upstream and the fork as origin.

Ideally, you should never make any commits directly to the master branch of your fork or the local repository. This branch must only be used for keeping the updated code from upstream. All changes must be made to new feature or bug branches, and pushed to the branches with the same name on the fork.

Hence, the following steps help in updating the fork with the latest commits from the central repository:

  • Pull from upstream’s master branch to local repository’s master
  • Push from local repository’s master to fork’s master

These steps assume that you have forked the repository and cloned the fork on your local machine.

For demonstration, we’ll be using the repository of e-Cidadania on GitHub.

Continue reading %Quick Tip: Synch a GitHub Fork via the Command Line%


by Shaumik Daityari via SitePoint

Simple Select – Custom Select with CSS and jQuery

With Simple Select you can create custom styled select elements by using css and jQuery.


by via jQuery-Plugins.net RSS Feed

How to Fire Someone Without Getting Sued or Hurting Morale

Man getting fired

Almost every manager says firing people sucks. Not only is it painful to tell someone he or she has lost the job, but it also means you have to go through the time-consuming and expensive process of interviewing, selecting, and onboarding a replacement.

But here’s the thing: For your startup to succeed, you may need to adopt a policy of “firing fast.”

[author_more]

You’ve probably heard of (and even implemented) the “fail fast” concept. It goes along with the hugely popular Lean methodology, which emphasizes constant iteration, cost reduction, and a singular focus on meeting customer needs.

“Firing fast” is a complementary idea. Basically, it says that to keep your team efficient and unified, you have to remove sub-par performers as quickly as possible.

Why “Firing Fast” Benefits Everyone

Of course, getting rid of a product feature is completely different than getting rid of a person. This decision will reverberate throughout your employee’s life financially, socially, and personally.

However, here’s why in the long reason everyone is better off:

  • The person isn’t stuck in a job that’s not right for him or her
  • Your other employees have an easier time fulfilling their responsibilities
  • Team morale doesn’t take a hit from having a “C player” on board
  • Your customers don’t suffer (either indirectly or directly) from this person’s performance
  • The company’s overall health improves

In a recent Startup episode, co-founder Matt Lieber told one of Gimlet’s investors that they haven’t fired anyone–and the investor found that worrisome. That’s because it means there are probably some poor performers within the company who are slipping through the cracks.

When to Fire Someone

So, how do you know when it’s time to fire people?

  1. They behave immorally or illegally: This one’s pretty obvious. If an employee does anything that violates your company’s major policies, the law, or basic ethics, you should fire them immediately.
  2. They’re putting deliverable deadlines at risk: In this category, you have employees that are potentially causing your team to miss due dates because they’re submitting late or poor-quality work.
  3. They’ve got a bad attitude: Even star performers aren’t immune to this problem. Having someone who frequently complains, encourages insubordination, or causes conflict will threaten your work environment.
  4. They’re harming customer or supplier relationships: If you’re getting lots of complaints from outside parties about an employee, that’s definitely a cause for termination.
  5. They’re not reliable: You should always be able to trust your employees–obviously, to tell the truth, but also to finish what they’ve committed to and be where they’ve promised to be.
  6. They’re not capable of doing the job: This one’s a little more difficult. You may have the most well-meaning, dedicated person on the planet, but if they can’t do the job (and training isn’t a viable solution), then you can’t justify their continued employment.

What about people who are “just okay”? At Netflix, managers use a simple test to determine whether or not to fire someone. They ask themselves, “If this person was leaving to go work at a competitor, would I fight to keep them?”

That’s a pretty high bar. Yet all you have to do is look at Netflix’s share prices to see how well it has served the company.

Finally, don’t confuse “firing” people with “laying them off.” Lay-offs are about as impersonal as removing someone from your company gets; they occur because the organization doesn’t have enough money, work, or need for a person.

Legal Info

Rationale

Every state (with the exception of Montana) lets employers use an “at will” employment policy. You can legally fire someone at any time. You don’t have to have a “good reason” (or any reason at all), but of course, there are a couple of illegal reasons:

  • Discrimination: This includes age, race, gender, religion, or disability.
  • Legal rights: Employees can’t be fired for going on family or medical leave, doing jury time, going to vote, or taking military leave.
  • Whistle-blowing: Reporting wrong-doing to the authorities.

An employee is not “at-will” if there’s a clause in his or her contract that says, “Employee will only be fired for (X reasons)” or “Employee will only be terminated with just cause.” If you’re considering firing an employee who’s under contract, take a look at the seven tests of just cause to ensure you’re acting within the law.

Continue reading %How to Fire Someone Without Getting Sued or Hurting Morale%


by Aja Frost via SitePoint

Lazy Loading Images with the Igaro App JavaScript Framework

A while back I wrote about the Igaro App JS Framework (disclaimer: I'm the framework author).

"Sigh! Not another framework" I hear you say (and probably rightly so). Well, let me tell you what sets Igaro app apart.

Igaro App is NOT yet another framework that plugs into your HTML. It's a completely different approach that offers potentially the highest performance of any web-app framework out there. It's based on the latest standardized technologies such as promises (and zero callbacks), as well as an event driven architecture. There's superb error management and recovery, a lazy loading architecture using CommonJS style modules, many widgets to get you started, and zero dependencies (no jQuery).

In this article I'll be demonstrating how to build an unveil widget (lazy loading images when they come into view) for Igaro App and will highlight many of the concepts that make the framework shine along the way.

Setting Up the Environment

[author_more]

The first thing to do is to grab a copy of the framework from its GitHub repo.

mkdir igaro
git clone http://ift.tt/1OkLoDD igaro/git

Then install a couple of dependencies:

npm install -g grunt-cli
gem install compass
cd igaro/git
npm install

Grunt's command line interface (grunt-cli) is an npm package, which means you'll need Node.js and npm installed on your machine. Compass is a Ruby gem, which means you'll need to install Ruby as well. The installation procedure will vary depending on the operating system. The best thing to do is follow the instructions on the respective projects' home page (Node, Ruby).

With that done, you can kick things off with a simple:

grunt

Once cloned and running, the user has a development environment ready to go. Igaro compiles into two modes — debug and deploy and a web server for each can be found on ports 3006 and 3007 respectively. These will reload automatically as you work.

Screen shot of a standard Igaro App install

Outlining the Widget Specifications

In the course of building the widget, I'll be covering Igaro's bless, a means of pre-configuring objects, and will explain how it allows objects to tidy up after themselves. For an SPA this is important to thwart memory leaks and security issues, i.e if an authenticated page (Igaro App refers to these as routes) contains several widgets of the type we're about to create, and credentials are invalidated (i.e the user has logged out) then it's not just the DOM elements which must be removed, but events and dependencies must also be released.

Most frameworks expect you to reload the app "refresh the page" to clear historical objects (even if the DOM side of things are removed or hidden) or to handle the process of clearing variables manually. One feature of Igaro's "bless" is two way communication between objects, so in this case when the route is destroyed, the widget goes with it. Similarly, if we destroy the widget, the route is notified and it's removed from a siblings array pool.

As a disclaimer, I prefer code which flows and reads like a book in a fashion that is self documenting to anyone that has experience in the language type. For that reason you will find all the following code is undocumented, condensed, and yet surprisingly readable, in no small thanks to the use of ES6 Promises. You should have a good level of JavaScript fundamentals or be prepared to learn.

Without further ado, here's the specification for our widget:

  1. The container should be an empty <div>.
  2. On window scroll or resize, detect whether vertical position is within viewport and if so add a loading CSS class.
  3. Fetch any resource and if an image switch <div> to <img> and write data out.
  4. Support a callback function after the Ajax call*. This could inject other DOM elements or handle custom data.
  5. On error, add error CSS class, remove loading class.

*The Ajax call may require headers for authentication or CORS support. A mechanism to allow for customizing the request must be implemented.

Now we know how the widget should behave, let's start to code.

Creating the Necessary Files

Let's examine the four main files necessary for our widget.

instance.unveil.js

Create a file named instance.unveil.js in compile/cdn/js/ and enter the code below:

module.requires = [
  { name:'instance.unveil.css' }
];

module.exports = function(app) {
  "use strict";
  var InstanceUnveil = function(o) {}
  return InstanceUnveil;
};

When the widget is instantiated an object literal o is passed. This is used to bless the object (more on this later).

instance.unveil.scss

Next, create a file named instance.unveil.scss in sass/scss and enter the code below.

.instance-unveil {
  display:inline-block
}

.instance-unveil-loading {
  background: inline-image("instance.unveil/loading.gif") no-repeat 50% 50%;
  background-size: 3em;
}

.instance-unveil-error {
  background: inline-image("instance.unveil/error.svg") no-repeat 50% 50%;
  background-size: 3em;
}

Find a suitable loading gif and a suitable error image on the web. Put these into a folder named sass/images/instance.unveil and ensure the name and extension match those in the file you just created.

route.main.unveiltest.scss

A test page (route) containing multiple instantiations of our widget will be accessible through http://localhost:3006/unveiltest.

Create a file named route.main.unveiltest.scss in sass/scss and enter the code below.

@import "../sass-global/mixins.scss";

body >.core-router >.main >.unveiltest >.wrapper {
  @include layoutStandard;
}

route.main.unveiltest.js

Create a file named route.main.unveiltest.js in compile/cdn/js and enter the code below.

//# sourceURL=route.main.unveiltest.js

module.requires = [
  { name: 'route.main.unveiltest.css' },
];

module.exports = function(app) {
  "use strict";
  return function(route) {

    var wrapper = route.wrapper,
    objectMgr = route.managers.object;

    return route.addSequence({
      container:wrapper,
      promises:Array.apply(0,new Array(50)).map(function(a,i) {
        return objectMgr.create(
          'unveil',
          {
            xhrConf : {
              res:'http://ift.tt/1PAsEiA'+i+'.jpeg'
            },
            loadImg : true,
            width:'420px',
            height:'240px'
          }
        );
      })
    });
  };
};

In Igaro App, when a page is requested, the router (core.router) asks a provider for a source, instantiates a new route and passes it to the source for customization. In the route file you just created, fifty unveil widgets are created and passed to a sequencer. The sequencer ensures that as the returned promises resolve, the images are placed on the page in the original order.

The create method is provided by a manager. It lazy loads the module and creates an instantiation (pre-load a module by adding it to the requires list at the top of the file). At this point, the widget is also dependency linked to the route so that when the route is destroyed, clean up operations are run.

Continue reading %Lazy Loading Images with the Igaro App JavaScript Framework%


by Andrew Charnley via SitePoint

An Introduction to PostCSS

Most developers who spend their time working with CSS are familiar with preprocessors such Less, Sass, and Stylus. These tools have become a vital part of the web development ecosystem. Writing styles for a website without using features like nesting, variables, or mixins now seems cumbersome and awkward. Although each of them is a great and extremely useful product, let's take a step back and consider if using preprocessors in such a way is indeed the best approach.

I see a couple of problems with tradition preprocessors:

  • They are not extendable. Whichever preprocessor you choose, you are limited to the set of features that it provides. If you need anything on top of that, you’ll need to add it as a separate step in your build process. If you feel like writing your own extension, you’re on your own.
  • You can’t leave anything out. Some of the features preprocessors provide such as Sass’s @extend may be detrimental to you, and you might want to leave them out completely. Unfortunately, while you can avoid using them, you can’t remove that part of the tool to minimize code.
  • They push out CSS standards. You might say that each of the preprocessors has become a standard of its own. Regrettably, they don’t aim at being compatible with the W3C standards, which means that they cannot be used as polyfills for early testing of the newer W3C standards.

This is where PostCSS comes in.

[author_more]

What is PostCSS?

PostCSS is not a preprocessor per se; it doesn’t transform CSS. As a matter of fact, it doesn’t do much by itself at all. What it does is provide a CSS parser and a framework for creating plugins that can analyse, lint, handle assets, optimise, create fallbacks, and otherwise transform parsed CSS. PostCSS parses CSS into an abstract syntax tree (AST), passes it through a series of plugins, and then concatenates back into a string. If you’re familiar with JavaScript tooling, then you can think of PostCSS as Babel for CSS.

There are currently more than 200 plugins for PostCSS, many of which are listed on the PostCSS GitHub page, while others can be found on the useful PostCSS directory postcss.parts. PostCSS can be integrated in most the build tools including Gulp, Grunt, webpack or npm.

So how does PostCSS tackle the problems we listed earlier?

  • Each plugin is installed separately. This means you choose which ones you need and in what order they should be applied. Usually, plugins can be additionally configured using some set of options.
  • You can write your own plugins. Each PostCSS plugin receives parsed CSS as an input parameter, analyses or modifies it, and returns it in the same manner. This means that plugins don’t need to handle parsing CSS and converting it back into a string. So the ability to build your own plugins is not as difficult as you might think.
  • PostCSS can be used to polyfill real W3C features. There are a lot of plugins that aim to implement features from new W3C specifications. This will enable you to write code that respects standards and is likely to be compatible with future versions of CSS.

Using PostCSS

Theory is great, but let's move on to some juicy practice. Let’s install PostCSS and see what it can actually do. We won’t go into much detail about setting up proper project builds, since that’s a topic that deserves an article of its own. Instead we’ll run PostCSS directly from the command line. You can find more info on using PostCSS with your favourite build tool on its Github page.

Installing PostCSS

PostCSS is installed via node and npm, so make sure you have those installed before you start. To install PostCSS globally on your system run:

[code language="bash"]
npm install -g postcss-cli
[/code]

You can make sure it’s working by running:

[code language="bash"]
postcss --help
[/code]

This will give you a list of parameters that the CLI accepts. You can also find these in the postcss-cli documenation.

Running PostCSS

Now that we have PostCSS installed, let’s give it something to work with. Create a styles.css file in your project folder and add some CSS. For example, define a flexbox container:

Continue reading %An Introduction to PostCSS%


by Pavels Jelisejevs via SitePoint

Are WordPress Themes Killing Web Design?

Every so often, somebody writes a post claiming something is dead. Email is dead. SEO is dead. Facebook is dead. Web Design has not been spared, and we’ve seen bold claims of the imminent death of web design on Mashable. They claim that ready-made themes are killing the industry:

"Most of the content that you see on the web today is run by some framework or service — WordPress, Blogger, Drupal, you name it. Frameworks provide you a foundation and shortcuts so you spend less time struggling with the creation of a web site, and more time creating content. As a consequence of the ubiquity of these frameworks, a whole world of free and paid templates lets you get started with a professional-looking design in minutes."

They feel threatened by the sheer number of themes available. Since it is “easy” to setup a website and a ready-made theme - anybody can do it.

I beg to differ.

wordpress-logo-simplified-rgb

If you’re threatened by platforms like WordPress and ready-made themes, I hate to break it to you - but you’re doing web design wrong. You’re missing a fundamental piece of providing any service. You’re not providing enough value to the client.

Continue reading %Are WordPress Themes Killing Web Design?%


by David Attard via SitePoint