Wednesday, July 25, 2018

New Bluetooth Bug Threatens Devices From The Major Vendors

Bluetooth, one of the primary ways of connectivity that has been an object of controversy, yet again has been found to be a security threat to the users. A new way to hack Bluetooth has been discovered. This extremely critical cryptographic shortcoming, tracked as CVE-2018-5383, has been found...

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

by Mehwish Mehmood via Digital Information World

New Update For Google Docs: Grammar Checking Tool

For the ones with a slightly lenient grip on grammar and language, fear no more, Google has stepped up its game and now provides a grammar checker inbuilt for Google documents. You don’t need to question every creative sentence that forms in your head, whether it actually makes sense or have you...

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

by Mehwish Mehmood via Digital Information World

After Instagram And Twitter, YouTube Tests The Explore Feature

Yet again, YouTube makes amends to improve your experience with the site. This new update includes a feature of Explore. It is equipped with the abilities to help the users find new videos and channels on the site as they browse via their mobile. As reported by Tom Leng, this feature will pop up...

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

by Mehwish Mehmood via Digital Information World

How to Use Feature Flags in Continuous Integration

A lot has been written about the benefits of achieving true Continuous Integration (CI) into production systems. This tutorial will demonstrate a simple workflow that achieves CI. We'll be using Feature Flags and Remote Config to avoid the need for feature branches in Git, as well as any sort of test or staging environments.

What We Mean by CI and Feature Flags

Continuous Integration is a method of development in which developers are able to constantly release their code. Developers push their new features as they finish development, at which point they are automatically tested and released immediately into a live environment.

Feature flags provide a way of gating these new features from a remote control panel allowing you to turn them off and on at will without making any changes to your code. This allows you to develop a feature, and release it into production without actually changing anything from a user's point of view.

Why CI Is So Powerful

Integrating code in smaller chunks and in a more frequent manner allows development teams to pick up issues a lot quicker, as well as getting new features to users as quickly as possible. CI also removes the need for any large releases where a team of engineers need to stay awake until the wee hours of the night to minimise disruption to their users.

How Feature Flags Aid Continuous Integration

Feature flags provide an additional layer of confidence when releasing new features. By wrapping new features in a feature flag, the developers and product team are able to quickly enable or disable their features as required. Let's say we introduce a new feature into production but we can immediately see that there's a bug in the new code, because of something specific in the production environment that wasn't evident in testing (let's face it, it's happened to everyone... more than once).

Previously, this would have meant a (probably) lengthy and (definitely) painful rollback procedure and a rescheduling of the release for another ungodly hour on another day when the bug has been fixed. Instead, with a toggle of a switch the feature can be turned off for all or a subset of users and the pain is gone. Once the bug is identified and fixed, a patch release can be deployed, and the feature can be re-enabled.

Outline of Our Sample Project

To demonstrate integrating feature flags and remote config, we're going to base our initial codebase on the de facto React JS tutorial of a tic-tac-toe game. This is a great tutorial for learning the basics of React, so be sure to check it out if you haven't already.

Don't worry if you don't know React or Javascript well. The concepts we'll be going over are all about the process and tooling, and not about the code.

Rather than repeat the tutorial from the start, we're going to start at a point where we've got a basic tic-tac-toe game up and running.

At this point we'll use feature flags and remote configuration to continuously configure, push and deploy new features. To take this concept to an extreme we'll continuously be pushing to master; no other branches will be used. We'll introduce a bug (intentionally of course!) and push the fix to master, to demonstrate how dealing with this scenario doesn't require a full rollback or additional branching.

If you wish to follow along writing code during this tutorial, you can fork the repository here.

Achieving CI

The most common method of automating continuous integration is to have the build process trigger when you push changes to your git repository. Different build tools achieve this in different ways.

We're going to use Netlify for our project. Netlify lets you connect a Git repository and automatically deploy builds every time you push to a branch.

To use Netlify, simply sign up for a free account and select the 'New site from Git' option in the top right of the dashboard. Once you've connected your GitHub account (or otherwise, if you want to use Bitbucket or GitLab) you should then be presented with the options shown below.

In the next step, configure Netlify to run the application as follows.

Netlify will now go ahead and build your application for you. It will take a few minutes, but once it's done you should see something like the following:

Browsing to that URL should show your Tic Tac Toe game in all its glory.

Setting Up Feature Flags for Our Project

We're going to use feature flags to control the declaration of a winner in the tic-tac-toe game. To create and manage our feature flags, we're going to use Bullet Train as it's currently free, but there are many other feature flag products. We'll let you pick the one you feel is right.

To continue with us, go ahead and create a free account on Bullet Train. Click on the 'Create Project' button and create your project. We named ours FF Tutorial.

Next, we need to create a new feature for declaring a winner.
Click on the 'Create your first Feature' button at the bottom of the next screen to bring up the following form and add in the details.

Note that we've kept the feature disabled to begin with.

Take note of the two code snippets available beneath the feature, which will help us in the next step.

Implement the Feature Flag

Firstly, let's get this project running in our development environment. From the command line, navigate to the project folder and run the command npm i to install the necessary dependencies.

Next run npm run dev and head to http://localhost:8080 in your browser. You should see the same tic-tac-toe game that you saw on the Netlify URL.

We are now going to implement our new feature flag into the existing code. Let's start by installing the Bullet Train client for JavaScript, by opening up another command line and running the following in the project directory:

npm i bullet-train-client --save

Open up the project in your preferred editor and edit ./web/App.js.

Find the calculateWinner(squares) function. This function determines whether there has been a winner or not, based on whether it can find a line of the same shape or not. We are going to have this function return null based on the value of our feature flag so that we can test filling up the board without it declaring a winner.

At the very top of App.js, add the following line:

var declareWinner = true;

Now, let's initialise our Bullet Train client that we installed earlier. Copy all of code example 2 from the Features page in the Bullet Train interface and paste it just beneath the line you just added.

The environment ID in your code snippet will be the correct environment ID associated with the Development environment in your Bullet Train project. You can check this by browsing to the 'Environment Settings' page if you want.

We now need to edit the onChange() function in the bulletTrain.init() function in the code we just pasted in to suit our needs. Replace all of the code in there with one line:

declareWinner = bulletTrain.hasFeature("declare-winner");

You should now have this at the top of your App.js

var declareWinner = true;
import bulletTrain from "bullet-train-client"; //Add this line if you're using bulletTrain via npm

bulletTrain.init({
    environmentID:"<your-environment-id>",
    onChange: (oldFlags,params)=>{ //Occurs whenever flags are changed
        declareWinner = bulletTrain.hasFeature("declare-winner");
    }
});

Scroll down to the calculateWinner(squares) function and at the top, just above the declaration of the lines constant, let's add the line:

if (!declareWinner) return null;

And that's it! Our feature flag will now determine whether or not the winner is calculated or not on every render of the game. Refresh your browser and play the game. You can no longer win and instead the entire board can now be filled with Xs and Os.

Go back to the Bullet Train admin and toggle the feature using the switch on the right.

Refresh your browser and the game becomes winnable again. Check out the code for the end of this part here.

Commit and push your code (yes, all on master) and Netlify will automatically deploy your code. Browse to your assigned Netlify URL again and toggle the feature flag to see it working in a production environment. Sweet!

Work on a Bug

We are now going to purposefully introduce a bug into the tic-tac-toe game and show how feature flags can be used to drop a feature that is causing issues.

The feature we're going to add is selection of who goes first at the start of the game. For that we will add a couple of buttons that only appear at the beginning of the game and prevent clicks on the board from adding a shape.

Firstly, let's set up our feature flag to wrap the new feature. In your Bullet Train project, create a new feature called select-who-goes-first as follows. Let's leave it disabled to begin with.

Now, let's add our new feature. In the render() function we're going to render the buttons, instead of the status, if the game hasn't started yet. At the top of the return of the render() function, replace the line:

<div className="status">{status}</div>

... with the following code:

{!this.state.selected ? (
    <div>
        Who goes first?
        <button onClick={() => this.setState({selected: true})}>X</button>
        <button onClick={() => this.setState({selected: true, xIsNext: false})}>O</button>
    </div>
) : (
    <div className="status">{status}</div>
)}

Now we want to write the code to control our new feature with the feature flag we created. As before, this needs to go in the bulletTrain.init({...}) function.

First, let's add the lifecycle function componentDidMount() to the Board component and then move the entire bulletTrain.init({...}) function inside of it, so that we can update the state of the component after the flag is retrieved:

The post How to Use Feature Flags in Continuous Integration appeared first on SitePoint.


by Ben Rometsch via SitePoint

Avoiding Decision Fatigue By Using The Power Of Delegation (infographic)

When you run a small business, it can seem as though you are in charge of every detail of that business. If you want something done right, they say, you have to do it yourself. Except that when you are responsible for doing all the things it will ultimately result in decision fatigue, which will...

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

by Irfan Ahmad via Digital Information World

Chrome 68 released, non-HTTPS sites marked as “Not Secure”

#350 — July 25, 2018

Read on the Web

Frontend Focus

A Milestone for Chrome Security: Marking HTTP As “Not Secure” — Chrome 68, released this week (more on that below), shows a “Not secure” message in the location bar when accessing a site over unencrypted HTTP. The march to ‘HTTPS everywhere’ continues.

Google

Adding Particle Effects to DOM Elements with Canvas — A neat tutorial showing how to create a basic HTML-to-particle effect. You have to balance a few concepts to make it work but the result is striking.

Zach Saucier

Developer Tools for Every Customer Session – New in FullStory — Your browser developer tools are now available for site sessions other than your own. Easily understand performance issues thanks to page speed metrics, network analysis, downloadable HAR files, and comprehensive stack traces on all your visitors’ sessions.

Fullstory sponsor

Chrome 68 Released: What's New For Developers? — Other than the ‘Not Secure’ marker (above), Chrome 68 provides the Page Lifecycle API for you to detect when your tab has been suspended or restored, the Payment Handler API, and lots of neat DevTools improvements.

Google Developers

5 'Hot' New CSS Features and How to Use Them — Including the CSS Display module (e.g. display: contents), CSS overscroll behavior, conditional rules, and containment.

Daniel Crisp

Blink Signals Intent to Implement 'Portals'Portals (explained here) are a proposed approach for enabling seamless navigation between sites or pages (such as showing one page within another via a ‘portal’ before navigating to it).

blink-dev

The Frustrations of Using CSS Shapes and CSS Exclusions”.. indulge me as I explain my current feelings of woe with CSS Shapes and CSS Exclusions.”

Ben Frain

💻 Jobs

Senior Developer, New York or Remote — We're looking for a Sr Dev to join our team to help build, deliver and produce quality products for our growing customer base.

Apartment Therapy Media

Find A FrontEnd Job Through Vettery — Vettery specializes in developer roles and is completely free for job seekers.

Vettery

📘 Articles & Tutorials

An In-Depth Look at the Page Lifecycle API — A Chrome-only API for now that brings app lifecycle features common on mobile operating systems to the web. It ships with Chrome 68.

Philip Walton (Google)

Getting to Know a Legacy CSS Codebase

Harry Roberts

Converting Images to WebP — The many ways in which you can convert existing images to the WebP format. An excerpt from the recently released ‘The WebP Manual’ ebook.

Jeremy Wagner

Choosing the Right JavaScript Framework: Whitepaper — Learn how Angular, React and Vue compare against a comprehensive set of criteria. Get your copy.

Progress Kendo UI sponsor

4 CSS Tricks I’ve Learnt The Hard Way — Quick box sizing, centering, and positioning tips.

David Mellul

Weird Things Variable Fonts Can Do

Chris Coyier

How to Make a Modern Dashboard with NVD3.jsNVD3.js is a set of chart components built around D3.js.

Dan Englishby

Build an Instagram Clone with Vue.js and CSSGramCSSGram recreates Instagram-style filters using CSS filters and blend modes.

Hassan Djirdeh

Ubuntu 18:04 Is Here and DigitalOcean Has The Info You Need To Know

DigitalOcean sponsor

▶  WebFonts and Performance: 2 Videos from SmashingConf

Smashing Magazine

🔧 Code and Tools

TOAST UI Grid 3.0: A Data Grid Control for the Web — This data grid component works down to IE8, works with many data types, and is easily rethemed.

NHN Entertainment

3 Essential Front-End Checklists for Web Developers

David Dias

Pushbar.js: Simply Creating 'Sliding Drawers' on Your Pages

Biraj Ghosh

4 Things You Can Do with CSS Pointer Events — Change the styling of a parent on hover, make only pseudo elements clickable, and more.

Martijn Cuppens

Unswitch: An Event Handler for Nintendo Switch Controllers on the Web — Based on the Gamepad API.

Colin van Eenige


by via Frontend Focus

SelectPage : A simple Style & Powerful Selection jQuery plugin

A simple style and powerful selector, including ajax remote data, autocomplete, pagination, tags, i18n and keyboard navigation features.

The post SelectPage : A simple Style & Powerful Selection jQuery plugin appeared first on Best jQuery.


by Admin via Best jQuery