Friday, June 1, 2018

Black Messiah

Black Messiah is a comic book series created by Dan Dasse & Julien Cohen."Enter Black Messiah's Mind" will bring you into the dark world of Alex, the main character.
by via Awwwards - Sites of the day

jQuery Tag Cloud Plugin

A simple jquery plugin for generating tags with different sizes and colors.

The post jQuery Tag Cloud Plugin appeared first on Best jQuery.


by Admin via Best jQuery

jQuery Clip Carousel Plugin

Clip carousel is a jQuery carousel plugin with clip animation.

The post jQuery Clip Carousel Plugin appeared first on Best jQuery.


by Admin via Best jQuery

Thursday, May 31, 2018

What’s new in ES2017: Async functions, improved objects and more

Let’s take a look at the most important JavaScript updates that came with ES2017, and also briefly cover how this updating process actually takes place.

The Update Process

JavaScript (ECMAScript) is an ever-evolving standard implemented by many vendors across multiple platforms. ES6 (ECMAScript 2015) was a large release which took six years to finalize. A new annual release process was formulated to streamline the process and rapidly add new features.

The modestly named Technical Committee 39 (TC39) consists of parties including browser vendors who meet to push JavaScript proposals along a strict progression path:

Stage 0: strawman -
An initial submission of ideas for new or improved ECMAScript features.

Stage 1: proposal -
A formal proposal document championed by at least one member of TC39, which includes API examples, language semantics, algorithms, potential obstacles, polyfills and demonstrations.

Stage 2: draft -
An initial version of the feature specification. Two experimental implementations of the feature are required, although one can be in a transpiler such as Babel.

Stage 3: candidate -
The proposal specification is reviewed and feedback is gathered from vendors.

Stage 4: finished -
The proposal is ready for inclusion in ECMAScript. A feature should only be considered a standard once it reaches this stage. However, it can take longer to ship in browsers and runtimes such as Node.js.

If ES2015 was too large, ES2016 was purposely tiny to prove the standardization process. Two new features were added:

  1. The array .includes() method which returns true or false when a value is contained in an array, and
  2. The a ** b exponentiation operator, which is identical to Math.pow(a, b).

What's New in ES2017

The feature set for ES2017 (or ES8 in old money) is considered to be the first proper amendment to the ECMAScript specification. It delivers the following goods …

Async functions

Unlike most languages, JavaScript is asynchronous by default. Commands which can take any amount of time do not halt execution. That includes operations such as requesting a URL, reading a file, or updating a database. A callback function must be passed, which executes when the result of that operation is known.

This can lead to callback hell when a series of nested asynchronous functions must be executed in order. For example:

function doSomething() {
  doSomething1((response1) => {
    doSomething2(response1, (response2) => {
      doSomething3(response2, (response3) => {
        // etc...
      };
    });
  });
}

ES2015 (ES6) introduced Promises, which provided a cleaner way to express the same functionality. Once your functions were Promisified, they could be executed using:

function doSomething() {
  doSomething1()
  .then(doSomething2)
  .then(doSomething3)
}

ES2017 Async functions expand on Promises to make asynchronous calls even clearer:

async function doSomething() {
  const
    response1 = await doSomething1(),
    response2 = await doSomething2(response1),
    response3 = await doSomething3(response2);
}

await effectively makes each call appear as though it’s synchronous while not holding up JavaScript’s single processing thread.

Async functions are supported in all modern browsers (not IE or Opera Mini) and Node.js 7.6+. They’ll change the way you write JavaScript, and a whole article could be dedicated to callbacks, Promises and Async functions. Fortunately, we have one! Refer to Flow Control in Modern JavaScript.

Continue reading %What’s new in ES2017: Async functions, improved objects and more%


by Craig Buckler via SitePoint

Alibaba Cloud, AWS & DigitalOcean: Cloud Services Compared

This article was created in partnership with Alibaba Cloud. Thank you for supporting the partners who make SitePoint possible.

Cloud computing allows you to use computer services such as servers, databases, analytics and more over the internet using virtual machines.

The idea has been around since the inception of the Internet, but it really began to take off when Amazon launched its Elastic Compute Cloud in 2006, which later became known as Amazon Web Services, or AWS. Many other competitors have entered the market since then as cloud computing has blossomed into a huge growth industry.

Cloud Computing providers allow you to host websites and applications, store data and assets, run software as a service applications, provide on-demand services such as streaming videos, photo backup and storage and even use artificial intelligence services.

One of the key benefits of cloud computing is that as you only pay for what you use, in a similar way that you pay for gas or electricity. You can almost think of it as 'renting' a server located 'in the cloud'. This makes it a very inexpensive way of gaining access to multiple high-end servers, running the latest software without the cost and hassle of running the actual servers yourself.

Another advantage of cloud computing is elastic scaling, which is the ability to increase or decrease the amount of computing power that your service uses, as and when required, using load balancers. This allows you to launch your service without the need big up-front investment and helps to take some of the risk out of launching a new service, while still allowing for expansion in the future. For example, Alibaba Cloud features a load balancer that can use shared resources, but also switch to guaranteed performance instances when required.

Cloud computing providers also make it easy to set up and deploy both ready-made and custom builds of virtual machines using a variety of operating systems. You can spin up a new instance and have it running in a matter of minutes. Virtual servers don't require any management and are able to take advantage of a huge infrastructure with servers located globally means that people can access your site from around the world without having to worry about latency issues. Their distributed nature means that there isn't a single point of failure, making them extremely reliable with an uptime of virtually 100%. Backup and recovery are also baked into the service, so you don't need to worry about data loss. There's no need for IT administrators here!

In this post we're going to take a look at 3 of the big providers - AWS, Alibaba Cloud and Digital Ocean - and compare them using the following criteria:

  • Services offered
  • Pricing
  • Help & Support

All three services have a very similar offering, but do it in slightly different ways. Hopefully this post will help you decide which one is the right fit for you.

Meet The Competitors

Amazon Web Services, or AWS, is the big daddy of cloud computing. Launched in 2006, it now has an impressively vast array of services on offer and is the clear leader in the field. When you first log into AWS, you get the familiar feel Amazon's website - it's almost as if you're just buying something else from their store. Initially, the sheer number of options can be quite overwhelming.

Alibaba are often referred to as the 'Chinese Amazon'. They launched Alibaba Cloud in 2009 as a direct competitor to AWS, with a focus on Asian markets. It has grown significantly since then and is now the largest cloud provider in China. In 2017 they were named the official cloud services provider of the Olympics and this year they received the MySQL Corporate Contributor Award in recognition of their contributions to open source. Alibaba Cloud are really ramping up their offering in 2018, and recently made a commitment to invest $15 billion over the next 3 years into their already impressive cloud computing service. When you log into Alibaba Cloud, you notice that it has a modern and professional feel to it. They also offer a mind-boggling number of options that can seem a bit daunting at first.

Digital Ocean started life in 2012 with the aim of making it easy for developers to build applications in the cloud. My first impressions of their site was that it has a clean look and user-friendly design. They also use the concept of 'Droplets' that are virtual machines at various price points. This fits the theme of the company by reimagining the cloud as a digital ocean where each virtual machine is droplet in a digital ocean. This approach certainly makes it simpler to get started without having to wade through a vast number of options.

Services Offered

All 3 Cloud Computing providers in our roundup provide a similar offering in terms of the basic provision. This includes:

  • The ability to create virtual machines with multiple cores and up to 256GB of RAM
  • The ability to create custom images that can be recreated on demand
  • Load Balancing
  • Content Delivery Networks
  • Firewall including protection from Trojans and DDOS attacks
  • Snapshots & backups with built-in redundancy
  • An API so that other services and developers can interact with resources hosted in the cloud

All the services are easy to set up and have nice UIs, but AWS and Alibaba can look a bit complicated at times, with buttons, sliders and knobs all over the place! This is simply due to the fact that they have so many more options to choose from. Digital Ocean keeps things simple, which makes for a more pleasant user experience when setting things up.

All 3 services rely on you being comfortable giving commands via the console. They all have a wealth of documentation and tutorials that will walk you through various procedures.

The table below highlights some differences in what each service provides:

Features AWS Alibaba Cloud Digital Ocean
Regions Multiple in US, Europe and Asia plus one in South America 2 in the US, 1 in Europe, Multiple in Asia, including lots in China and some exclusive to Alibaba Cloud Multiple in US and Europe, 1 in Asia
Operating Systems Windows Server + Multiple Linux distributions Windows Server + Multiple Linux distributions Multiple Linux distributions
Storage Integrated storage using Amazon S3, Elastic Block Store or Elastic File System Integrated Object Storage Service, Elastic Block Storage and Network Attached Storage Integrated solution called Spaces
Databases Amazon Dynamo DB, Amazon Redshift An umbrella offering which does Managed Redis, MongoDB, MySQL, SQL Server and PostreSQL. AsparaDB, HybridDB, PolarDB (coming soon) No integrated cloud options, but you can install any database such as MySQL, PostGresSQL MongoDB etc
Extras Elastic Beanstalk allows you to build web apps quickly. Lots of integration with all Amazon's other web services. Huge amount of documentation. The award-winning Peta Scale data platform MaxCompute, Managed database offering for every possible type of data, Plesk Admin console provided free of charge. Free DDoS protection for all public endpoints. Large and friendly developer community. One-click installation of popular services such as Wordpress, Ruby on Rails and Ghost. Digital Ocean Monitoring allows you to track various metrics easily.

As you can see from the table, AWS is the only provider that has data centers in every continent. Alibaba has a big focus in Asia with data centers located in Dubai, Malaysia and Indonesia. They are also increasing their offering in the West with data centers in North America as well as Europe. Digital Ocean is primarily focused in Western countries.

AWS and Alibaba Cloud offer Windows Server, whereas Digital Ocean only uses Linux Servers. It should be noted, however, that it does cost more to run a virtual Windows Server. All 3 services offer their own integrated storage solution and cloud-based databases are provided by AWS and Alibaba Cloud. It's also possible to install any database software directly onto a virtual machine on all the services. They all provide an impressive list of extras that help to manage your virtual server and ensure it runs smoothly.

Alibaba Cloud also boasts an impressively high-level of security service that has successfully defended their services from a huge number of attacks over the years using an elastic network of web application firewalls.

Pricing

Comparing the pricing for these services is actually very difficult! The granular level of customisation that AWS and Alibaba Cloud offer means that its very difficult to compare exactly like with like. To complicate matters further, you can get cheaper deals with AWS if you don't need the service available all the time.

Continue reading %Alibaba Cloud, AWS & DigitalOcean: Cloud Services Compared%


by Darren Jones via SitePoint

Reddit Passes Facebook as Third Most Popular Website in U.S.

Reddit has now surpassed Facebook and is now the third-most-popular internet destination for users in the United States, according to rankings published by Alexa.com, a tool that tracks and analyzes web traffic. Despite its recent controversial site redesign, this means that Reddit now trails...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Web Desk via Digital Information World

A Side-by-side Comparison of Express, Koa and Hapi.js

If you’re a Node.js developer, chances are you have, at some point, used Express.js to create your applications or APIs. Express.js is a very popular Node.js framework, and even has some other frameworks built on top of it such as Sails.js, kraken.js, KeystoneJS and many others. However, amidst this popularity, a bunch of other frameworks have been gaining attention in the JavaScript world, such as Koa and hapi.

In this article, we’ll examine Express.js, Koa and hapi.js — their similarities, differences and use cases.

Background

Let’s firstly introduce each of these frameworks separately.

Express.js

Express.js is described as the standard server framework for Node.js. It was created by TJ Holowaychuk, acquired by StrongLoop in 2014, and is currently maintained by the Node.js Foundation incubator. With about 170+ million downloads in the last year, it’s currently beyond doubt that it’s the most popular Node.js framework.

Koa

Development began on Koa in late 2013 by the same guys at Express. It’s referred to as the future of Express. Koa is also described as a much more modern, modular and minimalistic version of the Express framework.

Hapi.js

Hapi.js was developed by the team at Walmart Labs (led by Eran Hammer) after they tried Express and discovered that it didn’t work for their requirements. It was originally developed on top of Express, but as time went by, it grew into a full-fledged framework.

Fun Fact: hapi is short for Http API server.

Philosophy

Now that we have some background on the frameworks and how they were created, let’s compare each of them based on important concepts, such as their philosophy, routing, and so on.

Note: all code examples are in ES6 and make use of version 4 of Express.js, 2.4 of Koa, and 17 for hapi.js.

Express.js

Express was built to be a simple, unopinionated web framework. From its GitHub README:

The Express philosophy is to provide small, robust tooling for HTTP servers, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs.

Express.js is minimal and doesn’t possess many features out of the box. It doesn’t force things like file structure, ORM or templating engine.

Koa

While Express.js is minimal, Koa can boast a much more minimalistic code footprint — around 2k LOC. Its aim is to allow developers be even more expressive. Like Express.js, it can easily be extended by using existing or custom plugins and middleware. It’s more futuristic in its approach, in that it relies heavily on the relatively new JavaScript features like generators and async/await.

Hapi.js

Hapi.js focusses more on configuration and provides a lot more features out of the box than Koa and Express.js. Eran Hammer, one of the creators of hapi, described the reason for building the framework properly in his blog post:

hapi was created around the idea that configuration is better than code, that business logic must be isolated from the transport layer, and that native node constructs like buffers and stream should be supported as first class objects.

Starting a Server

Starting a server is one of the basic things we’d need to do in our projects. Let’s examine how it can be done in the different frameworks. We’ll start a server and listen on port 3000 in each example.

Express.js

const express = require('express');
const app = express();

app.listen(3000, () => console.log('App is listening on port 3000!'));

Starting a server in Express.js is as simple as requiring the express package, initializing the express app to the app variable and calling the app.listen() method, which is just a wrapper around the native Node.js http.createServer() method.

Koa

Starting a server in Koa is quite similar to Express.js:

const Koa = require('koa');
const app = new Koa();

app.listen(3000, () => console.log('App is listening on port 3000!'));

The app.listen() method in Koa is also a wrapper around the http.createServer() method.

Hapi.js

Starting a server in hapi.js is quite a departure from what many of us may be used to from Express:

const Hapi = require('hapi');

const server = Hapi.server({
    host: 'localhost',
    port: 3000
});

async function start() {
  try {
    await server.start();
  }
  catch (err) {
    console.log(err);
    process.exit(1);
  }
  console.log('Server running at:', server.info.uri);
};

start();

In the code block above, first we require the hapi package, then instantiate a server with Hapi.server(), which has a single config object argument containing the host and port parameters. Then we start the server with the asynchronous server.start() function.

Unlike in Express.js and Koa, the server.start() function in hapi is not a wrapper around the native http.createServer() method. It instead implements its own custom logic.

The above code example is from the hapi.js website, and shows the importance the creators of hapi.js place on configuration and error handling.

Continue reading %A Side-by-side Comparison of Express, Koa and Hapi.js%


by Olayinka Omole via SitePoint