Friday, November 6, 2015

Content Budgets: Why #ContentMarketing Is A Main Marketing Focus in 2015 & Beyond - #infographic

The Big Content Spend: How & Where Are Brands Placing Their Content Budgets (Infographic)

How and where are brands placing their content budgets? What kind of brands believe in content, and invest in it as a major form of marketing?

Find out the answers and more in this infographic that features statistics about the importance of content in the marketing sphere for 2015.

by Irfan Ahmad via Digital Information World

Write Better Queries with Breeze.js

This article was peer reviewed by Agbonghama Collins. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be!

Data volumes are growing rapidly and they are becoming more complex to maintain. Many developers want to avoid the problems and headaches that are caused by data issues during their job.

One of the libraries that makes our job easier is Breeze.js. In this article, we will talk about how we can write better queries with Breeze.js. But firstly, we should know what is Breeze.js and why it was created.

What Is Breeze.js?

Breeze.js is a JavaScript library that helps us manage data in rich client applications. Breeze runs natively in every browser and supports client-side querying, caching and dynamic object graphs.

The best thing about Breeze.js is that it doesn’t mirror the server-side model, but it creates it dynamically. With Breeze, the cached data is on the client side. It doesn’t need to query the server because it can query the cache instead. It saves the cache locally and offline. When it is reconnected, it syncs the changes.

Two of the strongest points of Breeze.js are rich queries and change tracking. Four powerful ways to query are filters, sorting, paging and projections. A query needs help to execute, that’s where Breeze EntityManager comes in. Each entity keeps track of its own changed state. We will discuss this later.

Breeze.js works well with a lot of frameworks including AngularJS, Backbone.js, Knockout, Node.js and many others.

Now let’s look at how to setup the environment and get to coding.

How to Install

[author_more]

Breeze can be downloaded from its repository on GitHub. The most common versions of Breeze are:

  • breeze.debug.js — This is the standard client library that I suggest using. It has support for third-party libraries including Backbone and Knockout.
  • breeze.min.js — Breeze.min.js is the minified breeze.debug.js, its size is 175 KB compared to size of breeze.debug.js, which is 602 KB.

There are two other ways to get Breeze: through Bower and npm. I prefer using Bower because I am more familiar with it. Open the terminal, then go to the client directory and run these two commands to get Breeze:

bower install breeze-client
bower install breeze-client-labs

In order to include Breeze into a the project, you should include this script tag inside the <body> of your page:

<script src="bower_components/breeze-client/build/breeze.debug.js"></script>

Older browsers that do not support ECMAScript 5 can cause problems for Breeze. A shim library is necessary to enable ES5 syntax on these browsers. For Internet Explorer users, it is recommended to enter this code inside the <head> tag, to avoid compatibility mode issues.

<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/>

Breeze also needs some extensions to work normally:

  • a data service
  • a JavaScript component that performs AJAX requests
  • a model library for data binding (such as Knockout)
  • a promise library

So as to demonstrate Breeze in action, in the next section I’m going to show you how to get one of Breeze’s sample applications up and running. This will include all of these things out of the box.

Prerequisites for the Sample App

So as to run the sample app, you will need Node.js and MongoDB installed on your machine.

Node.js is free to use, and can be downloaded from the project’s homepage. If you have Bower or npm on your computer, you also have Node installed. If you are having trouble installing Node, then check out our tutorial on npm (which includes a section on this): A Beginner’s Guide to npm

MongoDB can be downloaded from their download page. They have guides on how to install for all major operating systems.

Setting up the Sample App

The first thing to do is grab a copy of the Breeze JavaScript Client sample applications. The easiest way to do this is using Git:

git clone http://ift.tt/1MNsXKI

Within the project, navigate to node/zza-node-mongo folder:

cd breeze.js.samples/node/zza-node-mongo

Here you see three folders: client, database, server. In the database folder unzip zza-mongo-database.zip.

cd database
unzip zza-mongo-database.zip

Continue reading %Write Better Queries with Breeze.js%


by Taulant Spahiu via SitePoint

Watch: Backup Your WordPress Sites Manually and Easily

There are plenty of plugins to backup your WordPress site, yet the best way to ensure your backup works is... to do it manually! Yes it sounds difficult, but that's only because you may not have realised that it only takes a few minutes to capture the basics. Watch as I demonstrate how to do this in less than 5 minutes.

Loading the player...

Continue reading %Watch: Backup Your WordPress Sites Manually and Easily%


by Charles Costa via SitePoint

Best Free and Cheap Website Options for Small Businesses

Not long ago, if you wanted a website, you had to be willing to shell out at least a few grand for the most basic of static sites. I remember about ten years ago at a firm I worked for, quotes for ecommerce sites, or sites with other dynamic features, would be over $20,000!

If you're not a developer, designer, or even a web person, but you have a business or brand that you want to get online, here are some hosts you can sign up with that won't require you to hire design services or developers.

What's It Going to Cost Me?

The answer is, having a website is pretty stinking cheap these days. Most of the following hosts have plans starting at FREE! And unless you have hundreds of thousands of visitors a day, less than $10 a month gets you a pretty powerful setup.

But First, a Bonus!

Before we get into web hosting, it's worth mentioning that if you have a business, and especially if you cater to local clients in your area, you should get your business listed on maps!

Many people use Google Maps or other map services to find businesses while they travel, or just as a normal way to search (I do!). It makes sense to update your listing on the most popular map services.

Here are some links to get started:

Social Profiles

Maybe you don't need a full-fledged website; maybe you just need a personal brand page or business page.

If that's the case, try the following services. All free!

Facebook business page

Facebook

The king of social profiles title still belongs to Facebook. If you have a personal profile already, you can create a page for your business too. In a company I work for, when searching Google for the company name, the Facebook page comes up even before the primary website!

LinkedIn

You would benefit here if your business revolves around you personally as the brand. If you're a consultant or freelancer, or do business-to-business or networking, then LinkedIn can help. Start with a free profile, but you may want to upgrade at some point.

Google Plus

If your business is connected to media, perhaps through YouTube or other Google services, then G+ is a good idea. If your business is a personal brand, similar to what I said about LinkedIn, this could be for you as well.

Myspace

Yes, Myspace is still around! And mostly owned by Justin Timberlake. The site focuses mainly around music and the arts, culture, and lifestyle.

If your brand is in music and arts, you should think about a profile here.

Bonus: Foursquare

This is a category all its own, but if you have a local business with high foot traffic and a young culture, take a look at Foursquare.

If you have the type of business that would benefit from the social activity as created by Foursquare, this is a top option for you. Any business with high traffic, or a youth-centered atmosphere, is a good fit. Coffee shops, entertainment outlets, media stores, places that are hip and cool!

Free Websites

Here's a list of services to host a free website to get you started, in no particular order. Just please, as soon as possible, upgrade to premium features and get your own custom domain name! Most free hosts won't let you have a custom domain such as http://ift.tt/1L1vmtH, but instead will offer something more like mysuperpetcollection.someservice.com. To be more professional, upgrade to a custom domain name.

Free services also typically do some sort of advertising, such as sticking ads at the bottom of your site, or an occasional popup shown to your users. Another reason to upgrade as soon as you can!

Disclaimer: No links in this article are affiliate links.

Yola

You won't get your own domain name with the free package, and you only get three pages, but it's ad-free and the templates are fine. Try this if you only need a couple pages and don't care about having your own domain name yet.

When you're ready to upgrade, you can get a free domain name with purchase of the next package which is only about $4.17 per month for unlimited pages and bandwidth, and 2GB of storage.

Wix

One of the more highly regarded free hosts, Wix has nice templates, add-on apps, unlimited pages and much more. You won't get a custom domain name, and you'll see Wix advertising. The $4.08 per month upgrade gives you a domain but doesn't remove ads; you'll need the $9.25 per month option to get rid of those.

Here is an example of a few Wix templates:

Wix templates

DoodleKit

The free templates here seem a little aged, but their tagline is Free Website Builder. For those who want to tinker a bit more on the default templates, they allow more customization. Their first upgrade path is for $14 per month to get a domain name, SEO tools, unlimited bandwidth and 3GB of storage.

Moonfruit

The free option allows 15 pages, including ads for Moonfruit. You'll have to upgrade to get your own domain, more pages, and remove branding.

This one has an addition of ecommerce features and allows you to build a shop and publish products to other networks. They have clean, minimalist designs, built with HTML5, and are mobile optimized. The first upgrade is $4.50 per month when billed annually, and it removes ads.

Here are a few examples of Moonfruit's themes:

Moonfruit themes

Weebly

Another option with ecommerce abilities and unlimited pages. The first upgrade is $8 per month to get your domain added and remove branding.

This service integrates mobile features such as mobile management of online orders and analytics. There are some advanced features here worth looking at, including a drag-and-drop template editor and email with your domain.

WordPress

The granddaddy of all free hosts is WordPress. The company proudly declares that it powers 24% of the internet, whatever that means!

You can build many types of sites on the free account, but you'll need a paid account to get into ecommerce and use your own domain name.

You wouldn't go wrong choosing WordPress, though its templates are still somewhat blog-centric, as it's primarily a blogging platform.

Tumblr

This is a special mention, simply because it's free. Tumblr is more for personal sharing or blogging than for businesses. If you simply want a website to share your favorite things and blog, check out Tumblr.

Continue reading %Best Free and Cheap Website Options for Small Businesses%


by Zack Wallace via SitePoint

Core Data and Swift: Managed Objects and Fetch Requests

This week's JavaScript news, issue 257

This week's JavaScript news
Read this e-mail on the Web
JavaScript Weekly
Issue 257 — November 6, 2015
13 multiple choice questions on things like bindings, classes, computed properties, and more, await you. Explanations of the answers are available.
kangax

Object.observe was a promising new feature in the forthcoming ES7 standard (and implemented in V8) but which now appears to be withdrawn from consideration by TC39, as well as from V8.
ESDiscuss

A tour of the history of dates and times which, eventually, moves into how JavaScript deals with their quirks. This is a long read which threads the worlds of technology and politics together well.
Curtis Autery

Master the art of writing your applications in Angular 1.x using an approach that makes it easier to convert to Angular 2 tomorrow with this 5 day online training. Attend remotely from anywhere in the world and take advantage of recorded sessions after course completion.
Rangle.io   Sponsored
Rangle.io

A great introductory talk on Scala.js which compiles Scala code to JavaScript. It’s not commercially supported by Typesafe but is production ready.
YouTube

More information on what Node v5 represents versus the v4 LTS release. Subscribe to Node Weekly for more like this.
Node Foundation

Cody Lindley explains why he believes jQuery is still important and relevant, despite the growing noise saying that you don’t need jQuery.
Telerik Developer Network

A very thorough slidedeck that stands up well on its own. It looks at the issues with CommonJS and why ES6/ES2015’s native module system is so vital.
Ben Newman

Jobs

  • Senior JavaScript Engineer at TwitchTwitch is building the future of interactive entertainment and we’re looking for someone who brings JavaScript application development experience and technical leadership, around whom we can build a focused team to execute on one of our core product areas. Twitch
  • JavaScript Front End Developer, Amsterdam, the Netherlands (full time)We are hiring the best Front End developers to join our international top-talent team in Amsterdam. We want you to have the freedom to make an impact on millions of users worldwide and keep us innovating. Booking.com
  • Stop Applying For Jobs. Have Jobs Apply For You.For highly sought-after candidates, sifting through available job opportunities can be overwhelming. Forget applying and let interested companies reach out to you directly through Hired. Hired.com

In brief

Curated by Peter Cooper and published by Cooper Press.

Stop getting JavaScript Weekly : Change email address : Read this issue on the Web

© Cooper Press Ltd. Office 30, Lincoln Way, Louth, LN11 0LS, UK


by via JavaScript Weekly

Breaking Free from Guzzle5 with PHP-HTTP and HTTPlug

This article was peer reviewed by Márk Sági-Kazár. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be!

In a previous series, we built a PHP client for Diffbot. The client works well and is in relatively widespread use - we even tested it on a live app to make sure it’s up to par - but it depends heavily on Guzzle 5.

There are two problems with this:

  1. Guzzle 6 is out, and supports PSR 7. While the author of Guzzle claims Guzzle 5 will be supported for the foreseeable future, it’s safer to be skeptical of its longevity. Besides, while PSR 7 might have its quirks, it’s good to follow PSRs if only for the compatibility with other projects
  2. Someone implementing our client in their app might already have a preferred HTTP client in use, and would like to use theirs rather than Guzzle. We should allow for easy injection of any HTTP client into our SDK.

Coincidentally, there is a new project allowing us to do just that: HTTPlug.

Travel power adapter

Note: you don’t need to be familiar with the internal logic of the Diffbot SDK to follow along. The process in this article is applicable to any package with a concrete HTTP Client implementation and is easy to follow.

PHP-HTTP and HTTPlug

PHP-HTTP is a Github organization and, among other things, a collection of adapters for various HTTP clients. On top of all these sits a common implementation in the form of a virtual package, named php-http/client-implementation, concretely realized by the collection of interfaces and exceptions presented in the HTTPlug sub-project.

The various adapters declare themselves as providers of this package, so someone who uses Guzzle 6 can composer require php-http/guzzle6-adapter, and this would pull in the adapter, the HTTPlug interface package, and Guzzle 6 itself as a dependency of the adapter.

HTTPlug is the entry point for a reusable package. It is the client abstraction all clients (like the Guzzle6 Adapter) are based on. These clients then further make use of their underlying packages / dependencies - Guzzle 6 in this case.

So, bottom to top:

  • an HTTP Client exists (Guzzle 6)
  • a Guzzle 6 adapter is built with HTTPlug as the interface for it, wraps Guzzle 6
  • an app needing to be able to make HTTP calls needs a client, requires HTTPlug’s HttpClient interface rather than Guzzle 6 directly
  • the app can then use Guzzle 6, or any other adapter implementing HTTPlug’s HttpClient interface and wrapping another third party HTTP Client

The team’s plan is to eventually have maximum support for all the various HTTP clients in PHP land: Guzzle 6, Guzzle 5, Zend2, Zend1, etc. That way, a user of a framework or app will have no conflicts with installed client versions, and will simply plug the appropriate adapter into the mix.

Note that we use the terms adapter and client here almost interchangeably - the adapters based on HTTPlug are both. They are wrappers around existing clients, but used directly as clients themselves.

Our plan in this post is to replace the concrete Guzzle 5 dependency of Diffbot’s PHP client with the HTTPlug version.

Note: HTTPlug and related packages are alpha software, and as such are subject to change. Converting anything to use them is a risky endeavor.

Bootstrapping

As usual, it’s recommended we use Homestead Improved to bootstrap our environment. Once we’re ready, we can clone and test the current stable version of the SDK:

git clone http://ift.tt/1KvYsFt
cd diffbot-php-client 
git checkout tags/0.4.5 
composer install
phpunit

The last command assumes PHPUnit is globally installed on the development environment.

All tests should pass (except for a skipped one that’s bugged and unfixable due to some nonsense), so we’re ready to begin the conversion.

Getting Started

First, we’ll need to create a new branch on which to develop this upgrade.

git checkout -b feature-httplug

Then, we add two dependencies into our composer.json file:

     "require": {
        ...
        "php-http/client-implementation": "^1.0"
    },
    "require-dev": {
        ...
        "php-http/guzzle6-adapter": "~0.2@dev"
    },

What this does is tell the client that from now on, it depends on a virtual package - this one. This means that in order to be used, the application using our Diffbot client (like this one) must select an implementation of this package (one of those listed at the link on Packagist). Of course, during development of the package, it would be impossible to test and see if everything’s working without an actual implementation, so we specify an additional require-dev dependency. In the specific case above, we use "php-http/guzzle6-adapter": "~0.2@dev". We chose that particular version simply because it’s the newest one and there’s no stable release.

Note: You may be wondering why we used the approach of adding values into composer.json rather than declaring dependencies interactively in the terminal like we usually do. This is because doing a composer require on a virtual package will throw an error - the package doesn’t really exist, it’s just its virtual name, a placeholder, so Composer will get confused not knowing what to install. There is an issue suggesting a change to this, but it’s not likely to happen soon.

Since the php-http packages are still under heavy development, we should add the following two values to our composer.json file:

"prefer-stable": true,
"minimum-stability": "dev"

Continue reading %Breaking Free from Guzzle5 with PHP-HTTP and HTTPlug%


by Bruno Skvorc via SitePoint