Thursday, November 17, 2016

Projects Can Sometimes Be the Worst Way to Learn JavaScript

Projects Can Sometimes Be the Worst Way to Learn JavaScript

This article was peer reviewed by Tim Severien and Chris Perry. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be!

One of the most surprisingly dangerous pieces of advice to JavaScript learners is to "just do projects."

To be 100% clear, projects are often a great way to learn any coding language. However, problems arise when people attempt certain projects before they know enough of the basics to judge what's reasonable.

This topic is important, because attempting a project too early is one of the most common reasons people give up on JavaScript entirely.

I'm not about to let that happen to you, so here's what we'll cover:

  • the most common traps JavaScript learners fall into when attempting projects, and why
  • specific examples of projects that frequently stop people from learning JavaScript
  • how to avoid the common traps and learn more effectively
  • when and how to start doing projects
  • how to know which concepts to use once you start doing projects

The aim of this article is to give you confidence in moving forward, whether you're learning JavaScript or any other language.

The Common Phrase that Often Leads to Failure

One of the most common things I hear from people who want to learn JavaScript is, "I'll just make a quick slideshow."

They'll try to make the slideshow, and one of two things will usually happen:

  1. It'll be too hard, and they tell themselves they'll "come back to it later" --- which often means giving up forever.

  2. They'll succeed in creating the slideshow, but since they had to cover so much material at once, they won't be able to apply it afterwards. This leads to discouragement, which can mean, once again, giving up forever.

Why does this happen?

The Trap of Too Much, Too Soon

JavaScript learners often pick a slideshow as their first project because it sounds simple.

It's a trap!

Once they attempt it, they discover it's harder than they thought. Making a slideshow might involve arrays, functions, loops, animation, timing, event listeners, DOM manipulation and more. This can be an overwhelming number of new concepts for someone who is starting out.

Suddenly, this project that was supposed to be easy is too difficult. That difference from the original expectation creates a nasty psychological effect. "If I can't do this easy thing," learners tell themselves, "then maybe I'm just not cut out for JavaScript."

Alternatively, some people will succeed in creating a slideshow, but it'll be cobbled together with a ton of help from tutorials and relatively little understanding of what's happening. In those cases, you frequently hear phrases like, "I was able to follow along with the tutorial, but then I couldn't apply any of it on my own."

Either way, the end result is often a feeling of discouragement that can stop people from learning JavaScript.

These scenarios happen not just with slideshows but other projects that learners will attempt too soon. For example, a to-do list sounds simple, but that can be a full-stack project if the data is to be saved outside the browser's local storage or cookies.

When someone is starting to learn JavaScript, it can be hard to identify the difficulty level of a project beforehand, and that's the source of the trouble.

Which Projects Often Hinder Learning?

In order to make this discussion more concrete, here are some specific, simple-sounding projects people often attempt too early, and the concepts that are actually involved.

Project Concepts Involved
Quiz Arrays, objects, functions, forms, event listeners
To-do list Arrays, objects, functions, some form of storage (front-end or back-end), DOM manipulation, event listeners
A "little social network" This is a full-stack project that, in addition to front-end JavaScript, involves back-end concepts including databases, authentication, security, user management, etc.

What's the point?

The point of this section is not to scare you off from attempting new things. You can arrive at some of these projects faster than you'd expect as long as you don't start with them from the beginning.

All you need is a better approach.

Continue reading %Projects Can Sometimes Be the Worst Way to Learn JavaScript%


by Yaphi Berhanu via SitePoint

Wednesday, November 16, 2016

How to Improve Your Ranking for Google Maps 3-Pack

How to Improve Your Ranking for Google Maps 3-Pack

Showing up at the top of a Google search result is a dream come true for most businesses. When you're a small business, getting that top spot in a local Google search is a huge boost to your business. But how do you get yourself to show up there?

by Guest Author via Digital Information World

vikas thakur portfolio website

Vikas is a self taught UI/ UX developer cum designer rooted from engineering background. His designs reflects freshness, and absolute joy where hours of research on the interfaces helps him to create robust designs to lift Startup\’s or Business De


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Apex Ping

Uptime monitoring tool for websites and APIs, designed to be simple, beautiful and flexible.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Green Ljubljana

Ljubljana – European Green Capital 2016 aims to inform citizens of city’s »green« activities and encourages people to take action to contribute to a greener tomorrow.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

How to Build an Image with the Dockerfile

Building an image with Dockerfile

Building the app, installing the dependencies and services, automating the deployment, and more --- it all starts with the Dockerfile. Let's review the syntax, from basic to elaborate, and some best practices when building your Docker images.

In this guide, we'll write a Dockerfile instructing Docker to select a minimal Linux (base image) for the application we'll deliver, and ship with it a set of tools of our choice and a certain configuration, effectively building our own Linux distribution which is just right for running our app.

Why Docker

docker_logo

With Docker you can "Build, ship, and run any app, anywhere". That is, you can pack your application with all of the binaries and runtime libraries, back-end tools, OS tweaks, and even specific services your application needs for running --- and make it readily available for instant delivery and automatic deployment.

The software containers technology that Docker implements is what makes this possible. And although I won't cover here much of the detail behind it, you can read more about Docker, what software containers are, and how they work in Understanding Docker, Containers and Safer Software Delivery.

Installing Docker

Before starting, you'll need to have Docker installed, whether it's on your local machine or on a remote server.

Fortunately, the latest version of Docker (1.12 as of this writing) made the installation process really smooth, and you have easy-to-follow guides for Windows, MacOS and Linux.

The Dockerfile

In order to build an image in Docker, you first need to set the instructions for this build on a plain text file named Dockerfile and a context (more on this later). This file has a syntax similar to that of Apache configuration files --- one instruction per line with its respective arguments, and all instructions processed in sequence, one after another. Comments are preceded by the # character and a whitespace. Finally, once you have a Dockerfile, the command docker build will build the image, as we'll see in more detail later.

Before we start writing the Dockerfile, we'll set the working space. We'll create a directory called my_image in our home directory, use it as our working directory, and place the Dockerfile in there:

mkdir ~/my_build
cd ~/my_build
touch Dockerfile

Now we're ready to start building the image.

Selecting the base image

Most of the time when creating an image, you'll use a starting point --- that is, another image. This can be an official Ubuntu, MySQL, WordPress, or any other image available from the Docker Hub. You can also use an image you created yourself previously.

Note: You can create your own base image with your own core tools and directory structure, using Docker's reserved, minimal image, called scratch. It's a process I won't cover here, but you can refer to the Docker site's guide on creating a base image.

For example, if you want to start off with a minimal Debian distribution, you'll add the following content to the Dockerfile:

# set the base image
FROM debian

FROM must be the first instruction you use when writing a Dockerfile. Notice that you can also use a specific version of your base image, by appending : and the version_name at the end of the image name. For example:

# set the base image
FROM debian:sid

In the code above, we're using the "sid" Debian (unstable distribution). This will be relevant also when you want a specific version of a Ruby or Python interpreter, MySQL version, or what have you, when you use an official base image for any of these tools. For now, we'll stick to the default (stable) debian image for this guide.

Specifying a maintainer and adding metadata

Optionally, you can specify who's the MAINTAINER, replacing Lucero del Alba by your name or the person or team responsible for the build:

# author
MAINTAINER Lucero del Alba

It isn't necessary, but we may also add some metadata using the LABEL instruction, and this information will become available later when using then docker inspect command to examine the image:

# extra metadata
LABEL version="1.0"
LABEL description="First image with Dockerfile."

For more on this feature, refer to Docker object labels.

Making your own distro

Linux logo

At this point, we're going to select some tools and libraries to be included in our image, so that our container has everything it needs for what we intend it to do. At the end of this tutorial, we'll be doing something that's very close to actually building a Linux distribution.

Some containers, such as one running a PostgreSQL database, are meant to run in the background. But often we need a console to perform some operations on the container, so we're likely to need some extra tools, because the base image will bundle just a minimal set of GNU tools.

Dealing with cache issues

It's almost guaranteed that you'll experience cache issues when trying to install additional packages on your image. This is because the base image comes with cached metadata, and the live repositories you're pulling data from are often changing.

So before requesting to install any package, you need to address this issue. In Debian-based distributions, you can handle this by adding the following commands before installing new packages:

# update sources list
RUN apt-get clean
RUN apt-get update

Installing basic tools

Code editors, locales, tools such as git or tmux --- this is the time to install everything you're going to need later, so that they're bundled in the image.

We'll install one per line:

# install basic apps, one per line for better caching
RUN apt-get install -qy git
RUN apt-get install -qy locales
RUN apt-get install -qy nano
RUN apt-get install -qy tmux
RUN apt-get install -qy wget

We could install all of them in a single line, but if we later want to add or remove a package, we need to re-run the whole process. So the best practice here is to install one package per line so you can benefit from Docker's caching.

Also, keep it tight. You don't want to install tools "just in case", as this may increase the build time and the image size.

Installing runtime libraries for your app

We'll be shipping our app in this image as well. Do you need a specific version of PHP, Ruby or Python, together with certain modules? Now's the time to deliver all of the programs and runtimes our app is going to need.

Be as specific as you like, as this container is intended to run only your app:

# install app runtimes and modules
RUN apt-get install -qy python3
RUN apt-get install -qy python3-psycopg2
RUN apt-get install -qy python3-pystache
RUN apt-get install -qy python3-yaml

For this example, we'll install Python 3 with the packages Psycopg 2 (to connect to PostgreSQL databases), the Mustache for Python module, and the YAML module. (You'll naturally install the specific dependencies you need when doing your own.)

Compiling and downloading packages

It's also possible that your distribution won't have a package for a certain module or program that you need. But you don't need to manually install it in your running container! Instead, you can use the RUN instruction (one per line) to batch the process of downloading, compiling and setting whichever library your application will need.

You can even write a script on a separate file, add this file to the build and run it, as we'll see later in the "Shipping Your Own App" section.

Cleaning up

To keep your image tidy and as small as possible, it's also a good idea to do a cleanup at the end of the installation sequence:

# cleanup
RUN apt-get -qy autoremove

Again, notice we're using apt-get because we chose Debian, but use the appropriate command for the distribution of your base image.

Continue reading %How to Build an Image with the Dockerfile%


by Lucero del Alba via SitePoint

UX Portfolio Mentoring Sessions with Louise Campbell

A couple of months back we ran one of our most popular Slack sessions to date – perhaps not surprisingly, it was all about creating a persuasive UX portfolio.

It was so popular that we’re running a couple of follow up portfolio mentoring sessions, this time focussing on the different aspects of presenting your work to prospective employers in the best possible light.

In the first session Louise will cover questions like

  • What counts as portfolio material?
  • What results should I display?
  • How do I promote my portfolio?”

The second session will be defined by the most popular themes in the first.

The Details

Meet Louise Campbell

Louise Campbell

Louise Campbell is a Lead UX Design consultant for giant eCommerce companies. She started out at 19 as a junior print designer for Littlewoods Home Shopping Group. Over the last 15 years has worked her way up to consulting for luxury e-commerce companies including Net-a-porter.com, MrPorter.com, The Body Shop, Benna.co.uk, and travel giant Greyhound.com.

Louise is also a career transition coach for ambitious graphic designers who want to make it big in UXD. She teaches a free weekly mini-class to show you ‘How to Create a Persuasive Portfolio’ at UpSkillMastery.com.

How to Ask Your Questions

If you can’t make the live session but have questions, we’d love to collect them ahead of time and we’ll ask Louise on your behalf. You can submit your questions here. We’ll publish the responses (along with the full transcript) in the days following the session.

How do Mentoring Sessions work?

These sessions run for approximately an hour each and best of all, they don’t cost a cent. We run them in our dedicated public Slack channel. That means that there is no audio or video, but you are welcome to revisit the channel at a later date if you need a refresher.  If you’re not familiar with Slack, you’ll need to request an invite to our channel the first time only – from then on you’re part of the family and you’ll have automatic access to new sessions.

The post UX Portfolio Mentoring Sessions with Louise Campbell appeared first on UX Mastery.


by Sarah Hawk via UX Mastery