Advertisers Win the Ad-Blocking War

Advert blocking grew by more than 41% in 2015 and cost the industry $22 billion in revenue. Ad-blockers are not new but there has been a significant elevation in public consciousness partly owing to the number of options available. You have probably encountered adverts from browser vendors promoting their ad-blocking systems. Only the popular Lynx browser is yet to implement similar technology.

Ad-Blocker Blockers

Publishers began to retaliate last year and several popular sites now show messages to any visitor running ad-blocker software. Messages range from gentle suggestions to purchase a subscription to actively hiding page content while an advert-blocker remains active.

Detecting an ad-blocker is simple. A script checks whether the advertising script has loaded or a specific DOM node has content. If adverts fail to appear, the article is unloaded or the visitor is redirected to another page.

Beta Ad-Blocker Blocker Blockers

Ad-blocker blockers depend on client-side scripts which, themselves, can be blocked. Ad-blocker software teams can block the blocker within minutes of a new website script being reported. Several solutions are in development which thwart any publisher’s attempt to undermine the ad-blocking process.

Frail Loop

Advertisers and ad-blocker organisations spend inordinate amounts of time battling the innovations of the other. In computing terms, this is known as a “frail loop”. Two or more technologies recursively weaken each another until neither is effective.

Advert Network No Opt-out Initiative

Dozens of ad-revenue-dependent organisations have formed the Free Advertising and Responsible Targeting Syndicate. Their first proposal, the Advert Network No Opt-out Initiative, aims to end advert blocking forever by reversing content and advert publication methods.

Continue reading %Advertisers Win the Ad-Blocking War%


Source: Sitepoint

10 jQuery Horizontal Scroll Demos & Plugins

In today’s post we bring to you 10 jQuery Horizontal Scroll Demos & Plugins useful for those who see things horizontally. I guess we have to accept some people scroll both ways! 🙂

Updated: March 2016 Updated all plugins and demos with the latest versions and added some new ones. Also removed plugins which aren’t in development anymore.

1. ScrollMagic

Image of a top hat

ScrollMagic helps you to easily react to the user’s current scroll position. Its lightweight (6KB gzipped) and mobile friendly. It has support for both scroll directions.

See the demo

2. jInvertScroll

Screenshot of jInvertScroll homepage

jInvertScroll is a lightweight plugin for jQuery that allows you to move in the horizontal with a parallax effect while scrolling down.

See the demo

3. Horizontal Timeline

Mock-up of timeline screen

This tutorial will teach you to create an easy to customise, horizontal timeline powered by CSS and jQuery.

See the demo

4. Smooth Horizontal Scrolling with jQuery

Screenshot of the demo

This tutorial will teach you how to create a simple smooth scrolling effect using the jQuery Easing Plugin and just a few lines of jQuery.

See the demo

5. simplyScroll

Screenshot of a simplyScroll demo

Continue reading %10 jQuery Horizontal Scroll Demos & Plugins%


Source: Sitepoint

An Introduction to AngularJS Style Guides

What is a style guide? Do AngularJS projects need a style guide, and why? Which are the most popular AngularJS style guides? How would you use a style guide in a team of developers? This article is going to answer all these questions. Before diving into AngularJS style guides, let’s look at what a style guide is and why we developers need one.

Why Style Guides

Wikipedia provides a good general definition that can be useful to understand why style guides are important and to get the big picture before diving into AngularJS style guides.

A style guide (or manual of style) is a set of standards for the writing and design of documents, either for general use or for a specific publication, organization, or field. A style guide establishes and enforces style to improve communication. To do that, it ensures consistency within a document and across multiple documents and enforces best practice in usage and in language composition, visual composition, orthography and typography. For academic and technical documents, a guide may also enforce the best practice in ethics (such as authorship, research ethics, and disclosure), pedagogy (such as exposition and clarity), and compliance (technical and regulatory).

Coding style guides enforce the best practice in relation to a particular language and to your organization’s needs.

Project Style Guides

There are a number of reasons why JavaScript projects need a style guide. I’m not going to cover all of them in full detail in this article, but they usually expand on the language style guide by covering the following additional topics:

  1. Modularity: single responsibility, immediately invoked function expressions, module dependencies
  2. Application structure: architectural patters, folders structure
  3. Naming conventions: for modules, controllers, configuration and spec files
  4. Linting: JavaScript code checkers
  5. Testing: the approach in writing specs
  6. Comments: to produce documentation
  7. Startup logic: configuration, startup logic
  8. Routing: navigation flow, view composition
  9. Exception Handling: decorators, exception catchers, route errors
  10. Performance and Security: minification, obfuscation

Existing JavaScript Style Guides

For JavaScript there are a number of general and project-specific style guides out there:

Despite the big names, none of the style guides mentioned above is totally comprehensive. In my opinion, the Airbnb style guide is the most up-to-date and comprehensive, and provides also eslint configuration files with which you can automatically check your code style. The eslint configuration files can be extended, as I did when building my web site.

Why AngularJS Projects Need a Style Guide

AngularJS projects need a style guide pretty much for the same reason all JavaScript projects need a style guide, but there are some Angular-specific items that can be covered.

Let’s consider the following AngularJS-specific examples:

  • How to use ng tags. AngularJS ng directives can be used in different ways and have a different syntax, for example preferring data-ng instead of ng when using the ng directive as an HTML attribute, in order to be W3C-compliant. Specifying how to write ng directives in a code style guide helps improving consistency in the HTML files.

  • Different ways to implement components. AngularJS implements web components using custom directives. Custom directives can be based on HTML element names, attributes, class names, as well as comments. A style guide might assure that only one type of directive is used within a project for example.

  • Which architectural pattern to adopt. AngularJS allows for MV* (or MVW) architectural patterns. That leaves the choice to JavaScript developers about whether to implement their application based on MVC or MVVM. Guidelines about what kind of approach has to be used in the project helps in keeping the whole team on the same track.

Continue reading %An Introduction to AngularJS Style Guides%


Source: Sitepoint

Using Jetpack’s Publicize for Easy WordPress Social Sharing

You’ve just hit publish on your shiny new blog post. It’s packed with information that you know your readers will love. Wouldn’t it be even better if you could click one button and share your new post with your entire online network?

With Jetpack’s Publicize feature, you can instantly share posts on social media networks. So if you’re one of the millions of WordPress users taking advantage of Jetpack’s functionalities, you can use the Publicize feature immediately. You only have to set up your accounts once, and then you can start sharing right away.

Continue reading %Using Jetpack’s Publicize for Easy WordPress Social Sharing%


Source: Sitepoint

Drupal 8 Entity Validation and Typed Data Demonstration

In the previous article of this series we’ve started our dive into the Entity Validation and Typed Data APIs. We’ve seen how DataType plugins interact with data definitions and how various constraints can be added to the latter at multiple levels and extension points.

Drupal 8 logo

In this part, we will cover the aspect of actual validation and violation handling. In addition, we will write our own constraint and validator so that we can use custom behaviors in the data validation process.

Validation and Violation Handling

Even though we don’t yet know exactly how constraints are built, we’ve seen how they can be added to Typed Data definitions, including entity fields. Let us now see how we can validate the entities and handle possible violations we find.

When talking about Typed Data we’ve already seen how the validate() method can be called on the DataType plugin instance which holds a data definition. When it comes to entities, this can happen both at entity and field levels.

For instance, we can validate the entire entity using the validate() method:

$entity->set('title', 'this is too long of a title');
$violations = $entity->validate();

In our previous article, we added the Length constraint to Node titles to prevent title strings longer than 5 characters. If that is still in place and we run the code above, the validation should obviously fail. The $violations object is now, however, an EntityConstraintViolationListInterface instance which provides some helper methods for accessing violation data specific to Drupal content entities. It’s worth looking into that interface for all the helper methods available.

To get a list of Entity level violations we can use the getEntityViolations() method but we can also loop through all of them. Once we have our individual ConstraintViolationInterface instances, we can inspect them for what went wrong. For instance, we can get the error message with getMessage(), the property path that failed with getPropertyPath() and the invalid value with getInvalidValue(), among other useful things.

When it comes to fields, the property path is in the following format: title.0.value. This includes the field name, the key (delta) of the individual field item in the list and the actual property name. This represents the property path of our violation above.

Apart from calling validation on the entire entity (which may be superfluous at times), we can also do so directly on each field:

$entity->set('title', 'this is too long of a title');
$violations = $entity->get('title')->validate();

In this case, $violations is again an instance of ConstraintViolationListInterface and can be looped over to inspect each violation. This time, though, the property path changes to no longer include the field name: 0.value.

Continue reading %Drupal 8 Entity Validation and Typed Data Demonstration%


Source: Sitepoint

How First-Time Founders Can Develop Sales Skills

Sale!

“As a founder, what must you have to be successful?”

I’ve asked a lot of entrepreneurs this question—22, to be exact. And out of those 22 people, all but four answered:

“Salesmanship.”

At first, this answer surprised me. Wasn’t it more important to have a great idea, or a great team, or a great work ethic? But it started to make sense.

After all, entrepreneurs are constantly selling—they pitch investors, they pitch clients, they pitch potential employees, they pitch influencers and journalists, and so forth.

[author_more]

If you’re just starting out, and you’ve never sold before, check out these four strategies for learning how to sell.

Shadow a Salesperson

Watching a great salesperson work is hugely informative: you’ll get insight into their best practices, routines, responses to common questions and objections, and more.

But you shouldn’t follow just one salesperson around. As a general rule, shadow one salesperson from every “segment” you’ll be approaching.

For example, to learn how to sell to VCs, you should shadow a fellow startup founder. To learn how to sell to journalists, shadow a PR rep. To learn how to sell to your clients, shadow a salesperson in your industry.

You should call upon your network to get these opportunities. But let’s say you don’t know any PR reps or industry salespeople–in that case, I recommend finding relevant groups on MeetUp and leveraging the contacts you make there. For example, if you’ve founded a SaaS company, going to a meetup for SaaS entrepreneurs, salespeople, or enthusiasts would give you tons of potential connections.

Once you’ve identified some people you want to shadow, here’s how to frame your request:

Hey name,

I hope you’re doing well! I have a semi-unusual request for you: Could I follow you around for a day (or a half-day) while you work? You’re an amazing job title, and I’d love to learn how you communicate with clients and leads, talk to investors, pitch to influencers, etc. Lunch on me.

I’d be happy to work with your schedule, but if you’re too busy, absolutely no worries.

Thanks,

Your name

If you get a positive response, ask to shadow the person on a day where they’ve got a variety of tasks and meetings.

Here are a couple things I recommend watching for:

  • What language the person uses
  • How they tailor their approach to the individual lead or client
  • Which communication formats they use (email, phone, Skype, in-person meetings, etc.) and for what purposes (following up, answering questions, explaining the product, introducing themselves, etc.)
  • How they prepare

Once you notice an effective technique or strategy, you can incorporate it into your own sales methods.

Build a Sales Process

Pablo Picasso allegedly said, “Learn the rules so you can break them like an artist.”

And this maxim definitely holds true when it comes to selling. Once you’ve become a more experienced salesperson, you can go rogue.

But up until that point, establishing a sales process will give you consistency and direction—as well as a baseline for tracking your progress.

First, figure out how the typical sales process unfolds. This step will take a couple weeks, at minimum: You’ll need to be getting out there and doing lots of outreach so you can gather first-hand data.

Maybe you find that the average customer requires three phone-calls and one face-to-face meeting before deciding to buy. Or that it’s much easier to close deals with clients when you’ve given them a live demo. Or that rather than reaching out to the CEO of the company about your payroll software, you should contact their human resources decision.

Take what’s most effective, and create a formal plan. This plan should have distinct stages; so, Stage 1 might be “Establish contact with manager of human resources,” whereas Stage 2 could be, “Schedule product consultation.”

While it’s most important to set up a process for traditional selling, you’ll also find it helpful to set up processes for pitching to VCs, the media, and anyone else you’re informally selling to.

Continue reading %How First-Time Founders Can Develop Sales Skills%


Source: Sitepoint

6 Tips to Get Past a Creative Block

Maybe you’re a graphic designer. Or you’re part of the creative workforce. Or perhaps you simply create on the side. Either way, if you find yourself producing innovative work on the regular, then you’ve definitely come face to face with the dreaded creative block.

So what do you do when you’re hard pressed to come up with anything clever and a deadline is looming? You might squirm, distract yourself with email, or drink an entire bottle of chardonnay hoping for divine inspiration (à la Michelangelo) but that won’t solve the problem. Better to learn some strategies that will help you over the hurdle and get your creative juices flowing again.

1. Nature nurtures (your creative side)

man vs. nature: A man in a wide open cool climate forest valley

Many of us live in cities and suburbs where it might be unrealistic to visit the “great outdoors” on a regular basis. But even if you can’t get to the beach, or the lake, or the mountains it still helps to get out to a park—or out for a walk for some fresh air, and a fresh change of perspective. Evidence points to nature being exceptionally helpful in freeing your creative mind. Green space has a calming effect on your brain, and this helps encourage creative ideas because your brain isn’t distracted by the fast pace of city life. In fact, the effect is increased when you avoid distractions like your smart phone and text messages. Which leads me to topic #2…

2. Kill the Internet!… If only for a few hours.

Laptop in the dark with an almost closed lid

Increasing evidence points to how smartphones, social media, and the internet have created more distractions in our lives, making it harder to concentrate on one task at a time and “killing our creativity.”

Filling your idle time with work emails and getting caught up on texts may feel productive, but the loss of free time can be detrimental to your imagination. Your brain needs time to unwind and be absent-minded in order to formulate fresh ideas. So, if you’re finding it difficult to follow through on the task at hand, do your best to avoid filling that time with status updates, or seeing what new Instagram posts are in your feed. Letting a wandering mind ruminate over an idea is key to sparking the creativity you seek.

3. Lie down. And try not to fall asleep.

The creative workforce does a lot of their work while sitting. Or increasingly at standing desks— or even while pedaling! But one doctor’s study has shown that many of our creative ideas actually come to us when we’re lying down. The study tested subject’s abilities to solve anagrams, those tricky word puzzles whose answer usually “reveals” itself to the observer in an “an ‘A-ha!’ or Eureka moment.” This notion may resonate with you, too, if you’ve ever come up with the solution to a tricky creative problem while in bed.

So, you may want to try lying down for a change in perspective when dealing with a creative block. Or, if you don’t want to be the oddball at the office lying under your desk, I suggest keeping your journal, drawing pad, Wacom tablet, musical instrument, or other preferred creative idea generator by your bed, ready for when creativity strikes!

4. Be a kid again!

I know you have a job, and deadlines, and a hectic be-everywhere-all-at-once schedule, but it truly helps to turn off the logic of day-to-day thinking once in awhile and play! Playing helps free your creative mind from the reason and rigor of right-brain thought. When you play you’re often suspending critical judgement, and you’re able to approach ideas from a new, novel perspective.

In fact, companies like Google and 3M have also embraced the idea of whimsy in the workplace by creating offices that resemble classrooms and game rooms.

So what things can you do to let your inner kid out? Get out your old legos, or sit on the floor (for a childlike perspective) and doodle. Try learning a new instrument. Or a new language! Join an intramural sports team… Whatever it is, remember that the pleasure of the experience is important. So really, do what’s fun!

Continue reading %6 Tips to Get Past a Creative Block%


Source: Sitepoint

How to Use PostCSS with Gulp

PostCSS has been gaining popularity rapidly for some time now. If you have not used it yet or don’t know what PostCSS is, then I suggest you take a look at this introductory PostCSS tutorial, which discusses the basics of PostCSS including how to install and run PostCSS with a quick overview of some plugins.

In this tutorial, I will show you how to use PostCSS with Gulp, the popular automation tool. Since this is not an introductory Gulp tutorial I won’t be covering the basics of Gulp. But for a quick refresher, you can check out this excellent article.

PostCSS website

[author_more]

Setting Up the Project

Before beginning this tutorial, you should have a project folder that you will work in. The folder should have Gulp installed and have two folders inside it with the names “initial” and “final” (or some other name of your choice). The folder called “initial” will have your raw and unprocessed CSS code. The “final” folder will have the processed files, ready to be used.

Before going any further, navigate to your project folder using the terminal and run the following command:

[code language=”bash”]
npm install gulp-postcss –save-dev
[/code]

The --save-dev flag adds the plugin that you are installing to the project.json file as a dependency. This will be helpful in situations where you need to collaborate with others on a project. When other team members run the npm install command on your package, all the plugins will be installed automatically.

At this point your folder structure should be:

  • initial — The folder with your raw CSS files.
    • style.css — Unprocessed stylesheet that we will edit later.
  • final — The folder with processed CSS files.
  • node_modules — The folder with all npm modules.
    • gulp — Created when you installed Gulp.
    • gulp-postcss — Created after running the command above.
  • guplfile.js — Your Gulp file.
  • package.json — Your package.json file.

Installing a Plugin

Let’s install a basic plugin to get started. The plugin we are going to use is short-color. This basically extends the existing color property to also set the background color using a second value. Run the following command to install short-color.

[code language=”bash”]
npm install postcss-short-color –save-dev
[/code]

You could also install both gulp-postcss and postcss-short-color at the same time using:

[code language=”bash”]
npm install gulp-postcss postcss-short-color –save-dev
[/code]

After both plugins have been installed, you need to open up and edit the gulpfile.js file so you can start working with the plugin. We begin by including the following lines to enable both plugins:

[code language=”javascript”]
var gulp = require(‘gulp’);
var postcss = require(‘gulp-postcss’);
var shortColor = require(‘postcss-short-color’);
[/code]

Now, let’s set up a Gulp task to process our raw CSS file and create a production-ready stylesheet. Here is the code to do so:

Continue reading %How to Use PostCSS with Gulp%


Source: Sitepoint

Ruby Interview Questions: LRU Cache and Binary Trees

As we talked about last time around, most interview problems for software engineering positions across the industry concern algorithms and data structures. With a bit of practice, it is possible and reasonably enjoyable to tackle these problems in Ruby. We have covered some of the basics: linked lists and hash tables. This time, we’ll go a bit deeper. We’ll implement an LRU cache (and explain what that is) and also look into binary trees, all in Ruby.

Continue reading %Ruby Interview Questions: LRU Cache and Binary Trees%


Source: Sitepoint

Hey, It’s Your Six-Figure Salary Calling

Hey, it’s your six-figure salary calling

If you’re looking to move to a job that offers stability and a often a six-figure salary, look no further than the industry with one million job openings in 2016, according to a Cisco report. Cyber security is the place to be—and we’ve got a deal that’ll help you get there. Get the Cyber Security Hacker & Penetration Testing Certification Training for $39.

This training helps you dive right into cyber security and penetration testing, with 117 classes and 20+ hours of content covered security code, web-based vulnerabilities, cross-site request forgery, and all the other essentials hiring managers want to make sure you’re familiar with. You’ll get lifetime access to the video lessons, exercises, quizzes, and assessments, and there’s even a discussion forum if you get stuck.

You dream job awaits. Get the Cyber Security Hacker & Penetration Testing Certification Training for $39.

Continue reading %Hey, It’s Your Six-Figure Salary Calling%


Source: Sitepoint