Thursday, June 22, 2017

3 Ways to Easily Caption Social Media Video

Worried that most people view your social media video with the sound off? Looking for quick and efficient ways to produce captioned video? In this article, you’ll discover three ways to automatically caption social media video. #1: Use Live Titles to Caption Apple Clips Need a quicker way to do captions for a video? Apple [...]

This post 3 Ways to Easily Caption Social Media Video first appeared on .
- Your Guide to the Social Media Jungle


by Serena Ryan via

A Ghost Store

Are you ready to check out? Introducing A Ghost Store, a transcendent shopping experience.
by via Awwwards - Sites of the day

Wednesday, June 21, 2017

Why It Is the Right Time for Small Businesses to Build a Mobile App

In case you have a small business and you have not built a mobile app for your business then you definitely need to get developed one. Nowadays, having an online presence alone is no longer enough, since online activities continue to shift to the smartphone. To put it in simple terms, mobile device...

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

by DIW via Digital Information World

Top Ten New Development Tools of the Month, June 2017

Top Ten New Development Tools of the Month

You can never have enough tools. There’s always a better way to achieve the same result no matter how slick your development process becomes!

Welcome to a new, regular series of articles that list the top ten new development tools of the month, as collated by StackShare. StackShare uses a combination of community feedback from discussions, favorites, up-votes, and stacks (tool collections) to determine the popularity of each new tool.


Looking for more on development tools or resources for learning development? Check out these great links:


The top ten new development tools for June 2017 are:

1. osquery - OS SQL Query Tool

At number #1 is osquery - a new tool from Facebook which exposes your Windows, macOS or Linux operating system as a relational database. You can use SQL queries to examine running processes, view installed software, discover hardware events and more.

The following example returns a list of attached USB hardware devices:

select * from usb_devices;

It's an unusual idea. It could be used by web developers to monitor performance or security breaches regardless of where an application is hosted or their experience of that platform.

More information and downloads: osquery.io

2. Standup - Progress Reporting Service

Standup processes your project data from services including GitHub, Bitbucket, GitLab, Jira and Trello to create development team progress reports in a single view. The online service is free to use, easy to understand, and could streamline your daily stand-up meetings.

More information and sign-up: getstandup.com

3. Draft - Container Development Tool

Draft is an experimental tool which helps developers build applications that run on Kubernetes containers. It’s currently available on Linux and macOS, with Windows builds coming soon.

More information and downloads: http://ift.tt/2rSqhai

Continue reading %Top Ten New Development Tools of the Month, June 2017%


by Craig Buckler via SitePoint

How I Built a Pure CSS Crossword Puzzle

CSS Crossword Puzzle

Recently I created a pure CSS crossword puzzle implemented using CSS grid that does not need JavaScript in order to work. It gained heavy interest pretty quickly on CodePen. As of this writing, it has more than 350 hearts and 24,000+ page views!

The great CSS Grid Garden tutorial inspired me to build something with Grid Layout features. I wondered if these features could be put to good use in building a crossword puzzle — then I thought, let’s try to create the whole thing without using JavaScript.

Building the Board/Grid

So, first thing’s first, let’s create the board itself!

I ended up with the following basic structure, with HTML comments included to show what the different sections will accomplish:

[code language="html"]
<div class="crossword-board-container">

<div class="crossword-board">

<!-- input elements go here. Uses CSS Grid as its layout -->

<div class="crossword-board crossword-board--highlight crossword-board--highlight--across">
<!-- highlights for valid 'across' answers go here. Uses CSS Grid as its layout -->
</div>

<div class="crossword-board crossword-board--highlight crossword-board--highlight-down">
<!-- highlights for valid 'down' answers go here. Uses CSS Grid as its layout -->
</div>

<div class="crossword-board crossword-board--labels">
<!-- row and column number labels go here. Uses CSS Grid as its layout -->
</div>

<div class="crossword-clues">

<dl class="crossword-clues__list crossword-clues__list--across">
<!-- clues for all the 'across' words go here -->
</dl>

<dl class="crossword-clues__list crossword-clues__list--down">
<!-- clues for all the 'down' words go here -->
</dl>

</div>

</div>

</div>
[/code]

That puts our basic skeleton in place so we can add more elements and start styling things.

Using Form Elements for the Squares

The crossword puzzle I’m creating is a 13x13 grid with 44 blank spaces so I need to create 125 input elements each with its own ID in the format item{row number}-{column number}, i.e. item4-12. Here’s what the grid will look like:

Empty crossword

Each of the inputs will get have a minlength and maxlength of “1” to emulate the behaviour of a crossword puzzle (i.e. one letter per square). Each input will also have the required attribute so that HTML5 form validation will be used. I take advantage of all of these HTML5 attributes using CSS.

Using the General Sibling Selector

The input elements are visually laid out in groups (exactly how a crossword puzzle is). Each group of input elements represents a word in the crossword. If each of the elements in that group is valid (which can be verified using the :valid pseudo selector), then we can use CSS to style an element that appears later in the DOM (using an advanced CSS selector called the general sibling selector) that will indicate that the word is correct.

Due to how sibling selectors work, and how CSS works in general, this element has to appear later in the DOM. CSS can only style elements that are after the currently selected element. It cannot look backwards in the DOM (or up the DOM tree) and style something before the current element (at the moment at least anyway).

This means I can use the :valid pseudo-class to style valid elements:

[code language="css"]
.input:valid {
border: 2px solid green;
}
.input:invalid {
border: 2px solid red;
}
[/code]

See the Pen Valid Pseudo Selector Example by SitePoint (@SitePoint) on CodePen.

To style an element later on in the DOM that is a sibling of another element, I can use the ~ (tilde/general sibling) selector, e.g. A ~ B. This selector will select all elements that match B, that are a sibling of A and appear after A in the DOM. For example:

[code language="css"]
#input1:valid ~ #input2:valid ~ #input3:valid ~ #input4:valid ~ #input5:valid ~ .valid-message {
display: block;
}
[/code]

With this code, if all these input elements are valid, the valid-message element will be displayed.

See the Pen Using Sibling Selector to Display a Message by SitePoint (@SitePoint) on CodePen.

The general sibling selector is extremely useful here. To make the crossword work, I needed to make sure that everything was laid out in a way that allowed me to take advantage of the general sibling selector.

Continue reading %How I Built a Pure CSS Crossword Puzzle%


by Adrian Roworth via SitePoint

What Is Snapshot Testing, and Is It Viable in PHP?

A vector image of a polaroid glued to a transparent background

Ah-ha moments are beautiful and rare in programming. Every so often, we're fortunate enough to discover some trick or facet of a system that forever changes how we think of it.

For me, that's what snapshot testing is.

You probably write a lot of PHP code, but today I want to talk about something I learned in JavaScript. We'll learn about what snapshot testing is and then see how it can help us write better PHP applications.

Building Interfaces

Let's talk about React. Not the kick-ass async PHP project, but the kick-ass JavaScript project. It's an interface-generation tool in which we define what our interface markup should look like as discrete parts:

function Tweet(props) {
  return (
    <div className="tweet">
      <img src={props.user.avatar} />
      <div className="text">
        <div className="handle">{props.user.handle}</div>
        <div className="content">{props.content}</div>
      </div>
    </div>
  )
}

function Tweets(props) {
  return (
    <div className="tweets">
      {props.tweets.map((tweet, i) => {
        return (
          <Tweet {...tweet} key={i} />
        )
      })}
    </div>
  )
}

This doesn't look like vanilla Javascript, but rather an unholy mix of HTML and Javascript. It's possible to create React components using regular Javascript syntax:

function Tweet(props) {
  return React.createElement(
    "div",
    { className: "tweet" },
    React.createElement("img", { src: props.user.avatar }),
    React.createElement(
      "div",
      { className: "text" },
      React.createElement(
        "div",
        { className: "handle" },
        props.user.handle
      ),
      React.createElement(
        "div",
        { className: "content" },
        props.content
      )
    )
  );
}

To make this code, I pasted the Tweet function (above) into the Babel REPL. That's what all React code is reduced to (minus the occasional optimization) before being executed by a browser.

Before I talk about why this is cool, I want to address a couple of issues...

"Why Are You Mixing HTML and Javascript?!"

We've spent a lot of time teaching and learning that markup shouldn't be mixed with logic. It's usually couched in the phrase "Separation of Concerns". Thing is, splitting HTML and the Javascript which makes and manipulates that HTML is largely without value.

Splitting that markup and Javascript isn't so much separation of concerns as it is separation of technologies. Pete Hunt talks about this in more depth in this video.

"This Syntax Is Very Strange"

That may be, but it is entirely possible to reproduce in PHP and works out the box in Hack:

class :custom:Tweet extends :x:element {
  attribute User user;
  attribute string content;

  protected function render() {
    return (
      <div class="tweet">
        <img src={$this->:user->avatar} />
        <div class="text">
          <div class="handle">{$this->:user->handle}</div>
          <div class="content">{$this->:content}</div>
        </div>
      </div>
    );
  }
}

I don't want to in detail about this wild syntax except to say that this syntax is already possible. Unfortunately, it appears the official XHP module only supports HHVM and old versions of PHP...

Testing Interfaces

There are many testing approaches – some more effective than others. An effective way to test interface code is by faking (or making) a web request and inspecting the output for the presence and content of specific elements.

Perhaps you've heard of things like Selenium and Behat? I don't want to dwell too much on them. Let's just say that Selenium is a tool we can use to pretend to be a browser, and Behat is a business-friendly language for scripting such pretense.

Unfortunately, a lot of browser-based testing can be brittle. It's tied to the exact structure of markup, and not necessarily related to the logic that generates the markup.

Snapshot testing is a different approach to doing the same thing. React encourages thinking about the whole interface in terms of the smallest pieces it can be broken down into. Instead of building the whole shopping cart, it encourages breaking things up into discrete parts; like:

  • each product
  • the list of products
  • the shipping details
  • the progress indicator

In building each of these pieces, we define what the markup and styles should be, given any initial information. We define this by creating a render method:

class Tweets extends React.Component {
  render() {
    return (
      <div className="tweets">
        {props.tweets.map((tweet, i) => {
          return (
            <Tweet {...tweet} key={i} />
          )
        })}
      </div>
    )
  }
}

...or by defining a plain function which will return a string or React.Component. The previous examples demonstrated the functional approach.

This is an interesting way of thinking about an interface. We write render as though it'll only be called once, but React is constantly reconciling changes to the initial information, and the component's own internal data.

And it's this way of thinking that leads to the simplest way to test React components: Snapshot Testing. Think about it for a minute...

We build React components to render themselves, given any initial information. We can work through all possible inputs in our head. We can even define strict validation for what initial information (or properties) we allow into our components.

Continue reading %What Is Snapshot Testing, and Is It Viable in PHP?%


by Christopher Pitt via SitePoint

#295: Building Production-Ready CSS Grid Layouts

Frontend Focus
Issue 295 — June 21, 2017
“to start working with CSS grid, you first need to set aside the habits, assumptions and practices that have enabled you to create advanced CSS-based layouts”
Morten Rand-Hendriksen

A look at the current state of Web Bluetooth support and how it can play an important role in the physical web and projects using beacons and mobile devices.
Jen Looper

A comparison between using pure CSS versus JavaScript’s native API for animation.
Ollie Williams

Attend full-day hands-on React workshops and dozens of talks at ForwardJS San Francisco this July.
ForwardJS   Sponsor

How to decide what to refactor and when; how to refactor code whilst still shipping features; how to avoid regressions when adding new CSS and more.
Harry Roberts

A look at how payment platform Stripe used several next-gen web technologies to bring their new suite of tools to life.
Benjamin De Cock

Now with scope hoisting, ‘magic comments’, and more. The upgrade process from v2 is also designed to be very smooth.
Sean T. Larkin

“I’ve heard it from lots of lots of developers. The years tick by on their projects, and all they ever seem to do is add to their CSS, never remove.”
Chris Coyier

Jobs

Can't find the right job? Want companies to apply to you? Try Hired.com.

In Brief

Handling Long and Unexpected Content in CSS tutorial
How to handle situations where content overruns the designed space.
Ahmad Shadeed

Getting Started with Draft.js tutorial
A framework for creating browser-based text editors.
Julian Krispel

CSS Tips and Tricks for Making Aspect-Ratio Friendly Boxes tutorial
Chris Coyier

Set Up File Persistence with Chrome DevTools Workspaces tutorial
Changes you make in the DevTools can easily be saved to disk.
Google Developers

Faster Page Load Using Lightweight CSS & SVG Animation (without JS) tutorial
Covers the basics of CSS animation, and the process of setting up an animation, exporting an SVG, and adding classes.
Kyle Henwood

Introduction to Webpack: Entry, Output, Loaders, and Plugins tutorial
A step-by-step guide, going from an empty configuration file to a complete setup to bundle a project.
Jeremias Menichelli

Designing A Simple Web Page with mini.css tutorial
Angelos Chalaris

An Introduction to the 'fr' CSS Unit tutorial
Robin Rendle

It’s easy to version control your database alongside your application 
Connect your database to your version control system with SQL Source Control and keep track of every change.
Red Gate  Sponsor

Paint the Web with CSS video
Using CSS as an artistic medium to create images and animations made up of pure code.
Eva Lettner

The Illusion of Speed opinion
“If you could take a 50% hit in real world performance and get a site that feels 50% faster, would you?”
Paul Bakaus

What Does a Well-Documented CSS Codebase Look Like? opinion
Kaloyan Kosev

HTML Imports Are The Best Web Component opinion
Ashley Gullen

HEIF: A First Nail in JPEG’s Coffin? opinion
Could Apple’s new image file format be JPEG’s replacement?
Kelly Thompson

$20 Free Credit on a new account. 
Linux cloud hosting starting at 1GB of RAM for $5/mo. Use promo code HTML520 and get $20 credit.
linode  Sponsor

Feather: A Collection of Open Source SVG UI Icons tools
Line-based and monochrome.
Cole Bemis

Cell: A Self-Constructing Web Framework Powered by A Self-Driving DOM code
Intercellular

html5-parser: Fast C-Based HTML 5 Parsing for Python code
Kovid Goyal

Grid Styled: A Responsive React Grid System Built with styled-components code


by via Frontend Focus