Monday, October 31, 2016

3 Suggestions for Identifying and Catering to Your Blog Audience

3 Suggestions for Identifying and Catering to Your Blog Audience

Sure, a blog can boost your search engine rankings and raise the credibility of your site, but if the content doesn’t reach the right people, you’ll have a very difficult time generating conversions from your hard work. That’s why it’s very important to understand who your blog audience is and what content they like to read.

You might have already defined your target audience and have been catering content to them for some time, but that doesn’t mean you should stop thinking about who your readers are. You can’t continue using the same target market profile you created three years ago and expect to get the same results. You want growth, and that requires tweaking your strategy.

Take some time this month to really evaluate your current target market. Is your blog reaching everyone who can benefit from your words? Does your content solve the problems your readers currently have? If you can’t truthfully give positive answers to each of these questions, then it’s time to refine your audience. As you think about your target readers, here are some things to consider.

by Larry Alton via Digital Information World

Web Design Weekly #257

Headlines

Giving Back to the Design Community

A look into why a small team of Facebook designers build resources for designers. (medium.com)

The difference between CSS variables and preprocessor variables (css-tricks.com)

Sponsor Web Design Weekly and reach over 22,000 passionate designers and developers

Articles

Thoughtful CSS Architecture

Nathan Rambeck provides an introduction to CSS architecture that will help you design a structure for your code so your projects and teams can grow without becoming an unmanageable mess. (seesparkbox.com)

Async functions – making promises friendly

Async functions allow you to write promise-based code as if it were synchronous, but without blocking the main thread. They make your asynchronous code less “clever” and more readable. Jake Archibald explains. (developers.google.com)

How To Brutalize The Web

This article examines the characteristics of Web Brutalism, why it can be effective and what it takes to design a Brutalist website. (medium.com)

CSS Flexbox Explained by Road Tripping Across the Country

Can’t say I have ever read an explanation about a technology quite like this but it seems to work and is entertaining. (freecodecamp.com)

On Style Maintenance

Sarah Drasner looks at two different programming paradigms (functional and object-oriented) and considers how they apply to CSS and the concept of authoring versus maintenance. (css-tricks.com)

Tools / Resources

JavaScript Stack from Scratch

Step-by-step tutorial to build a modern JavaScript stack from scratch. (github.com)

CSS Icon

An icon set made with pure css code that has no dependencies. (cssicon.space)

Pure CSS Content Filter (csswizardry.com)

React Router 3.0 is out (github.com)

New In Chrome 54 (developers.google.com)

Inspiration

Etsy Design

The talented Etsy Design team has started blogging and sharing their experiences. With only a few articles so far I’m sure it will become a great source of inspiration in the not too distant future. (medium.com)

How we deploy at npm (blog.npmjs.org)

Angry Birds in Pure CSS (codepen.io)

Jobs

Senior JavaScript Engineer at Marvel

We’re looking for a Senior JavaScript Developer to join our team building the next generation of design and prototyping software. (marvelapp.com)

Interactive Designer at Radish Lab

We’re looking for a dynamite interactive designer to join our growing team. The ideal candidate is efficient, has an eye for detail and user experience, excellent references, and some noteworthy portfolio examples to share with us. (radishlab.com)

Need to find passionate developers or designers? Why not advertise in the next newsletter

Last but not least…

Skyrocket your Sketch workflow (blog.quadro.me)

The post Web Design Weekly #257 appeared first on Web Design Weekly.


by Jake Bresnehan via Web Design Weekly

2FA in Laravel with Google Authenticator – Get Secure!

vector image with lock and digital symbols, indicating security

There are many ways an attacker can get a user's password. It could happen through social engineering, key logging, or by some other nefarious means. Passwords alone are not enough to protect users from their accounts being compromised, specially if an attacker somehow has their credentials.

To get around this serious shortcoming, the concept of two-factor authentication (2FA) was created. A password, which is one factor, is not enough to authenticate a user. The notion is that a user must use something they have (first factor) and something they know (second factor) to authenticate. A password is something the user knows. For the "something they have" part, many things can be used. Some solutions use biometrics, like a fingerprint, voice pattern recognition, or iris scan. These are relatively expensive solutions. Other second factor authentication methods include one-time passwords (OTP). These are passwords that are generated on a device and good for use once. Typically there are two types of OTPs; counter based, and time based. Using 2FA is better than just username and password alone because it is very difficult for an attacker to procure both the password and the second factor.

In this tutorial, we will use Laravel and Google Authenticator to demonstrate how to implement 2FA in a webapp. Google Authenticator is just one implementation of the Time-Based One-Time Password (TOTP) algorithm, RFC 6238. This industry standard is used in a lot of various 2FA solutions. There are some advantages of Google Authenticator over some other 2FA solutions on the market. After you download the app to your smartphone, you can use it offline. Many other 2FA solutions need to be connected somehow; they send an SMS message, or a push notification, or even call the smartphone with a recorded message. This is not good for users that might be in a location where their phone is cut off from the outside world, like in an office located in the basement of a building.

How the TOTP works is that the server generates a secret key. This secret key is then passed to the user. The secret key is used in combination with the current Unix timestamp to generate a six digit number, using a keyed-hash message authentication code (HMAC) based algorithm. This six digit number is the OTP. It changes every 30 seconds.

Continue reading %2FA in Laravel with Google Authenticator – Get Secure!%


by Christopher Thomas via SitePoint

Ask the UXperts: Dark Patterns and Persuasive Design — with Ben Tollady

Design is often about balancing the needs of the user and the business.  A big part of what we want to do is help people to achieve what they want or need – usually avoiding pain or seeking reward. There are many ways of doing this, some of which walk fairly close to (or cross) the moral and ethical line. We call those ‘dark patterns’.

Persuasive design is generally recognised as a more ethical alternative — it involves using elements of cognitive psychology in order to change user behaviour through techniques like persuasion, social influence and the formation of habits.

Next up in our Slack channel, Ben Tollady of Thirst Studios will share advice around designing ethically and where the boundaries of ethical and responsible design lie.

The Details

Meet Ben Tollady

 

Ben TolladyBen Tollady is an accomplished designer, having worked in the field of user experience and interaction design for over a decade in both the UK and Australia.

His background in industrial design translates directly to his work in interaction design for the web and he firmly believes that successful interaction design revolves around simplicity and relevance.

Ben has taught UX at organisations such as Education Services Australia and currently resides upon the faculty for Tractor Design School as an industry mentor for its UX program.

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 Ben 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.

Here are a few questions to get you thinking:

  1. Can you give us some real life examples of dark patterns or unethical design in action?
  2. What are some of the cognitive biases that we can take advantage of as designers to be more persuasive in our work?
  3. Do you think it is our job as designers to call our other people if we believe they are designing irresponsibly?

How does Ask the UXperts work?

These sessions run for approximately an hour and best of all, they don’t cost a cent. We use a dedicated public Slack channel. That means that there is no audio or video, but a full transcript will be posted up on here in the days following the session.

The post Ask the UXperts: Dark Patterns and Persuasive Design — with Ben Tollady appeared first on UX Mastery.


by Sarah Hawk via UX Mastery

Adventures in Aurelia: Creating a Custom PDF Viewer

Handling PDF files within a web application has always been painful to deal with. If you're lucky, your users only need to download the file. Sometimes, though, your users need more. In the past, I've been lucky, but this time, our users needed our application to display a PDF document so they could save metadata related to each individual page. Previously, one might have accomplished this with an expensive PDF plugin, such as Adobe Reader, running inside the browser. However, with some time and experimentation, I found a better way to integrate PDF viewers in a web application. Today, we'll take a look at how we can simplify PDF handling, using Aurelia and PDF.js.

Overview: The Goal

Our goal, today, is to build a PDF viewer component in Aurelia that allows two-way data flow between the viewer and our application. We have three main requirements.

  1. We want the user to be able to load the document, scroll, and zoom in and out, with decent performance.
  2. We want to be able to two-way-bind viewer properties (such as the current page, and the current zoom level) to properties in our application.
  3. We want this viewer to be a reusable component; we want to be able to drop multiple viewers into our application simultaneously with no conflicts and little effort.

You can find the code for this tutorial on our GitHub repo, as well as a demo of the finished code here.

Introducing PDF.js

PDF.js is a JavaScript library, written by the Mozilla Foundation. It loads PDF documents, parses the file and associated metadata, and renders page output to a DOM node (typically a <canvas> element). The default viewer included with the project powers the embedded PDF viewer in Chrome and Firefox, and can be used as a standalone page or as a resource (embedded within an iframe).

This is, admittedly, pretty cool. The problem here is that the default viewer, while it has a lot of functionality, is designed to work as a standalone web page. This means that while it can be integrated within a web application, it essentially would have to operate inside an iframe sandbox. The default viewer is designed to take configuration input through its query string, but we can't change configuration easily after the initial load, and we can't easily get info and events from the viewer. In order to integrate this with an Aurelia web application — complete with event handling and two-way binding — we need to create an Aurelia custom component.

Note: if you need a refresher on PDF.js, check out our tutorial: Custom PDF Rendering in JavaScript with Mozilla’s PDF.js

The Implementation

To accomplish our goals, we're going to create an Aurelia custom element. However, we're not going to drop the default viewer into our component. Instead, we're going to create our own viewer that hooks into the PDF.js core and viewer libraries, so that we can have maximum control over our bindable properties and our rendering. For our initial proof-of-concept, we'll start with the skeleton Aurelia application.

The boilerplate

As you can see if you follow the link above, the skeleton app has a lot of files in it, many of which we're not going to need. To make life simpler, we have prepared a stripped down version of the skeleton, to which we have added a couple of things:

  • A Gulp task to copy our PDF files to the dist folder (which Aurelia uses for bundling).
  • The PDF.js dependency has been added to package.json.
  • In the root of the app, index.html and index.css have received some initial styling.
  • Empty copies of the files we're going to be working in have been added.
  • The file src/resources/elements/pdf-document.css contains some CSS styling for the custom element.

So let's get the app up and running.

First off, ensure that gulp and jspm are installed globally:

npm install -g gulp jspm

Then clone the skeleton and cd into it.

git clone git@github.com:sitepoint-editors/aurelia-pdfjs.git -b skeleton
cd aurelia-pdfjs

Then install the necessary dependencies:

npm install
jspm install -y

Finally run gulp watch and navigate to http://localhost:9000. If everything worked as planned, you should see a welcome message.

Some more set-up

The next thing to do is to find a couple of PDFs and place them in src/documents. Name them one.pdf and two.pdf. To test our custom component to the max, it would be good if one of the PDFs were really long, for example War and Peace which can be found on the Gutenberg Project.

With the PDFs in place, open up src/app.html and src/app.js (by convention the App component is the root or the Aurelia app) and replace the code that is there with the contents of these two files: src/app.html and src/app.js. We'll not touch on these files in this tutorial, but the code is well commented.

Gulp will detect these changes automatically and you should see the UI of our app render. That's it for the setup. Now it's on with the show ...

Creating an Aurelia custom element

We want to create a drop-in component that can be used in any Aurelia view. Since an Aurelia view is just a fragment of HTML wrapped inside of an HTML5 template tag, an example might look like this:

<template>
  <require from="resources/elements/pdf-document"></require>
  <pdf-document url.bind="document.url"
                page.bind="document.pageNumber"
                lastpage.bind="document.lastpage"
                scale.bind="document.scale">
  </pdf-document>
</template>

The <pdf-document> tag is an example of a custom element. It, and its attributes (like scale and page) aren't native to HTML, but we can create this using Aurelia custom elements. Custom elements are straightforward to create, using the basic building blocks of Aurelia: Views and ViewModels. As such, we'll first scaffold our ViewModel, named pdf-document.js, like so:

// src/resources/elements/pdf-document.js

import {customElement, bindable, bindingMode} from 'aurelia-framework';

@customElement('pdf-document')

@bindable({ name: 'url' })
@bindable({ name: 'page', defaultValue: 1, defaultBindingMode: bindingMode.twoWay })
@bindable({ name: 'scale', defaultValue: 1, defaultBindingMode: bindingMode.twoWay })
@bindable({ name: 'lastpage', defaultValue: 1, defaultBindingMode: bindingMode.twoWay })

export class PdfDocument {
  constructor () {
    // Instantiate our custom element.
  }

  detached () {
    // Aurelia lifecycle method. Clean up when element is removed from the DOM.
  }

  urlChanged () {
    // React to changes to the URL attribute value.
  }

  pageChanged () {
    // React to changes to the page attribute value.
  }

  scaleChanged () {
    // React to changes to the scale attribute value.
  }

  pageHandler () {
    // Change the current page number as we scroll
  }

  renderHandler () {
    // Batch changes to the DOM and keep track of rendered pages
  }
}

The main thing to notice here is the @bindable decorator; by creating bindable properties with the configuration defaultBindingMode: bindingMode.twoWay, and by creating handler methods in our ViewModel (urlChanged, pageChanged, etc) we can monitor and react to changes to the associated attributes that we place on our custom element. This will allow us to control our PDF viewer simply by changing properties on the element.

Then, we'll create the initial view to pair with our ViewModel.

// src/resources/elements/pdf-document.html

<template>
  <require from="./pdf-document.css"></require>

  <div ref="container" class="pdf-container">
    My awesome PDF viewer.
  </div>
</template>

Integrating PDF.js

PDF.js is split into three parts. There's the core library, which handles parsing and interpreting a PDF document; the display library, which builds a usable API on top of the core layer; and finally, the web viewer plugin, which is the prebuilt web page we mentioned before. For our purposes, we'll be using the core library through the display API; we'll be building our own viewer.

Continue reading %Adventures in Aurelia: Creating a Custom PDF Viewer%


by Jedd Ahyoung via SitePoint

PrognRoll – Tiny jQuery Plugin to Show Scroll Progress Bar on Page

PrognRoll is a tiny jQuery plugin that creates scroll progress bar on the page. You can also customize the progress bar.


by via jQuery-Plugins.net RSS Feed

Editorial: Is JavaScript Always the Best Solution?

Lately, there has been a lot of discussion surrounding the role of JavaScript in modern web pages and web apps. It all seems to have kicked off with an amusing (but not entirely untrue) article entitled How it feels to learn JavaScript in 2016 in which the author expresses his concern at the fragmented state of the JavaScript ecosystem and the amount of tooling necessary to start a JavaScript project today.

In the debate that followed, there was an interesting Twitter poll that caught my eye. It asked if in 2016, it's OK to build a website that doesn't work without JavaScript. Of the 4,157 people that replied, 42% (so 1,746 people) declared that it was. Woah!

As editor of SitePoint's JavaScript channel you might expect me to be among those 42%. Well, sorry to disappoint, but I'm afraid I'm not. As my colleague Patrick recently pointed out, it all depends upon the context. Keeping an open mind as to the most accessible and most reliable method of solving a problem, will inevitably lead to the best solution. Here's a small example to illustrate the point:

Continue reading %Editorial: Is JavaScript Always the Best Solution?%


by James Hibbard via SitePoint