Implement a Counter Table in Elasticsearch

In your product, you ought to know in-depth information concerning feature usage. With that, you also should be interested in knowing when exactly a particular feature was touched last.In this article, we're going to solve the problem of getting click counts on different entities/pages of your website to find out when a particular page last touched.

To solve this problem, two main solutions come to mind:

API Security Weekly: Issue #59

API Security News

This week is all about API vulnerabilities. We found them everywhere: from client to cloud communications of Fortinet products to avatar hacks in Truecaller app, an authentication flaw in Nykaa Fashion, and yet another kids smartwatch system with almost total lack of security.

You might also like:  REST API Security

Vulnerability: Fortinet

Researchers from SEC Consult have found bad implementation in various Fortinet products. Embarrassingly, these were security products, including FortiGuard Web Filter, FortiGuard AntiSpam, and FortiGuard AntiVirus. Turns out that the implementation of communications between their clients and their cloud backend left a lot to be desired.

Masking GIFs with other GIFs

The other day, Cassie Evans tweeted a really neat trick that I’ve never seen before: using SVG to mask one GIF on top of another. The effect is quite lovely, especially if you happen to grab a colorful GIF and place it on top of a monochrome one:



See the Pen
Masking gifs with other gifs... (svg masking is cool)
by Cassie Evans (@cassie-codes)
on CodePen.

Considering I’ve never done anything with SVG masks before, I thought I could quickly look over the code and dissect it to see how Cassie made this rather lovely demo! The interesting thing about all this though is how rather simple it is.

To kick things off, we grab the GIF that we want to use as our SVG mask. We can fetch that from GIPHY:

via GIPHY

Next we can begin writing our SVG directly in the HTML of the page: we begin by adding a tag which can be used to store assets that we’ll refer to in another part of the same SVG:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300">
  <defs>
    <mask id="MASK" maskunits="userSpaceOnUse"
              maskcontentunits="userSpaceOnUse">
      <image 
        xlink:href="https://media.giphy.com/media/tIwmTQ64D52XTuL8xd/giphy.gif" 
        height="100%"
        width="100%"/>
    </mask> 
  </defs>
</svg>

If you take a closer look at that <mask> element, you’ll see that Cassie has added an id="MASK" and this is how we’ll refer to the mask later on in the file, by pointing to this id attribute.

Now we can go ahead and fetch our next animated image (but this time a cool GIF of outer space):

Let's add that GIF into a <g> element and apply the mask attribute to it, like so:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300">
  <defs>
    <mask id="MASK" maskunits="userSpaceOnUse"
              maskcontentunits="userSpaceOnUse">
      <image 
        xlink:href="https://media.giphy.com/media/tIwmTQ64D52XTuL8xd/giphy.gif" 
        height="100%"
        width="100%"/>
    </mask>      
  </defs>
  <g mask="url(#MASK)">
    <image x="0" y="0%" class="space" href="https://media.giphy.com/media/MXQnyEQwBJ6eTj90L5/giphy.gif" 
        height="100%" width="100%"/>
  </g>
</svg>

SVG code can look pretty scary at first glance, especially if you’re not familiar with it. It might be best to break all this stuff up into two parts. First, defining the mask...

  <defs>
    <mask id="MASK" maskunits="userSpaceOnUse"
              maskcontentunits="userSpaceOnUse">
      <image 
        xlink:href="https://media.giphy.com/media/tIwmTQ64D52XTuL8xd/giphy.gif" 
        height="100%"
        width="100%"/>
    </mask>      
  </defs>

...and subsequently using that mask...

<g mask="url(#MASK)">
  <image x="0" y="0%" class="space" href="https://media.giphy.com/media/MXQnyEQwBJ6eTj90L5/giphy.gif" 
         height="100%" width="100%"/>
</g>

Once we break it up like that, it makes a lot more sense, huh? And there you have it! Two animated GIFs used as an SVG mask. It’s a super nifty trick.

Cassie made another example but this time a jumping space monster:

See the Pen
Space monster (svg masking is cool)
by Cassie Evans (@cassie-codes)
on CodePen.

The post Masking GIFs with other GIFs appeared first on CSS-Tricks.

If You Learn to Build Scalable Applications, You Can Change Your Career

Learn how to grow and scale your applications.

The web is huge, and it's getting bigger. Every. Single. Minute. More people. Doing more things. Using more devices. On faster connections.

You may also enjoy:  How to Build Scalable Apps

Everything indicates that load pressure over all kinds of applications is only going to increase: from small to big ones, from B2C through B2B. More companies will need teams that can deliver on the scalability promise.

Automated Software Framework For Python With the unittest Module

unittest and Python.

Software testing plays a vital role in ensuring that the original output of a software product matches the desired output by offering certain test inputs to the software. Software testing is regarded as a vital step as it plays a vital role in finding the flaws and errors in the product within a short interval of time.

Software testing, or QA testing, is generally divided in two major categories, automated testing and manual testing. Automation testing refers to the execution of different tests with the aid of a script, in place of a human. This write-up discusses a few of the tips of automated software testing through Python.

Custom Policy in Mule 4

Custom Policy in Mule 4

Mule provides a set of policies beforehand, but there might be a requirement that is not covered by predefined policies. In such cases, a custom policy can be developed. The process is a three-step workflow:

  • Developing the policy
  • Deploying/Uploading the policy to exchange
  • Applying the policy on API
You might also like:  Working With Custom Policy in Mule 4

Setting up and Creating the Project

Before diving into the development, setup Maven to create the required project structure.
In settings.xml , under the  profiles section, add the below profile:
<profile>
<id>archetype-repository</id>
<repositories>
<repository>
<id>archetype</id>
<name>MuleRepository</name>
<url>https://repository-master.mulesoft.org/nexus/content/repositories/public</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
</profile>


How to Explore Databases Visually With Relational Data Browse

How to Explore Databases Visually

Relational databases are used when a project store structured data and has a fixed schema.
They can handle a lot of complex queries, database transactions and routine analysis of data. Relational databases make data browsing very accessible, but even so, they still require complex SQL Queries. This can be time-consuming, especially for a beginner in SQL syntax.

Relational Data Browse, a feature integrated by DbSchema, is an optimal solution to this problem. In this tutorial, we’ll go over the functionality of this feature.

Using Telegraf on Windows

Learn how to use Telegraf on Windows.

Telegraf is an agent that runs on your operating system of choice, schedules gathering metrics and events from various sources and then sends them to one or more sinks, such as InfluxDB or Kafka. For InfluxDB, version 1.x, 2.0 as well as InfluxDB Cloud are supported.

You may also like: Using the Telegraf Elasticsearch Input Plugin

Telegraf can collect information from multiple inputs and currently includes over 200 plugins for retrieving information from multiple types of applications. It can also retrieve information about hardware and software from the OS.

How to Automate Appium Java Tests In Parallel Using TestNG

Automate Appium Java Tests In Parallel

The beauty of Appium for mobile testing is that its tests can be written in any programming language including Python, Ruby, Java, JavaScript, and C#. While we have covered extensive Appium tutorials, in this article, we'll walk through how to automate Appium tests in parallel against our real devices using TestNG Java sample tests.

You may also like: How to Run a Selenium Test With TestNG

What Is and Why to Use TestNG?

TestNG, where NG denotes Next Generation, is an automated testing framework that is inspired by both JUnit and NUnit.

Building Microservices Through Event-Driven Architecture, Part 3: Presenters, Views, and Controllers

Learn how to build your microservices through event-driven architecture.
You may also like: Building Microservices With Event-Driven Architecture, Part 1: Application-Specific Business Rules

During this journey, I will implement the command side of Presenters, Views, and Controllers

In this step, I will implement the presentation. Here, the presentation is not the user interface but the Web API.

Product Manager: The Visionary Of Multiple Responsibilities

Learn how to manage multiple responsibilities.
You may also like: Fyre Festival: Lessons for Product Development

PM is not just a very important person from the C-suite. They play a crucial role in the live cycle of any product of the company and they are really supposed to wear suits, but they don’t. Product managers are responsible not just for the technical side of the product, but of its heart and soul.

The main difference of PM from any management position is the necessity to be involved in the product creation directly. The manager is not about producing, but about understanding the techniques and showing the direction for all the teams, as the PM should have the final image of the product.

The 40 Best Organizational Tools to Enhance Your Work

Get these tools in your toolbox!
You may also like: What Team Collaboration Tools Make an Ordinary Staff Feel Like a Dream Team?

Being organized doesn’t mean you have to rely on one resource or a couple of organizational tools, whether you are an analog or a digital organizer. You can get the best features out of all of them to organize your chores and projects accordingly.

Some of the best work organizing tools are listed below that will help you get your affairs in order. Let’s take a look.

Meet “Inclusive Components”: Accessible, Bulletproof Front-End Patterns

Meet “Inclusive Components”: Accessible, Bulletproof Front-End Patterns

Meet “Inclusive Components”: Accessible, Bulletproof Front-End Patterns

Vitaly Friedman

Front-end accessibility is still somewhat mysterious these days. How do we build accessible buttons and dropdowns? What about keyboard-friendly tooltips, tabs and notifications? Or inclusive accordions, sliders, data tables and modals? Let’s figure it out together. Meet Inclusive Components, our new handbook for building fully accessible digital products. Download a free sample PDF (1.1 MB).

Meet Inclusive Components, our new book for building accessible, inclusive interfaces. Written by one-and-only <a href='http://www.heydonworks.com/'>Heydon Pickering</a>.

Print + eBook

$ 39.00

Quality hardcover. Free worldwide shipping. 100 days money-back-guarantee.

eBook

$ 18.00

DRM-free, of course. ePUB, Kindle, PDF.
Included with Smashing Membership.

About The Book

At its heart, Inclusive Components is a detailed, practical handbook for building fully accessible interfaces. The book examines 12 common interface patterns — accordions, tables, modals, notifications, tabs, toggles, and everything in-between — through the lens of inclusion. The result is accessible and robust components we author, plug in, and use daily.

For years, Heydon Pickering, a seasoned front-end developer with a focus on accessibility, has been writing about accessible solutions. We’ve teamed up with Heydon to produce a book with common challenges and solutions that he’s been refining over all these years.

For each component, the in-depth explorations are meticulously illustrated and all solutions are available as bulletproof code snippets, applicable to your work right away. Bonus: you’ll learn how to build your own accessible components with inclusive design in mind — all in a single book. Jump to table of contents ↓

332 pages. Quality hardcover with a stitched binding and ribbon page marker. The eBook is available as PDF, ePUB, Amazon Kindle. Written and designed by Heydon. Download a sample PDF (1.1 MB).

The cover of Inclusive Components, a new book by Heydon Pickering.
The inner spreads of Inclusive Components.

Print + eBook

$ 39.00

Quality hardcover. Free worldwide shipping. 100 days money-back-guarantee.

eBook

$ 18.00

DRM-free, of course. ePUB, Kindle, PDF.
Included with Smashing Membership.

Table Of Contents

Each chapter tackles a single component, addressing how different and vulnerable people might read and interact with it, and how they can be better accommodated. Download a sample PDF (1.1 MB).

Inclusive Components, a peek inside.
A peek inside of Inclusive Components. A photo by Drew McMellan. See more photos. (Large preview)

About The Author

Heydon Pickering

Heydon Pickering (@heydonworks) has worked with The Paciello Group, The BBC, Smashing Magazine, and Bulb Energy as a designer, engineer, writer, editor, and illustrator. He was shortlisted for Designer Of The Year in The Net Awards.

Heydon previously wrote Inclusive Design Patterns which sold over 10,000 copies. Proceeds from this title were donated to the ACLU and The Democratic Socialists Of America, to help these organizations fight fascism and create a more inclusive society.

Here’s what Heydon shared when asked why he decided to write this book:

“A few years back, I was getting bored with web design. Then responsive design came along, presenting me with fresh challenges. It made my life and my job interesting again. Then I discovered the world of web accessibility, and my enthusiasm was once again renewed. Some people seem to think I do web accessibility because I feel morally obliged, or that I would feel guilty if I didn’t.

While I believe strongly that all sorts of people should be able to access the web, I’m also grateful for the web accessibility challenges I’ve encountered, and covered in this book, for stimulating me, and giving my work new depth.

I have written this book because I want you to know how fun it can be to make your interfaces more accessible, as well as how accomplished you can feel for having done so. Thank you for reading this, and hopefully the book as well.”

Testimonials

Artem Sapegin“Inclusive Components is a very deep and thorough explanation of development of accessible components with real world examples. Heydon Pickering shows several alternative approaches and explains pros and cons of each. It’s also a pleasure to read!”

Artem Sapegin, front-end developer, Wayfair
Sarah Federman“Inclusive Components is chock-full of practical and comprehensive advice on building accessible UI. It’s my go-to resource after the official WCAG and ARIA documentation. I’ve found it extremely helpful when building our design system!”

Sarah Federman, senior front-end developer
Andy Bell“What Heydon achieves with his work on Inclusive Components is a pragmatic, friendly and approachable set of guides that help you to generate not just accessible components, but also resilient and progressive starting-points that will help you to build better websites and web apps in general. I often describe this work as crucial learning material for this exact reason.”

Andy Bell, independent designer & developer
A preview of the book, with examples ranging from accordions to toggles, tables, notifications, dialogs etc. Download a sample PDF (1.1 MB). Large preview.

Why This Book Might Be For You

The devil is in the detail and often the things you do with good intentions can impose accessibility barriers unknowingly. Inclusive Components is for every front-end developer who wants to learn how to detect and address potential accessibility issues in their work. The book will teach you:

  1. How to use <button> elements, how to apply styles to your toggle buttons, and how to label them.
  2. How to create managed lists that allow users to create and delete content — in an inclusive way.
  3. How to address and resolve accessibility issues with navigation menus and submenus (aka “dropdowns”).
  4. How to create accessible and keyboard-friendly tooltips and toggletips.
  5. How to create a “dark mode” theme that’s both accessible and maintainable long-term.
  6. How to build an accessible content slider to prevent harm for motion-sensitive people.
  7. How to create inclusive notifications with live regions to communicate with your users through visual and aural channels simultaneously.
  8. How to create data tables that are semantically correct, responsive, and sortable.
  9. How to build accessible dialogs and modal dialogs with performance and inclusive design in mind.
  10. How to create and group inclusive cards (e.g. for teasers).

Technical Details

Community Matters ❤️

With Inclusive Components, we've tried to create a very focused handbook with applicable, long-living solutions and strategies to create accessible and inclusive interfaces.

Our hope is that with Heydon’s book, you will be able to make better design and coding decisions as you build your interfaces. Perhaps it will even become one of those reference books you’ll reach to every time you need to build one of those common UI components.

Producing a book takes quite a bit of time, and we couldn’t pull it off without the support of our wonderful community. A huge shout-out to Smashing Members for their ongoing support in our adventures. As a result, the eBook is and always will be free for Smashing Members. Plus, Members get a friendly discount when purchasing their printed copy.

Stay smashing, and thank you for your ongoing support, everyone!

The cover of Inclusive Components, a new book by Heydon Pickering.

Print + eBook

$ 39.00

Quality hardcover. Free worldwide shipping. 100 days money-back-guarantee.

eBook

$ 18.00

DRM-free, of course. ePUB, Kindle, PDF.
Included with Smashing Membership.

More Smashing Books

Promoting best practices and providing you with practical tips to master your daily coding and design challenges has always been (and will be) at the core of everything we do at Smashing. In the past few years, we were very lucky to have worked together with some talented, caring people from the web community to publish their wealth of experience as books that stand the test of time. Alla, Adam and Andy are some of these people. Have you checked out their books already?

Smashing Editorial (il, cm)