Variable Fonts Link Dump!

There's been a ton of great stuff flying around about variable fonts lately (our tag has loads of stuff as well). I thought I'd round up all the new stuff I hadn't seen before.

The post Variable Fonts Link Dump! appeared first on CSS-Tricks.

Dwolla Boosts Java Support with Kotlin

Dwolla has adopted the Kotlin programming language, with a focus on helping its Java clients. Specifically, the company created a new Kotlin-based SDK for its API. Dwolla maintains that Kotlin is wholly compatible with Java and, more importantly, simpler to use and maintain.

The end goal here is to improve developer productivity and reduce the time it takes companies to develop apps and bring them to market. 

How to Add Custom Content to WordPress Feeds

There are numerous ways to add custom content to your WordPress feeds. If you're not using a plugin, it's possible to just add a code snippet to your theme's functions.php file. For most cases, I think probably going the plugin route is the easiest way to add custom content to your WordPress RSS/feeds. Just install, activate, add your content and done. But for WordPress developers and designers who want more fine-grained control, this article explains how to add custom feed content programmatically using the WP API. So whether you need to add copyright text, advertisements, hyperlinks, or virtually anything at all, this post explains how to make it happen.

Add custom content to feed content

Often the easiest way to explain something is to just show it:

// add custom content to all feeds
function shapeSpace_add_content_to_all_feeds($content) {

	$before = '<p>Custom content displayed before content.</p>';
	$after = '<p>Custom content displayed after content.</p>';

	if (is_feed()) {

		return $before . $content . $after;

	} else {

		return $content;

	}

}
add_filter('the_content_feed', 'shapeSpace_add_content_to_all_feeds');

This snippet adds the specified custom content to each item in your WordPress feeds. You can add this code to your WordPress site by including it in your theme, or you can make a simple plugin and go that route. Either way is fine, totally up to you.

How it works

In the previous code, our function shapeSpace_add_content_to_all_feeds() first defines the custom content that we want to add $before the feed content and $after the feed content. Using either/both of these variables, you can define virtually any custom content, text, markup, or whatever you wish.

After defining the custom content, the function continues with a conditional check via the is_feed() tag. If the request is for any of WordPress’ feeds, then the custom content will be included with the feed content. Otherwise, if the request is not for any feed, then the original content is returned unmodified.

FYI: Technically the conditional is_feed() check is not necessary, but it's useful to show how a conditional tag might be used in this context.

By itself, our shapeSpace_add_content_to_all_feeds() function won't do anything. To get it to work, we need to call it. And because this is WordPress, we can use add_filter() to choose exactly when and where the function should be called. For WP feeds, we can hook our function into the_content_feed, so our custom content will be added to the <content> tag of every WordPress feed.

Example of feed output

To help visualize what happens when custom content is added to WordPress feeds, here is an example of what the feed markup (XML) will look like after adding our custom $before and $after content using the method above:

<item>
	<title>Securing the WP REST API</title>
	<link>https://digwp.com/2018/08/secure-wp-rest-api/</link>
	<comments>https://digwp.com/2018/08/secure-wp-rest-api/#comments</comments>
	<pubDate>Mon, 27 Aug 2018 19:40:33 +0000</pubDate>
	<dc:creator>Jeff Starr</dc:creator>
	<category><![CDATA[ Security ]]></category>
	<guid isPermaLink="false">https://digwp.com/?p=8446</guid>
	<description>
		<![CDATA[ I think many WordPress users probably underestimate the amount of data that is made available via the REST API. Just about everything is available to anyone or anything that asks for it: posts, pages, categories, tags, comments, taxonomies, media, users, settings, and more. [&#8230;] ]]>
	</description>
	<content:encoded>
		<![CDATA[
		<p>Custom content displayed before content.</p>

		<p>I think many WordPress users probably underestimate the amount of data that is made available via the <a href="https://developer.wordpress.org/rest-api/" title="REST API Handbook">REST API</a>. Just about everything is available to anyone or anything that <strong>asks for it</strong>: posts, pages, categories, tags, comments, taxonomies, media, users, settings, and more. ...</p>
		<p>Post content continues here...</p>

		<p>Custom content displayed after content.</p>
		]]>
	</content:encoded>
	<wfw:commentRss>https://digwp.com/2018/08/secure-wp-rest-api/</wfw:commentRss>
	<slash:comments>1</slash:comments>
</item>

Here you can see the "before" and "after" custom content added to the <content> tag. And that's pretty much all there is to it. Now let's change it up and add our custom content to the feed description (i.e., excerpt).

Add custom content to feed description

In the previous section, we cover how to add our custom content to the the <content> tag. To instead display the custom content in the <description> tag, we simply need to change the hook that is used by our add-content function. So instead of doing this:

add_filter('the_content_feed', 'shapeSpace_add_content_to_all_feeds');

..we hook our function into the_excerpt_rss, like so:

add_filter('the_excerpt_rss', 'shapeSpace_add_content_to_all_feeds');

Here is the result of using this new tag:

<item>
	<title>Securing the WP REST API</title>
	<link>https://digwp.com/2018/08/secure-wp-rest-api/</link>
	<comments>https://digwp.com/2018/08/secure-wp-rest-api/#comments</comments>
	<pubDate>Mon, 27 Aug 2018 19:40:33 +0000</pubDate>
	<dc:creator>Jeff Starr</dc:creator>
	<category><![CDATA[ Security ]]></category>
	<guid isPermaLink="false">https://digwp.com/?p=8446</guid>
	<description>
		<![CDATA[
		<p>Custom content displayed before content.</p>
		
		I think many WordPress users probably underestimate the amount of data that is made available via the REST API. Just about everything is available to anyone or anything that asks for it: posts, pages, categories, tags, comments, taxonomies, media, users, settings, and more.  [&#8230;] 
		
		<p>Custom content displayed after content.</p>
		]]>
	</description>
	<content:encoded>
		<![CDATA[
		
		<p>I think many WordPress users probably underestimate the amount of data that is made available via the <a href="https://developer.wordpress.org/rest-api/" title="REST API Handbook">REST API</a>. Just about everything is available to anyone or anything that <strong>asks for it</strong>: posts, pages, categories, tags, comments, taxonomies, media, users, settings, and more. ...</p>
		<p>Post content continues here...</p>
		
		]]>
	</content:encoded>
	<wfw:commentRss>https://digwp.com/2018/08/secure-wp-rest-api/</wfw:commentRss>
	<slash:comments>1</slash:comments>
</item>

By hooking our function into the_excerpt_rss, our "before" and "after" content is added to the <description> instead of the <content>. So it follows that we can add to BOTH description AND content by calling our function with BOTH hooks, something like this:

add_filter('the_content_feed', 'shapeSpace_add_content_to_all_feeds');
add_filter('the_excerpt_rss', 'shapeSpace_add_content_to_all_feeds');

Take home message

Basic thing to remember:

  • the_excerpt_rss — filters feed <description>
  • the_content_feed — filters feed <content>

You can call your "content-adding" function using either or both of these hooks. Then you can configure just about any sort of custom feed content that you can imagine. BTW, I find myself using this technique somewhat frequently, so I wrote a plugin to help automate the process of adding custom content to feeds, posts, pages, or any combination — gives you lots of flexibility.


UX Design Trends to Look For In 2020


It's hard to believe, but 2020 means we will be heading into the decade’s final chapter. In these ten years, the internet has changed our everyday life. We have witnessed change and seen the reign of mobile, the introduction of a chatbot, IoT, AR, VR. As breakthrough as all of these new technologies have been, where I see and feel these transformations the most is in web design trends. It seems like UX design trends will be huge in 2020 as we will witness aesthetics and technology come together like never before.

You may also like: A Beginner's Guide to Creating an Interactive Chatbot Flow in Teneo.

A Recap

What is User Experience (UX) Design?

What You Should Actually Know About Security in Ruby on Rails?

Introduction to Ruby-on-Rails

A popular development environment, Ruby on Rails features a simple syntax. The environment is accommodating by nature, allowing teams of varying sizes to work in complete harmony. Developers find it fairly easy to learn, and thus, it is one of the most popular development technology available today.

Security Issues With Ruby on Rails

Thanks to Apple, the web development framework saw an overnight upsurge in its popularity. However, in  2012, security breaches invited massive criticism from its patrons.

A Brief Overview of Pandas DataFrames

Significantly more adorable... slightly less helpful for data wrangling

This article is the continuation of my previous article. Here, we will be discussing another datatype, Dataframes.

Dataframes are going to be the main tool that developers use when working with pandas.

Future Trends in Data Analytics

The future of business is data

Data is exploding: the IDC says data is growing at 40% annually. By 2025, there will be 175 zettabytes —that’s 175 sextillions bytes-of data floating around the world.

To harness that data and use it to create a competitive advantage can be quite daunting. One way forward-thinking organizations have responded to the challenge is by focusing on streaming data.

Creating Spring Boot and React CRUD Full Stack Application with Maven

This guide helps you create a full-stack application with CRUD (Create, Read, Update and Delete) features using React for the frontend and Spring Boot as the backend REST API. 

You Will Learn

  • What a full-stack application is.
  • Why developers create full-stack applications.
  • How to you use React as a frontend framework.
  • How to you use Spring to create a backend REST Service API.
  • How to you call Spring Boot REST API from React using the axios framework.
  • How and when to use different REST API Request Methods — GET, POST, PUT and DELETE.
  • How to you perform CRUD (Create, Read, Update and Delete) operations using React and Spring Boot.
  • How to create a form in React using Formik?


Selenium Automation Testing With LambdaTest


Automation testing has become a basic need for organizations that run their businesses online. It is a testing technique that is used to ensure that a web application works fine across all browsers, operating systems, and devices in terms of functionality, speed, and accuracy. There are multiple testing platforms and tools that can be used for automation testing like Robotium, TestComplete, SoapUI, and Ranorex.

But, there is no match for Selenium. It is the most recommended tool for automation testing by large as well as small organizations. So, if you’re starting out with automation testing and don’t know what selenium is and how it is beneficial for automation testing?

How to Enhance Security Measures on Your Web Browsers

Stop threats before they can start with these tips

Browsers are the primary point of access to the World Wide Web. Every time you access the Internet, your browsers are exposed to potential online attacks. Browsers often provide an easy way for unauthorized users or hackers to access your private data, trace your daily activities or access your system directly.

You may also like: Endpoint Security With Browser Security Plus.

Overview of Browser Security

Your browser is an entry point for all malware or suspicious activities. It also means that your browser is vulnerable to attacks. Hackers or malware producers identify various loopholes to exploit browser functionalities and sneak malware onto your system.

UX Considerations for Web Sharing

From trashy clickbait sites to the most august of publications, share buttons have long been ubiquitous across the web. And yet it is arguable that these buttons aren’t needed. All mobile browsers — Firefox, Edge, Safari, Chrome, Opera Mini, UC Browser, Samsung Internet — make it easy to share content directly from their native platforms. They all feature a built-in button to bring up a "share sheet" — a native dialog for sharing content. You can also highlight text to share an excerpt along with the link.

A collage of various share buttons from sites across the web.
The ubiquitous share button, as seen at the BBC, Wired, BuzzFeed, PBS, The Wall Street Journal and elsewhere.

Given that users can share by default, are custom buttons taking up unnecessary space and potentially distracting users from more important actions? And do people actually use them?

A (unscientific) poll of 12,500 CSS-Tricks readers found that 60% of its readers never used custom share buttons. That was in 2014 and native methods for sharing have only improved since then. A more recent poll from Smashing Magazine found much the same thing.

Users come with varying technological proficiency. Not everybody knows their way around there own mobile phone or browser meaning some users would struggle to find the native share button. It’s also worth thinking about what happens on desktop. Desktop browsers generally (with Safari as one exception) offer no built-in sharing functionality — users are left to copy and paste the link into their social network of choice.

Some data suggests that clickthrough rates are relatively low. However, clickthrough rates aren’t the best metric. For technically savvy users aware of how to share without assistance, the buttons can still act as a prompt — a visual reminder to share the content. Regardless of how the link is ultimately shared, a custom share button can still provide a cue, or a little nudge to elicit the share. For this reason, measuring click rates on the buttons themselves may not be entirely fair — people may see the button, feel encouraged to share the content, but then use the browsers built-in share button. A better metric would be whether shares increase after the addition of share buttons, regardless of how they’re shared.

We’ve established that having a share button is probably useful. Websites have traditionally featured separate buttons for two or three of the most popular social networks. With a new-ish API, we can do better. While browser support is currently limited to Chrome for Android and Safari, those two browsers alone make up the vast majority of web traffic.

The Web Share API

The Web Share API offers a simple way to bring up a share sheet — the native bit of UI that’s used for sharing. Rather than offering a standard list of popular social networks to share to (which the user may or may not be a member of), the options of the share sheet are catered to the individual. Only applications they have installed on their phone will be shown. Rather than a uniform list, the user will be shown only the option to share on networks they actually use — whether that be Twitter and Facebook or something more esoteric.

Not showing the user irrelevant networks is obviously a good thing. Unfortunately, this is counterbalanced by the fact that some users visit social media websites rather than downloading them as apps. If you use twitter.com, for example, but haven’t installed the Twitter application natively, then Twitter will not be listed as a sharing option. Currently, only native apps are listed but PWAs will be supported in the future.

websharebutton.addEventListener("click", function() {
  navigator.share({
    url: document.URL,
    title: document.title,
    text: "lorem ipsum..."
  });
});

The API requires user interaction (such as a button click as shown in the above code) to bring up the share sheet. This means you can’t do something obnoxious like bring up the share sheet on page load.

The text might be a short excerpt or a summation of the page. The title is used when sharing via email but will be ignored when sharing to social networks.

Comparing the share sheets of Android and iPhone.
Native sharesheet dialog on Android (left) and iOS (right). The apps listed here are dependent on which apps you have installed on your device.

Sharing on desktop

While we are pretty happy with the Web Share API for mobile, its implementation for desktop is currently limited to Safari and leaves a lot to be desired. (Chrome is planning to ship support eventually, but there is no clear timescale).

The provided options — Mail, Message, Airdrop, Notes, Reminders — omit social networks. Native apps for Twitter and Facebook are common on phones, but rare on other devices.

Instead of relying on the Web Share API for desktop, its relatively common to have a generic share button that opens a modal that offers more multiple sharing options. This is the approach adopted by YouTube, Instagram and Pinterest, among others.

Comparing Instagram and YouTube share options on desktop.
Instagram (left) compared to YouTube (right)

Facebook and Twitter account for the vast majority of sharing online, so offering an exhaustive list of social networks to choose from doesn’t feel necessary. (An option for Instagram would be ideal, but it is currently not technically possible to share to Instagram from a website.) It is also relatively common to include an email option. For anyone using a web-based email client like gmail.com or outlook.com rather than the operating system’s default email application, this is problematic.

Many people make use of web-based email client’s gmail.com or outlook.com. A share-by-email button will open the operating system’s default email application. Users will be greeted by a prompt to set this up, which is far more effort than simply copy and pasting the URL. It is therefore advisable to omit the email option and instead include a button to copy the link to the clipboard, which is only infinitesimally easier than doing a copy in the address bar with the keyboard.

Screenshot of the share options offered by Mac's email application, including iCloud, Exchange, Google, Yahoo and AOL.
A prompt to set up the default email application on Mac

Prompting the user to set up an application they never use is far more effort than simply copy and pasting a URL into my preferred email client.

Choosing a share icon

Grid of various share icons in different variations.
There have been plenty of other share icons over the years.

There is no universal standardized share icon — far from it. While the Android symbol might not be recognizable to long-term iPhone users, the iOS icon is problematic. It is identical to the download icon — but with the arrow in the opposite direction, which would imply uploading, not sharing.

Where I work at giffgaff, we polled 69 of our colleagues on whether they recognized the current iOS icon or the current Android icon as representing sharing. The Android icon was an overwhelming winner with 58 votes. While our sample did include iPhone users, some long-term iPhone users may not be familiar with this symbol (even though it has been adopted by some websites). Then there is the forward arrow, an icon that was abandoned by Apple, but adopted elsewhere. Reminiscent of the icon for forwarding an email, this symbol has been made recognizable by its usage on youtube.com. The icon was adopted by Microsoft in 2017 after A/B testing found a high level of familiarity.

It’s also possible to take a contextual approach. Twitter will change the icon used depending on the platform of the user. This approach is also taken by the icon library Ionicons.

Showing the same tweet on both Android and iOS
Android (left) and Mac/iOS (right)

Given the lack of a universally understood icon, this seems like a good approach. Alternatively, make sure to include a label alongside the icon to really spell things out to the user.

The post UX Considerations for Web Sharing appeared first on CSS-Tricks.

Table with Expando Rows

"Expando Rows" is a concept where multiple related rows in a <table> are collapsed until you open them. You'd call that "progressive disclosure" in interaction design parlance.

After all these years on CSS-Tricks, I have a little better eye for what the accessibility concerns of a design/interactivity feature are. I'm not entirely sure how I would have approached this problem myself, but there is a good chance that whatever I would have tried wouldn't have hit the bullseye with accessibility.

That's why I'm extra happy when someone like Adrian Roselli tackles problems like this, because the accessibility is handled right up front (see the videos in all the major screen readers).

I feel the same way when we get demos from Scott O'Hara, Lindsey Kopacz, and Hedyon Pickering.

See the Pen
Table with Expando Rows
by Adrian Roselli (@aardrian)
on CodePen.

Direct Link to ArticlePermalink

The post Table with Expando Rows appeared first on CSS-Tricks.

90% Off: Get the Insta-Famous Photography Bundle for Only $19

For those who have a passion for photography, your social media feed can serve as your portfolio. This is the perfect landscape for getting exposure. With today’s smartphone, you can take stunning photos. If you want to level up your mobile photography and improve your Instagram feed, then the Insta-Famous Photography Bundle is for you. […]

The post 90% Off: Get the Insta-Famous Photography Bundle for Only $19 appeared first on designrfix.com.

Here’s Why Full-Stack Development Is Critical for IoT

When it comes to IoT development, full-stack engineers are likely the way to go.

The Internet of Things (IoT) is in the process of completely revolutionizing our daily routines, interactions with appliances, electronics, and even how we transport ourselves.

Companies like Philips, Xiaomi, Belkin, etc. have jumped into making IoT-capable smart devices, including devices like light bulbs, switches, air purifiers, and even general household appliances like Internet-enabled refrigerators and washing machines.

How to Effectively Harness the Power of AI in PCB Manufacturing

Printed Circuit Board. Source

The emergence of AI has also extended its application to the Printed Circuit Board (PCB) manufacturing industry with amazing subsets like machine learning and deep learning, whose characteristics can serve as a huge game-changer in designing PCBs.

Before we dive into how these technologies can positively impact the PCB industry, let's look at the power and benefits that AI possesses to bring to the table if applied in the PCB manufacturing process.