Thursday, June 30, 2016

How Laughing Chewbacca Mask Lady touched hearts worldwide and brought social media power back into the hands of those who evoke emotion

What Brands and Social Media Marketer Can Learn from the Chewbacca Mom Video

Power in the social media world is held by those who can hook mass attention and change individual’s PERSONAL preference. That’s right, a messiah of followers can preach thoughts and ideas that their followers talk about. That’s what a brand wants: to be talked about. Delving into deeper strategic social media, these brands sometimes want a specific targeted audience of potential consumers or mass followers depending on their message, product or service they are selling.

Social Media is not just a platform to showcase your selfies. Social Media is a marketing platform where businesses can talk to consumers, businesses can talk to businesses, and consumers can talk to consumers.

The end goal is the SALE. Selling your brand image, selling your lifestyle, selling your product, selling your knowledge, selling your service. Whatever it is you want to sell at the moment, big corporate companies and small niche brands are trying to figure out the best way to market themselves through the ever growing population on Instagram, Twitter, Facebook, Pinterest, Snapchat, LinkedIn, Periscope.

Whether it is authentic or fabricated, the effect of emotions on the human mind reflects the number of hits on viral videos and ad campaigns. Love, Terror, Awe, Shock, Amazement, Laughter, Disgust, Anger. What do you normally click on when you scroll through friends Facebook pages….Baby Animal videos, stunt videos, funny videos, scary videos?

It’s interesting that the more and more we become physically detached from people, sitting in front of our screens (as I am doing right now), or using the power of touch to type each other Whatsapp messages, Facebook messages and emails, the fact is the core need for emotion remains. Through all this technology, we remain human. Human behavioural patterns, traditions and values may change but core emotions stand integral to most humans’ functionality and basic instincts.

So let’s take a look at this video below. A woman buys a Chewbacca masks, puts it on and laughs at herself. She’s not only in awe of herself, she thinks it’s amazing, fun, and the sincerity of her laughter makes us the viewer feel that it has touched her inner child. How does she do that? Who taught her how to light the video correctly, laugh like that, did she have lines? Of course not. She was being human and that human reaction captured the hearts (and video and the 6,283,233 video clicks). She captured more than four million people in the world in a four minute video. This capacity to touch humans emotionally got her invited to huge entertainment platforms like the James Corden show and Good Morning America.




There is hardly anyone in the United State who hasn’t seen or heard about the “Chewbacca Mom”, such a simple video that has taken the Internet by storm and has instantly made her what brands and marketers term as “Influencer”. It’s impossible to launch content without an influencer on marketing strategy these days.

Big brands have immediately tied themselves to this viral sensation. So, the question is what brands and marketers can learn from this video? And the million-dollar question on “How can brands or marketers increase the discernibility of their content?

Here are the lessons that brands and marketers learn from this “Chewbacca Mom” video.

1. Be genuine and truthful. Don’t fake realness

The power of genuine and truthful in influencer marketing in action creates an emotional connection with your audience. Speak from your heart; spend more time creating meaningful sincere connections with influencers or ambassadors and people. Unintentional as it was from the video, the moment speaks the truth. Share your brand story within a truthful way, as consumers don’t want brands to tell them what to buy but people whom they trust. It is a delicate line to walk, as you don’t want to be come across as insincere and fake.

2. Positive message

Be positive and try to build your campaign on honest emotions. Subsequently, it will help foster similar grasp of your brand. The video proven the tremendous power of social media and people like to see heartwarming messages and sincerity from others. Some campaigns are heartbreaking and others are hilarious. Even when it’s heartbreaking, the message behind the campaign is with positive emotions resonate. Brands and Marketers can draw an important lesson from these examples of viral media hits.

3. Keep it simple

One aspect of this viral video is such a success, it’s because it draws people’s attention and their affection. It’s simple and a joyous moment that captured the heart of millions. Hence, the story does not have to be complicated; the key to achieving success is often built emotional connection with your audience with simple positive images.

There are only so many times you can put on a Chewbacca mask and laugh for the cameras and cashing on viral stardom. You need to create a brand of your own right, tell your story, built a personal brand and most importantly, brands and marketers need to have fun when conveying their story on social media.

Want to capture your audience using social media? Find your own Chewbacca mask.

For more information about digital marketing, please free to contact Jessica Patterson.

JPR MEDIA - PR Agency Central London specialising in London Fashion PR and Food Public Relations.

by Guest Author via Digital Information World

“I co-created UX advice column UX Agony Aunt” : Ask Me Anything

In the words of a true UX Agony Aunt – “sometimes we all need an extra bit of help” – and Ashlea McKay is just the person to put up her hand in support. To add further quotes into the mix, our friends at Optimal Workshop describe the aforementioned  UX Agony Aunt as “an opinionated, charismatic, and quick-firing advice columnist who keeps on hand a bag of UX tips, tools, and tricks to help you get unstuck”.

We’ve been fans of Ash’s ever since she crossed the threshold of our community registration page exactly 2 years ago. Her positive yet pragmatic approach to problems, her strong design pedigree and her willingness to go the extra mile to help others makes her the perfect candidate for an Ask me Anything session.

The Details

Meet Ashlea McKay

Ashlea Mckay

Ashlea McKay is a UX designer, researcher and writer with a background in industrial design. She loves conducting user research because she learns something new every day and enjoys understanding what makes users tick. Ashlea is also passionate about mentoring and is heavily involved in the UX community at large.

She regularly writes articles for well-known UX publications and is the co-founder and voice behind UX advice column, UX Agony Aunt. In her spare time, Ashlea enjoys colouring in, collecting shoes and building LEGO. 

 

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 Heather 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 does Ask Me Anything work?

These sessions run for approximately an hour 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 a full transcript will be posted up on here in the days following the session. 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 “I co-created UX advice column UX Agony Aunt” : Ask Me Anything appeared first on UX Mastery.


by Sarah Hawk via UX Mastery

Integration and Comparison for ES6

If you’re still writing JavaScript using ES5 (also known as ECMAScript 5) and desire to author in ES6 (ES2015) fear not. We’ll look over some logical ways to start using this new syntactical sugar in your own work starting immediately. We’ll discuss and examine approaches to integrate features such as let and const plus compare var versus let and finally understand when to use the spread operator. So without further ado let’s get started.


A Brief Review

For those that have never written in ES6 please keep reading otherwise feel free to skip over this portion and begin with the next section covering terminology. For those sticking around it’s time for a quick review on how to author ECMAScript 2015.

In order to author in ES6 as of this writing you’ll need a tool known to developers as Babel; a JavaScript compiler. This is just a fancy tool that consumes the originally authored code and rewrites it into code the browser understands. You can read the other part of this series on this very website where I share helpful advice on Preparing for ES6.


Terminology

It wouldn’t be prudent if we didn’t go over some terminology before we begin so let’s learn a few definitions to help us better understand.

let

In ES2015 let is the new var and what’s known as a block-scoped binding construct. The keyword let as well as const are also both part of the “Declarations and the Variable Statement” section of the specification

The let statement declares a local block scope variable, optionally initializing it to a value. It allows for declaring variables that are limited in scope to the block, statement, or expression used within. This is unlike the var keyword that defines a variable globally or locally to an entire function regardless of block scope. It can also signal that the variable may be reassigned in cases such as a loop counter, or a value switch in an algorithm.

const

The keyword const states the identifier can’t be reassigned unlike how let and var allow for. This keyword is single-assignment whereas let can be defined multiple times. Those familiar authoring in PHP will already understand this type of identifier. A const object can have properties mutated and signals that the identifier won’t be reassigned. Static restrictions for const prevent use before assignment.

The spread operator (…)

The spread operator is a way to pass multiple arguments instead of single values as we’ve typically been used to. This allows an expression to be expanded in places where multiple arguments for functions or multiple elements (for array literals) or multiple variables (for destructuring assignment) are expected (source: MDN).


Examples

Now that you’re up to speed it’s time to use ES2015, but how do we know when using let vs var is sensible and when it’s appropriate? How should we decide when to use const or the spread operator?

How to use let

Use let when you need to reassign a variable or protect the use of a value in a blocked scope. A use case for let tends to be for loops or mathematical algorithms. The keyword let also signals that the variable will be used only in the block it’s defined in; no hoisting. If you need to reassign let make sure not to use the let keyword and use the assignment already given. For example…

Incorrect


let window_width = window.innerWidth;
let window_width = 'string';

Correct


let window_width = window.innerWidth;
window_width = 'string';

The keyword let can also be used within a functions block scope.


function windowSize() {
  let window_width = window.innerWidth;
}

windowSize();

window.onresize = function() {
  windowSize();
};

console.log(window_width) // reports undefined

In the example we define window_width only within the scope it’s used in order to determine window width on the window resize event. Keep in mind window_width is never accessible outside the windowSize function.

How to use const

Constants are block-scoped, much like variables defined using the let keyword. The value of a constant cannot change through re-assignment, and it can’t be redeclared. Think of “constant” as meaning a “one-time assignment.”


const window_width = window.innerWidth;

If we try to reassign the identifier we’ll get a warning in the console:


const window_width = window.screen.width;
window_width = 'string'; // Uncaught TypeError: Assignment to constant variable.

You’ll likely use a constant when a value is unlikely to change throughout your application in such cases like mathematical values.


const pi = Math.PI;

Here we’ve created a read-only reference meaning we can only read the value not reassign it as previously stated.

We can get around the immutable rule by defining our values within an object literal. Global configurations are a great use case for const when used in the following fashion:


const config = {
    url: window.location.origin,
    width: window.screen.width,
    path: window.location.pathname
};

// The object's properties can be mutated so we can reassign values.
config.url = "https://codepen.io";

console.log(config)

Object {url: "https://codepen.io", width: 1440, path: "/index.html"} // url key reports reassigned value

Here we’ve created a read-only reference meaning we can only read the value (config) not reassign it as previously stated. Essentially the config identifier is the constant being defined and cannot be overridden, but we still have the ability to mutate properties contained within as shown.

How to use (…) : the spread operator

The spread operator adds more capability to the once dull context of accepted arguments we’ve previously encountered in ES5. Spread operators can accept an array of arguments; for example:


function spreadReporter(...values) {
  let object = [...values];
  return object[0].length;
}

var items = ['one', 'two', 'three'];

console.log(spreadReporter(items)); // reports the numerical value 3

These arguments consisting of multiple values can be anything you desire. It can be an identifier with values using an object literal or an array of values.

You could use the spread operator in a e-commerce situation based on events such as adding items to a category or shopping cart.


let dairy = [];
let store = {
  add: function(category, ...items) {
    category.push(...items);
  }
};

store.add(dairy, 'milk', 'sour cream');
store.add(dairy, 'ice cream', 'yogurt', 'cheese');
console.log(dairy);

// outputs ["milk", "sour cream", "ice cream", "yogurt", "cheese"]

Events could also be a great use case to determine the particular type taking place whether it be a click, touch or some other type of gesture variant. I’ll leave that up to you all as a challenge so feel free to post a solution in the comments below.


Conclusion

As with everything in development there can be many ways to skin a cat. These examples provided for discussion are merely suggestions and demos showcasing the power of the new features in ES6. If you have any other samples, suggestions that outline the features mentioned above please let us know in the comments. Happy coding everyone and enjoy your new ES6 knowledge. Go forth, share, discuss and be awesome.

References

The post Integration and Comparison for ES6 appeared first on Web Design Weekly.


by Dennis Gaebel via Web Design Weekly

JavaScript Design Patterns: The Singleton

Among languages used in widespread production, JavaScript is by far the most quickly evolving, looking less like its earliest iterations and more like Python with every new spec put forth by ECMA International. While the changes have their fair share of detractors, the new JavaScript does succeed in making code easier to read and reason about, easier to write in a way that adheres to software engineering best practices (particularly the concepts of modularity and SOLID principles), and easier to assemble into canonical software design patterns. Let's dig into that last point by examining how the best way to implement a singleton in JavaScript has evolved with the rise of ES6.

What Is ES6

ES6 (aka ES2015) is the latest specification of the JavaScript language, and the first major update to the language since ES5 was standardized in 2009. Browser support for ES6 is still incomplete, however, ES6 code can easily be transpiled into ES5 code using a tool such as Babel. ES6 gives JavaScript a ton of new features, including a superior syntax for classes, and new keywords for variable declarations. You can learn more about it by perusing Sitepoint articles on the subject.

What Is a Singleton

alt text

In case you're unfamiliar with the singleton pattern, it is, at its core, a design pattern that restricts the instantiation of a class to one object. Usually, the goal is to manage global application state. Some examples I have seen or written myself in real software development life include using a singleton as the source of config settings for a web app, on the client-side for anything initiated with an API key (you usually don't want to risk sending multiple analytics tracking calls, for example), and to store data in memory in a client-side web application (e.g. stores in Flux).

A singleton should be immutable by consuming code, and there should be no danger of instantiating more than one of them.

Note: there are scenarios when singletons might be bad, and arguments that they are, in fact, always bad. For that discussion, you can check out this helpful article on the subject.

The Old Way of Creating a Singleton in JavaScript

The old way of writing a singleton in JavaScript involves leveraging closures and immediately-invoked function expressions . Here is how we might write a (very simple) store for a hypothetical Flux implementation the old way:

Continue reading %JavaScript Design Patterns: The Singleton%


by Samier Saeed via SitePoint

This week's JavaScript news, issue 290

This week's JavaScript news
Read this e-mail on the Web
JavaScript Weekly
Issue 290 — June 30, 2016
Redux is an app state container, commonly (but not always) used alongside React. Alex Bachuk explains what it offers and how to use it in your projects.
Alex Bachuk

D3 is huge in the Web data-vis world and 4.0 is a significant update. D3 is now modular, composed of small libraries you can also use independently.

A well presented, flexible, and lightweight JavaScript animation library with 10 CodePen examples to show it off.
Julian Garnier

Need to crank out features faster? Corgibytes cleans up technical debt that gets in the way of rapid release cycles. One client doubled their productivity with zero new hires. Don’t let tech debt slow you down. Call the Corgis.
Corgibytes   Sponsored
Corgibytes

Feeling adventurous? Follow this walkthrough to building something very simple using WebAssembly, a new under-development bytecode for writing and running browser agnostic code for the Web.
Nick Larsen

A look at how to use the Angular 2 CLI to rapidly scaffold, develop, test and deploy an Angular 2 webapp.
Jeremy Likness

A brief entry-level introduction to debugging Node apps using the debug module, the built-in debugger and Chrome DevTools.
Gergely Nemeth

A layer on top of React Native providing a basic set of components for mobile app development.
GeekyAnts

Jobs

  • Software Development Engineer at AmazonFrontend web expert? Come to Amazon and improve the Search experience for hundreds of millions of customers. Amazon, Search Customer Experience
  • Senior Node Engineer at TES USA (San Francisco, CA or remote)Make a difference in teachers’ lives with a platform that allows them to find, share and sell resources worldwide. Join TES USA’s small, global team to embrace challenges, be part of a lean process, and impact education. TES USA
  • Job Offers. No resume necessary.Create your Hired profile to get top companies to start applying to hire you. Get offers from $75,000 - $250,000 on the platform in 1 week. Hired.com

In brief

Looking for more on Node? Read this week's Node Weekly too :-)

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

Anime – Javascript Animation Engine

Anime is a flexible yet lightweight JavaScript animation library. It works with CSS, Individual Transforms, SVG, DOM attributes and JS Objects.


by via jQuery-Plugins.net RSS Feed

7 Workflows Entrepreneurs Should Automate with Zapier

Zapier integrations

Zapier helps you to build bridges between your favorite apps and services, allowing teams and individuals to automate more of their workflows. Every one-to-one connection made between two apps is called a “Zap” and they’re designed to make you work smarter, not harder. With over 500 apps to choose from, it’s almost impossible to choose only a handful of Zaps.

Let’s take a look at seven Zaps that can make your life easier.

1. Create Mailchimp Subscribers from Typeform or PayPal

PayPal to Mailchimp workflow

Mailchimp is an email marketing service that lets you design emails, maintain a list of subscribers, email those subscribers, and then monitor the results of that campaign. But what happens when a customer isn’t a subscriber?

With this PayPal → Mailchimp workflow, Zapier monitors all sales made via PayPal and enters the customer’s email address into your email campaign in Mailchimp, effectively helping you to retain each new customer.

Typeform to Mailchimp workflow

You can do the same thing with Typeform. Let’s say that you’re using Typeform to survey your website’s visitors about the user experience that they received. The Typeform → Mailchimp Zap will retain the user’s email address in Mailchimp so you can tell that user about the new version of your website, derived from the feedback that they originally offered.

2. Create Trello Cards from Gmail Emails and Update in Slack

Gmail to Trello workflow

With the influx of morning emails it can be near-impossible to convert each one into an actionable task in a sensible amount of time. The Gmail → Trello Zap can fix that, helping you to reach “inbox zero” much faster. In short, Zapier scans your Gmail for emails with a certain label and creates a formatted Trello card from them.

Trello to Slack workflow

You can take this workflow a step further by automatically updating teammates about this new Trello card in Slack, so that the team can be notified about the task and complete it. All that from a simple label!

3. Get Notified of New Dropbox Files in Slack

Dropbox to Slack workflow

I can think of a number of reasons why this Dropbox → Slack setup is epic. Firstly, Dropbox really drains your battery because it constantly checks for file updates, so having notifications in Slack can quite literally save you hours of battery life. But don’t worry, not only can you be notified in Slack of new Dropbox files, but Slack can import the file, making it searchable and downloadable from within Slack. Dropbox doesn’t even need to be switched on!

Continue reading %7 Workflows Entrepreneurs Should Automate with Zapier%


by Daniel Schwarz via SitePoint

Corvus

Corvus

'Corvus' is a One Page HTML template suited for an online portfolio. Features include intro About section, portfolio with category filter and pop up image views, testimonials, and ends with a smart footer with contact form. It's worth mentioning the $29 pricing is actually a once off cost that allows access to all 23 of TemplateGarden's templates for 3 months - quite a deal!

by Rob Hope via One Page Love

TextPad

opl-small

'TextPad' is an ultra minimal One Page writing app built by Paulo Nunes.

by Rob Hope via One Page Love

Review: Is the New and Improved Google Fonts Better?

It's been six years since Google first unveiled one of the world's largest, free web font services. Their easy-to-use interface was instrumental in bringing what was often considered a brittle technology to the masses. Since 2010 the service has steadily grown in both library diversity and scale.

Recently the service received a full make-over, bringing a more streamlined way for you to preview fonts and get up and running in no time.

But is it actually better? Let's take a look.

[caption id="attachment_134438" align="aligncenter" width="1400"] <em>Latest website on the left with the legacy site on the right</em> Latest website on the left with the legacy site on the right[/caption]

A Polished and Updated Look

I certainly believe that the overall look and feel of Google Fonts has improved. One of the first big things you will notice will be that the whole site uses Material Design. Gone are the thick borders, low-resolution graphics, and bright blue buttons. These are replaced by subtle animations and interactions helping you to focus on narrowing down your fonts.

Google fonts applying Material design

The updates to the visuals are pretty impressive, but what's also good is that the site is now fully mobile responsive. The previous version of the site didn't handle smaller resolutions or resizing gracefully, leading to lots of random UI bugs that made the site look weird / remove functionality.

Better Responsiveness

On the right, as the screen gets smaller you can see we lose the 'Preview Text' input field making it impossible to get a live preview of our text. Also, as the screen gets narrower the action buttons start to cover up both the font name and the author, eventually vanishing entirely.

The legacy site has been around for a long time and provided a heap of functionality so we can generally cut them some slack. It's refreshing to see that the new site looks great and works across all device types.

Dynamic Theme Chooser

One area of concern for designers was choosing a font which works well across different foreground / background colors. Sometimes a font might look great when it's black on a white but then could be next to impossible to read when a bright color is used.

Google added a custom color chooser right at the top of the site. When clicked it provides a quick swatch of colors to let you preview how your fonts will look. You can use this to see how your fonts will pair up when used on dark / light backgrounds with dark / light text.

Dynamic Theme Chooser

Even though you can't precisely specify the colors you want, this is a nifty tool that everyone should use when picking out their fonts.

Featured Fonts are a brand new introduction to the updated Google Fonts website. Accessible right from the top menu, these featured fonts are collections of fonts that Google wants to highlight. These collections are created by either Google themselves or by outside agencies to showcase a particular design style or philosophy.

Showcasing Featured Fonts

Currently, there are only a few sets of featured fonts, however, it would make sense if this range will increase in time as more fonts are added and the previous Google Fonts website is discontinued.

A Supercharged Inline Font Selector

The main experience with Google Fonts is how to preview and select your fonts, some would argue this is the most important part of the website.

Previously, when viewing your fonts you would see something similar to the diagram below – a simple preview of text with a series of action buttons. Your view might look different depending on how you've filtered your search but generally, it's a simple square box with a series of actions a big blue add button.

Continue reading %Review: Is the New and Improved Google Fonts Better?%


by Simon Codrington via SitePoint

Apollo 11

Apollo 11

Multi-scrolling One Pager taking us through the launch of Apollo 11 (with an interactive twist).

by Rob Hope via One Page Love

WordPress Theme Automation With Gulp

As website code becomes more complicated and repetitive steps that just beg for optimization become ever more commonplace, there should be a better and more efficient development process out there.

In this tutorial, I’ll introduce Gulp, and how to integrate it with WordPress theming to automate and enhance the theme development process by putting together an automated workflow.

Why You Need to Automate Your Development Workflow

Workflow optimization can be incredibly beneficial and rewarding for your development process. Here are some of the reasons to give it a go:

  • It removes all those repetitive and boring tasks, replacing them with custom tools.
  • It saves a lot of time for doing other important core development work.
  • It helps optimizes your website for performance by minifying and optimizing all assets.

What You'll Need

  • WordPress installed on your development machine.
  • Node.js and npm installed.
  • Command line basic knowledge.

Introduction to Gulp

Gulp is a JavaScript task runner that will help automate time-consuming tasks like CSS compressing, Sass compiling, image optimization and browser reloading.

Gulp gives you the tools to do various actions automatically after certain trigger events. For example, consider the following scenarios:

  • Every time you save a Sass file, Gulp will compile Sass and output a minified CSS file.
  • When you add a new image to a folder, Gulp will optimize this image and move it to a new dedicated folder.
  • When you save a PHP or a Sass file, Gulp will automatically reload the browser.

Gulp Setup

First, you need to install Gulp globally in your system. Later, I will show you how to install it as a package inside your theme.

Assuming Node.js is installed, open the command line tool, then install Gulp using npm via:

[code language="bash"]
npm install gulp -g
[/code]

Now, run gulp -v (Gulp's version command) to test that Gulp is installed correctly. You should get output similar to:

[code language="bash"]
➜ ~ gulp -v
[09:33:59] CLI version 3.9.1
[/code]

Theme Setup

In this tutorial, I will use Underscores as the base theme. To download it, navigate to underscores.me, generate a new theme and give it a name like "gulp-wordpress", download it to the WordPress themes directory, then activate it from the dashboard.

From the command line, navigate to the gulp-wordpress directory where you have added the theme, for example in my case:

[code language="bash"]
cd ~/www/wordpress/wp-content/themes/gulp-wordpress
[/code]

Next, run the npm init command and follow a few simple steps to create a package.json file which will include some information about the theme and the packages that will be installed later.

After finishing up the steps, you will have a starting file that looks similar to this:

{
  "name": "gulp-wordpress",
  "version": "1.0.0",
  "description": "WordPress Theme Development Automation with Gulp",
  "author": "Name"
}

Next, install Gulp as a development dependency:

[code language="bash"]
npm install gulp --save-dev
[/code]

A node_modules directory is now created containing Gulp package source files, and your package.json file has been updated to include Gulp as a development dependency.

{
  "name": "gulp-wordpress",
  "version": "1.0.0",
  "description": "WordPress Theme Development Automation with Gulp",
  "author": "Author Name",
  "devDependencies": {
    "gulp": "^3.9.1"
  }
}

Some Gulp tasks like gulp-autoprefixer require ES6-style Promises support so that you can install the es6-promise polyfill, and then require it at the top of the gulpfile.js as we will do next.

[code language="bash"]
npm install es6-promise --save-dev
[/code]

The last step to configure Gulp is to create an empty gulpfile.js configuration file, which will be used to define Gulp tasks such as JavaScript and Sass.

The gulpfile.js starter file will look like this:

require('es6-promise').polyfill();

var gulp = require('gulp');

// default task
gulp.task('default');

What we have done above is:

  • Required the es6-promise polyfill on top of the file, then we have imported in gulp.
  • Created a default task.

To make sure that Gulp is running and everything is done perfectly, run gulp in the command line to execute the default task created in the gulpfile.js file. The output should be similar to:

[code language="bash"]
[09:48:23] Using gulpfile ~/www/wordpress/wp-content/themes/gulp-wordpress/gulpfile.js
[16:33:13] Starting 'default'...
[16:33:13] Finished 'default' after 58 μs
[/code]

Speeding up Development with Gulp Tasks

At this point, the theme is ready for new tasks, and it's time to go through some common tasks that you can use to speed up your theme development.

Working with CSS (Sass)

If you are using Sass to write CSS, two main things needed to be automated, the first one is to compile Sass to CSS, the second is to use autoprefixer to add vendor prefixes to your CSS. Also note that I'm using Sass as an example, if you prefer another option like Less for example, you can find a Gulp plugin for it too.

First, install gulp-sass and gulp-autoprefixer.

[code language="bash"]
npm install gulp-sass gulp-autoprefixer --save-dev
[/code]

The next step is to create a Sass directory with a basic structure.

├── sass
│   └── style.scss

The style.scss file is the main starting point, you are free to create your Sass architecture and import other components, modules, functions inside it based on your preference.

Continue reading %WordPress Theme Automation With Gulp%


by Ahmad Ajmi via SitePoint

How to Use Jscrambler 4 to Protect Your Application's Integrity

Quick Tip: How to Read Extremely Large Text Files Using Python

5 Free Ways to Build Your Personal Brand on LinkedIn

ar-linkedin-personal-brand-600

Do you want to build your visibility on LinkedIn? Wondering which LinkedIn features can help? LinkedIn can help you build a professional presence that showcases your work to the people you most want to connect with. In this article, you’ll discover five free ways to help you build a personal brand on LinkedIn. #1: Optimize [...]

This post 5 Free Ways to Build Your Personal Brand on LinkedIn first appeared on .
- Your Guide to the Social Media Jungle


by Alexandra Rynne via

Item Reveal Animations with SVG

An experiment where grid items get revealed and unrevealed with animated, morphing SVG paths using anime.js.

The post Item Reveal Animations with SVG appeared first on jQuery Rain.


by Admin via jQuery Rain

Independence Day: My Street

Using cutting edge WebGL, combined with Google Street View API and some potentially alien interactive magic, we brought the excitement of a full scale alien invasion directly to our user’s doorsteps - literally.
by via Awwwards - Sites of the day

Wednesday, June 29, 2016

Responsive YouTube Player with Playlist : jQuery Plugin

Responsive YouTube Player with Playlist.Since Youtube API V3.0, it’s mandatory to create a YT API key in order to get the playlists contents programatically… there aren’t other ways to do this. The old XML Feed used in the V.01 of RYPP has been removed by Youtube and no longer exists.

The post Responsive YouTube Player with Playlist : jQuery Plugin appeared first on jQuery Rain.


by Admin via jQuery Rain

Developing a Content Marketing Strategy – How to Turn Engagement into ROI [INFOGRAPHIC]

Developing a Content Marketing Strategy – How to Turn Engagement into ROI

In the 21st century, we are bombarded with advertisements from all sides. This has made people go numb to the ads they see, the “recommendations” they hear and even the “studies” they read. Whenever they recognize sponsored content, people are bound to turn their heads, which means that most traditional digital marketing efforts often go to waste. This is where content marketing steps up big time. By providing your target audience with something they want to see and in a form that keeps them interested, you are managing to turn engagement into a serious ROI. Because of this, here are few tips and tricks on how to develop a solid content marketing strategy.

by Guest Author via Digital Information World

Elixir’s Ecto Querying DSL: Beyond the Basics

This article builds on the fundamentals of Ecto that I covered in Understanding Elixir’s Ecto Querying DSL: The Basics. I'll now explore Ecto's more advanced features, including query composition, joins and associations, SQL fragment injection, explicit casting, and dynamic field access.

Once again, a basic knowledge of Elixir is assumed, as well as the basics of Ecto, which I covered in An Introduction to Elixir’s Ecto Library.

Query Composition

Separate queries in Ecto can be combined together, allowing for reusable queries to be created.

For example, let's see how we can create three separate queries and combine them together to achieve DRYer and more reusable code:

SELECT id, username FROM users;
SELECT id, username FROM users WHERE username LIKE "%tp%";
SELECT id, username FROM users WHERE username LIKE "%tp%" LIMIT 10, 0;

offset = 0
username = "%tp%"

# Keywords query syntax
get_users_overview = from u in Ectoing.User,
  select: [u.id, u.username]

search_by_username = from u in get_users_overview,
  where: like(u.username, ^username)

paginate_query = from search_by_username,
  limit: 10,
  offset: ^offset

# Macro syntax
get_users_overview = (Ectoing.User
|> select([u], [u.id, u.username]))

search_by_username = (get_users_overview
|> where([u], like(u.username, ^username)))

paginate_query = (search_by_username
|> limit(10)
|> offset(^offset))

Ectoing.Repo.all paginate_query

The SQL version is quite repetitive, but the Ecto version on the other hand is quite DRY. The first query (get_users_overview) is just a generic query to retrieve basic user information. The second query (search_by_username) builds off the first by filtering usernames according to some username we are searching for. The third query (paginate_query) builds off of the second, where it limits the results and fetches them from a particular offset (to provide the basis for pagination).

It's not hard to imagine that all of the above three queries could be used together to provide search results for when a particular user is searched for. Each may also be used in conjunction with other queries to perform other application needs too, all without unnecessarily repeating parts of the query throughout the codebase.

Continue reading %Elixir’s Ecto Querying DSL: Beyond the Basics%


by Thomas Punt via SitePoint

Introduction to Developing jQuery Plugins

You've probably worked on interactive components before, like sliders, galleries or interactive forms. While you might be creating these on a site-by-site basis, one great time saver is to build your functionality as a jQuery plugin to speed up your development.

jQuery plugins let you define your functionality once and then drop it into your projects as needed, getting you up and running faster.

We're going to look at how to build your own jQuery plugin. We'll look at all the areas you need to know to get you up and running building plugins in no time.

We'll be using a plugin I've created called fancytoggle to showcase the different parts of a plugin. It's a simple plugin for toggling the visibility of nested elements, such as list items, to create accordion-style widgets for things like FAQs. The overall idea is about the concepts of plugins, but this example should help you see how it all works in practice.

See the Pen FancyToggle by SitePoint (@SitePoint) on CodePen.

A Plugin Approach: The Advantages

The core concept here is to create something extensible that you can add to your projects to give you quick functionality. jQuery's plugin functionality simplifies the process of building reusable code.

One of the strengths of these plugins is that they let the developer define several options that can be used to customize the functionality. You might create several options that change the way your plugin operates entirely, or you might just define a few to give the user a bit more control for styling or layout. With plugins, this choice will be up to you.

Developing jQuery Plugins

Let's run through the steps needed to register a new jQuery plugin. We'll use our example plugin, fancyToggle, so you can see how it's all put together.

Creating our function with $.fn

jQuery plugins work by registering a function with the name you want to call to trigger your plugin (for example, you call jQuery's inbuilt .width() or .height() functions when you want the width / height returned)

We attach our function to jQuery's $.fn object to make it available to the global $ object. This registers our function and lets it be called on objects or selections.

//registering our function
$.fn.fancytoggle = function(){
  // ...
};

That's all there is to it! You now have a new method you can call from jQuery's $ object. Right now, it won't do anything, but you can call this method wherever you like, for example on a selector:

//Call fancytoggle on this element
$('.my-element').fancytoggle(); 

You can register as many functions as you want with $.fn, however its good practice to avoid registering more than one function unless the plugin does distinctly different tasks.

Multiple collections and looping

An important thing to understand is that when your plugin is called it might be applying itself to either a single element or to several. For example with our plugin, if we are applying fancytoggle() to several different items we will have a collection to process within our function.

To process each element we just need to loop through the collection using jQuery's $.each function:

Continue reading %Introduction to Developing jQuery Plugins%


by Simon Codrington via SitePoint

Introducing the CSS text-align-last Property

Sometimes tiny details that mostly go unnoticed can make or break the user experience. This can include subtle text shadows applied to a headline or proper spacing between different elements on a web page.

The text-align-last property is useful in this respect. It specifies how either the last line of a block or the line right before a forced line break will be aligned. This is important because the last line in a paragraph generally doesn't have enough text to fill up the entire space. You may or may not notice the changes but it will improve the overall look of your website.

This tutorial will cover all the aspects of the text-align-last property including acceptable values, support and browser specific behavior.

Usage and Possible Values

It is pretty simple to use text-align-last in your projects. Here is a basic snippet to align the last line of text to the right:

.intro-graph {
  text-align: justify; // Required for IE and Edge 
  text-align-last: right;
}

This property has seven possible values. You are probably familiar with the usual left, right and center values. They align the text in the last line to the left, right and center of the container.
The following demo shows the differences between these three values:

See the Pen text-align-last — Example 1 by SitePoint (@SitePoint) on CodePen.

The fourth value, justify, aligns the last line in such a way that the text aligns its left and right edges to the left and right edges of the container. This is achieved by inserting an appropriate amount of space between words when necessary. Depending on the amount of text, you can use this property to completely fill the space on the last line without too much gap between words. The text in the second paragraph is also justified but since the last line only contains one word it is aligned to the left.

See the Pen text-align-last — Example 2 by SitePoint (@SitePoint) on CodePen.

While left aligning the last line of text works for languages that are read from Left to Right (LTR), it will be wrong to do so with RTL languages. In such cases, assigning the values left or right can cause issues when you don't know the language to be used beforehand.

Fortunately, you can use the keyword start to align the text to the starting position of a line based on the direction of text. This implies that setting text-align-last to start will left align the text of LTR languages and right align the text of RTL languages. Similarly, you can use the value end to align the text to the ending position of a line based on the direction of text. This will right align the text of LTR languages and left align the text of RTL languages.

See the Pen text-align-last — Example 3 by SitePoint (@SitePoint) on CodePen.

The default value for this property is auto. In this case, the text inside the last line is aligned using the value of the text-align property unless text-align is set to justify. When set to justified, the text is justified only if the value of the text-justify property is set to distribute. Otherwise, the text is start aligned.

Continue reading %Introducing the CSS text-align-last Property%


by Nitish Kumar via SitePoint

Disco with Design Patterns: A Fresh Look at Dependency Injection

Dependency Injection is all about code reusability. It's a design pattern aiming to make high-level code reusable, by separating the object creation / configuration from usage.

Illustration of people's outlines dancing in a disco

Consider the following code:

<?php

class Test {

    protected $dbh;

    public function __construct(\PDO $dbh)
    {
        $this->dbh = $dbh;
    }

}

$dbh  = new PDO('mysql:host=localhost;dbname=test', 'username', 'password');
$test = new Test($dbh) 

As you can see, instead of creating the PDO object inside the class, we create it outside of the class and pass it in as a dependency - via the constructor method. This way, we can use the driver of our choice, instead of having to to use the driver defined inside the class.

Our very own Alejandro Gervasio has explained the DI concept fantastically, and Fabien Potencier also covered it in a series.

There's one drawback to this pattern, though: when the number of dependencies grows, many objects need to be created/configured before being passed into the dependent objects. We can end up with a pile of boilerplate code, and a long queue of parameters in our constructor methods. Enter Dependency Injection containers!

A Dependency Injection container - or simply a DI container - is an object which knows exactly how to create a service and handle its dependencies.

In this article, we'll demonstrate the concept further with a newcomer in this field: Disco.

For more information on dependency injection containers, see our other posts on the topic here.

As frameworks are great examples of deploying DI containers, we will finish the article by creating a basic HTTP-based framework with the help of Disco and some Symfony Components.

Installation

To install Disco, we use Composer as usual:

composer require bitexpert/disco

To test the code, we'll use PHP's built-in web server:

php -S localhost:8000 -t web

As a result, the application will be accessible under http://localhost:8000 from the browser. The last parameter -t option defines the document root - where the index.php file resides.

Getting Started

Disco is a container_interop compatible DI container. Somewhat controversially, Disco is an annotation-based DI container.

Note that the package container_interop consists of a set of interfaces to standardize features of container objects. To learn more about how that works, see the tutorial in which we build our own, SitePoint Dependency Injection Container, also based on container-interop.

To add services to the container, we need to create a configuration class. This class should be marked with the @Configuration annotation:

<?php
/**
 * @Configuration
 */
 class Services {
    // ...
 }

Each container service should be defined as a public or protected method inside the configuration class. Disco calls each service a Bean, which originates from the Java culture.

Continue reading %Disco with Design Patterns: A Fresh Look at Dependency Injection%


by Reza Lavaryan via SitePoint

Acqua del Garda Perfumes

Brand of Italian perfumes and skin care products inspired by the scents of the land surrounding the Lake Garda, the biggest and most loved lake in Italy.


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

Bruk

David Guba is a freelance Web (UI/UX) Designer based in Hungary.


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

Bangui Oubliee

Discover the activities of the NGO Action Against Hunger in Central African Republic, through a VR experience.


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

Android From Scratch: How to Use Resources In an Application

This Week's HTML5 and Browser Technology News (Issue 246)


Read this e-mail on the Web
HTML 5 Weekly
Issue 246 — June 29, 2016
Zack Bloom
A enjoyable essay looking at technologies and approaches that were proposed for styling Web documents before CSS became the firm favorite.


Brandon Smith
“Few things are as annoying on the web as having the page layout unexpectedly change or shift while you’re trying to view or interact with it.”


Lynn Fisher
Detailed, elegant icons rendered with CSS upon just one div element. (You’ll want to open your browser's element inspector to dig into these.)


Red Gate  Sponsored
Boost the performance of your .NET application with ANTS Performance Profiler. Get rich performance data on your code and database queries to find your application's bottleneck fast. Try ANTS Performance Profiler on your app now.

Red Gate

Myles Maxfield
“Many fonts are large, causing a long delay until the browser can use them. WebKit has mitigated this.”


Baljeet Rathi
Baljeet Rathi explains the various CSS image replacement techniques available to web developers today and their pros and cons.


Zack Bloom
Mutation Observer is a feature, supported by all modern browsers, that let you detect when elements in a page are inserted, changed or removed.


Neil Jenkins
What is the Referer header and how can you control its presence (or lack thereof)? A handy resource for security-minded Web developers.


Bryan Elkus
A quick walkthrough of building your first animation with Velocity.js to animate a list. Includes a CodePen example.


Chris Brandrick
We’ve taken a look through all the stats from HTML5 Weekly published so far in 2016 and collected the most popular CSS links we shared.


Jobs

In brief

Curated by Peter Cooper and published by Cooper Press.
Want to post a job? E-mail us or use our self-serve system.

Unsubscribe : Change email address : Read this issue on the Web

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


by via HTML5 Weekly