teleren/devto huggingface dataset:
How Aesthetics Help Developers/Programmers
Tags: productivity, aesthetics, mentalhealth
Published: 2019-12-17 15:39:39

Developers, Programmers are work so hard: they work hard using their brains. According to researches, people who work using their brains and work physically both need to care about themselves. When the brain gets tired, our body simultaneously gets tired because the mental situation matters everything.

## Your Brain at Work
Your brain is the most significant part of your body. You cannot work without it. When you are working, all the command is given by your brain. Your thinking process is much t complicated than you think. Your brain does loads of work while you are working. It gets tired than you think, It causes you to get distracted, bored, and lose productivity.
So, it is important to concern these situations.

## Why aesthetical things?
The above-mentioned situations are common among developers and programmers. They get distracted, get bored while they are working. These problems lead to losing their productivity.
That is why aesthetical things are for.

## What are aesthetical things?
There are many aesthetical things that exist. Among them, below things help you to get rid of the above-mentioned problems.
1. Music
2. Illustrations

### Music

Music is the best cure. You can use light music, baroque music, modern music: you can use any kind of music you prefer.
Neurologists say, listening to light music or baroque music is good for brain efficiency and health. Music interacts with your beta, theta and alpha waves in a very good manner. It helps you to [improve productivity](https://groups.hyvor.com/Productivity/169/how-to-improve-productivity-with-a-healthy-life), get rid of stress, to be energetic. It also helps you to bring the best in you. You will be able to work per day more than you did. Many developers and programmers say that music helps them to concentrate while coding or developing. Music helps to keep concentrated. People all over the world use music to concentrate.

### Illustrations
Illustrations are one of the aesthetical things people use for their needs. As developers and programmers, you can choose illustrations you like and paste or hang them on your wall. Whenever you get distracted, bored, you can stare at these illustrations and get back to work. There are especially drawn illustrations for concentration, mind healing, etc. Staring at illustrations helps you to improve productivity, get rid of stress. You will not get bored while working as you have illustrations with you.

Enjoyed reading? Please feel free to comment if you have any questions or suggestions. And, I suggest you to share your personal experience of this topic through comments.
Day 25 of⚡️ #30DaysOfWebPerf ⚡️: Jank
Tags: webperf, webdev, performance, css
Published: 2019-12-17 15:35:14

{% twitter 1206959707509923840 %}
{% twitter 1206959708701184000 %}
{% twitter 1206959709485518849 %}
{% twitter 1206959710890549248 %}


---

This article was originally published on [sia.codes](https://sia.codes/). Head over there if you like this post and want to read others like it, or sign up for my [newsletter](https://buttondown.email/sia.codes) to be notified of new posts!
Linux find command tutorial
Tags: linux, tutorial, opensource
Published: 2019-12-17 15:28:48

---
title: Linux find command tutorial
published: true
description: 
tags: #linux #tutorial #opensource
---

1 Find a directory
2 Find hidden files
3 Find files of a certain size or greater than X
4 Find from a list of files
5 Find not in a list
6 Set the maxdepth
7 Find empty files (zero-length)
8 Find largest directory or file
9 Find setuid set files
10 Find sgid set files
11 List files without permission denied
12 Find modified files within the last X days
13 Sort by time
14 Difference between locate and find
15 CPU load of find command

https://likegeeks.com/linux-find-command/
Giving Thanks for Diversity in Tech: Jen Luker
Published: 2020-01-07 00:26:20

---
title: Giving Thanks for Diversity in Tech: Jen Luker
published: true
date: 2019-12-17 15:28:11 UTC
tags: 
canonical_url: https://www.thisdot.co/giving-thanks-for-diversity-in-tech-jen-luker
---

![image0](//images.ctfassets.net/zojzzdop0fzx/73U4TF0ymc1JOWOGIRJfRP/c559ced1f143289053465e982e2b42f1/image0.jpeg)

Jen Luker is a Senior Front End Engineer at Gremlin, whose areas of expertise include React, PHP, and Accessibility. 

Not only is Jen a talented developer, but she is also a prolific speaker, regularly giving talks on accessibility, the history of programming, as well as imposter syndrome- a term which represents the tendency for some to believe that they are inadequate, despite successes that they experience within their jobs.

When asked what advice she would give to other women who want to pursue careers in tech, she shared, “Don't let anyone dictate to you what you are allowed to love, or how you are allowed to love it. How a technology works, and how that tech can be used to solve problems, are two sides of the same coin. Find what drives you to learn this tech, and own it.”

But, of course, Jen hopes that a greater push towards inclusion in tech will help people from underrepresented groups feel more welcomed and empowered to succeed within the industry.  She shared, “My favorite inclusion quote: ‘Diversity is when you count the people. Inclusion is when the people count.’ It isn't enough to just include a diverse group of people. The people should feel like they belong.”

Jen has a ton to look forward to in the next year! On April 17, 2020, she will be making her first international conference appearance at React Summit in Amsterdam.  But if you want to catch her before then, you might find her at the yarn store, picking up knitting supplies, or at the library, taking out a new book to read!

If you would like to know more about Jen, or keep up with everything she is doing in the next year, you can follow her on Twitter, [@knitcodemonkey](https://twitter.com/knitcodemonkey).
Adventures in game image editing
Tags: gamedev, assets
Published: 2019-12-17 15:23:49

I learned an important lesson in game development the other day: If you're going to do it all by yourself, at least put the effort in everywhere, including the parts you're not so good at (for me, that is art) so you don't look like a fool.

Case in point: The "bat" monster image didn't look at all like a bat. The body was WAY too big, the wings too small, the eyes were all wrong, and the talons were in the wrong place on its body. These issues are all fixed in the new version: ![Bat diff](https://siteicon.puttysoftware.com/bat_diff.png "Old vs. New Bat monster image")

Note that the image is intentionally grayscale, because the game recolors it for display - Bats, like all the game's monsters, have various elemental variations - Fire, Electric, Water, etc. - and the game applies RGB reduction rules to the base image to produce the final results. For the case of the Fire Bat, the relevant rule is Red 100%, Green 0%, Blue 0% - this results in a red bat.
Matt's Tidbits #47 - Finding list items by title in Espresso
Tags: mattstidbits, android, kotlin, espresso
Published: 2019-12-17 15:16:00

[Last week I shared a helpful feature in Android Studio — Scratch files.](https://medium.com/@matthew.b.groves/matts-tidbits-46-scratch-files-3a61c5fed851) This time, I want to tell you all about how to match items in a Recycler View by title.

If you’re not familiar with it, [Espresso](https://developer.android.com/training/testing/espresso) is a powerful UI test automation framework for Android. Some things are fairly easy to do — clicking on a particular button looks like this:
`onView(withId(R.id.button)).perform(click())`

However, things get much more complicated when you’re working with RecyclerViews — especially when trying to interact with an item contained inside of one.

Espresso operates under the same restrictions as someone using the phone — if the item isn’t visible on the screen, Espresso can’t click on it or “see” it in order to verify or interact with it. This presents an interesting challenge as your UI tests may work fine on one device, but switching to one with a different screen size can cause your tests can fail unexpectedly.

Fortunately for us, Google has provided some helpful utilities specifically for working with Recycler Views: https://developer.android.com/reference/androidx/test/espresso/contrib/RecyclerViewActions

The `RecyclerViewActions.actionOnItem()` method looks perfect for our purposes, and has the added benefit of automatically scrolling to the right view before trying to act on it — thereby eliminating the unexpected failures due to differences in screen size.

To use this method to find an item based on its title though, we’re going to have to define a ViewMatcher:
{% gist https://gist.github.com/mpeng3/c2577864f2f615eb36b0632101e09456 %}

Armed with this helpful function, we can now use this matcher like this:
{% gist https://gist.github.com/mpeng3/1efa876ef2957d9d516675e8889bb375 %}

If you’re already using Espresso in your project, the only additional import you need to add to your `build.gradle` file is:
`androidTestImplementation("androidx.test.espresso:espresso-contrib:<version>")`

Test this out and let me know in the comments what other useful custom Espresso matchers you have defined in your project! And, please follow me on Medium if you’re interested in being notified of future tidbits.

Interested in joining the awesome team here at Intrepid? [We’re hiring!](https://www.intrepid.io/careers)

_This tidbit was discovered on April 12, 2019._
Do You Make New Year's Resolutions?
Tags: discuss
Published: 2019-12-17 14:44:32

---
title: Do You Make New Year's Resolutions?
published: true
description: 
tags: discuss
---

The new year is approaching, for some it's just an arbritrary thing, for others a new possibility.

Some of the resolutions I had in the past worked out great (blogging, training), but some didn't (learning Spanish, writing a second book)

How do you handle new years resolutions?
Daily Challenge #138 - Keep Up the Hoop
Tags: challenge
Published: 2019-12-17 14:28:01

---
title: Daily Challenge #138 - Keep Up the Hoop
published: true
series: Daily Challenge
description: Write a program where Alex can input (n) how many times the hoop goes round and it will return him an encouraging message
tags: challenge
---
Alex just got a new hula hoop, he loves it but feels discouraged because his little brother is better than him

Write a program where Alex can input (n) how many times the hoop goes round and it will return him an encouraging message :)

- If Alex gets 10 or more hoops, return the string "Great, now move on to tricks".

- If he doesn't get 10 hoops, return the string "Keep at it until you get it".

***
_This challenge comes from Tam Borine on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Jenkins Installation Windows  
Tags: devops, beginners, linux, ubuntu
Published: 2019-12-17 14:26:08


jenkins installation on windows is a quite easy and a good way to automate windows tasks, you can install Jenkins on Linux and install Jenkins slave on ubuntu and windows. By Jenkins deployment automation we can automate so many Windows tasks and run batch and PowerShell script remotely. Folder and File Backups can be automated using Jenkins.

What can Jenkins do?
1.Run an internal commands and script
2.Perform the code compilation & build the software with Maven or Gradle.
3.Monitoring the execution of the above tasks.
4.Schedule the Job or task to execute.
5.Run build as per action item define.
6.Run JOB in one or multiple remote servers in the parallel or serial way
7.Provision to stop the build in case of failure in any of the steps.
8.Notifying the user of the success or failure of each build.

Read the original article for more details steps:-

https://www.onclick360.com/jenkins-installation-windows/
Kubernetes Automatic Scaling
Tags: kubernetes, devops, docker, autoscaling
Published: 2019-12-17 13:38:31

What is Scaling?
Scaling means the practice of adapting your infrastructure to new load conditions. If you have more load, you scale up to enable the environment to respond swiftly/on-time and avoid node-crash. When things cool down and there isn’t much load, you scale down to optimize your costs. Scaling can be thought of in two ways:

Vertical Scaling: this is when you increase your resources. For example, more memory, more CPU cores, faster disks, etc.
Horizontal scaling: this is when you add more instances to the environment with the same hardware specs. For example, a web application can have two instances at normal times and four at busy ones.
Notice that, depending on your scenario, you can use either or both of the approaches.

However, sometimes the problem is when to scale. Traditionally, how much resources the cluster should have or how many nodes should be spawned were design-time decisions. The decisions were a result of lots of trial and error. Once the application is launched, a human operator would watch over the different metrics, particularly the CPU, to decide whether or not a scaling action is required. With the advent of cloud computing, scaling became as easy as a mouse click or a command. But still, it had to be done manually. Kubernetes is capable of automatically scaling up or down based on CPU utilization as well as other custom application metrics that you can define. In this article, we will discuss how you can optimize your application for autoscaling using the Horizontal Pod Autoscaling. Also how you can use Kubernetes on a cloud provider to increase the number of worker nodes if necessary.

How Horizontal Pod Autoscaling (HPA) Works
Controllers like Deployments and ReplicaSets allow you to have more than one replica for the Pods they are managing. This number can be managed automatically by the Horizontal controller. You enable the Horizontal controller through the HorizontalPodAutoscaler resource. Like other controllers, the HPA periodically scans the Pod metrics and the current number of replicas. If there’s a need for more Pods, it increases the number of replicas for the target controller (Deployment, ReplicaSet, or StatefulSet). Let’s discuss this operation in a little more detail.
Ordinary Puzzles – An open-source mobile puzzle game built with React-Native
Tags: showdev, githunt, reactnative, typescript
Published: 2019-12-17 13:15:41

---
title: Ordinary Puzzles – An open-source mobile puzzle game built with React-Native
published: true
description: Ordinary Puzzles is a free and open-source mobile puzzle game built with React-Native, TypeScript and MobX.
tags: #showdev #githunt #reactnative #typescript
---

I just published **Ordinary Puzzles**, an open-source mobile puzzle game with React-Native, in the App Store and in the Play Store.   

{% github https://github.com/mmazzarolo/ordinary-puzzles-app %}

Any kind of discussion or feedback is warmly welcome!
Set a Cookie with CSS
Tags: css, php, webdev, html
Published: 2019-12-16 22:26:08

I try to learn new stuff by creating challenges for myself and often end up becoming a full fledged project. 

This time was the challenge to do a project on CSS, HTML & PHP no database, store the data on json or as flat file system just to give you some context. 

Now it came the part where a cookie would solve some issues like storing the data for the user options but I did not like the fact to refresh the page just to setup a cookie. 

Right at that moment I remembered:
Crooked Style Sheets - https://github.com/jbtronics/CrookedStyleSheets 

This guy did a basically tracking system in CSS by using the background-image url value to call a php link where you can do whatever action you choose.

So here is what I did: 

```css
#dark-mode:checked~main [for="dark-mode"]::after {content: url('/?a=dark-mode')}

/* Previous solution looks a bit ugly but it can be set as background-image also*/ 
#dark-mode {background-image: url('/?a=dark-mode')}
```

Actions on php:

```php
$action = false;

if (isset($_REQUEST['a'])) {
    $action = $_REQUEST['a'];
}

switch ($action) {
    case "dark-mode":
        setcookie("Dark Mode", "active", time() + (86400 * 365), "/");
        break;
    case "light":
        setcookie("Dark Mode", "", time() - 3600);
        unset($_COOKIE['Dark Mode']);
        break;
}
```
Note that I unset the cookie instead of just changing the content on case:light 

The most interesting fact is when you set a cookie this way you see how the cookie will appear directly. 

Based on this then I setup a conditional statement for the checkbox
```php
 if(isset($_COOKIE['Dark Mode']) && $_COOKIE['Dark Mode'] == "active") { echo "checked" ; }
```

And here you are free to refresh and even close the tab with settings stored. 

Basically this is just to scratch the surface but it opens doors to a lot more possibilities.

However special attention is needed on macOS Safari.

Right now is not possible to have modifiers on url() but that is subject to change at least will hope so.

Some examples: 
```css
.selector { background-image: url(/img/attr(data-bg).webp) }
```
Or set cookie based on attribute
```css
.selector { content: url(/?action=attr(data-action)) }
```

"url-modifier" is still a experimental API
https://developer.mozilla.org/en-US/docs/Web/CSS/url()

Bonus: 
```css
/* this works too if you want to call action on page load */
body { background-image: url(/?action=action_name) }
```

Thanks for reading. 
Astrit.
Storybook + default style for all stories
Tags: react, storybook, styledcomponents
Published: 2019-12-17 13:06:51

---
title: Storybook + default style for all stories
published: true
description: Import a global style for all stories
tags: react, storybook, styled-components
cover_image: https://spin.atomicobject.com/wp-content/uploads/20171218101858/storybook.png
---

[Storybook](https://storybook.js.org/) is an excellent tool to improve, organize, and test your components. Today I work with ReactJS and styled-components, and storybook, but Vue, Angular, Mithril, Marko, HTML, Svelte, Meteor, Ember, Riot and Preact are currently supported.
This library has  44k+ stars on GitHub with MIT License.

## Install

In the following examples the "create-react-app", "styled-components" and "storybook" will be used.

**create-react-app**

> $ npx create-react-app my-app


> $ cd my-app


> $ npm install


**styled-components**


> $ npm install --save styled-components


**storybook**


> $ npx -p @storybook/cli sb init --type react


> $ npm i -D @storybook/addon-info


## Run storybook


> $ npm run storybook


**Note:** If you had some problem to run it, try to reinstall. `npm install`


## Global Style

I created a file **"globalStyle.js"** with some styles like colors, typography, etc...


```jsx
import { createGlobalStyle } from "styled-components";

export const GlobalStyle = createGlobalStyle`

 * {
    padding: 0;
    margin: 0;
    color: navy;
  }

  body {
    background-color: #f2f2f2;
  }
`
```

## How to config the loader

In the folder **.storybook/**  has a file with the name **config.js**. To apply the global style for all components into your project, you can use this code below.

**Note:** 

you need to change the name of **require.context( )** depending on the structure.

Make sure that you have **react**, **react-dom**, **@babel/core**, and **babel-loader** in your dependencies.

```jsx

import { withInfo } from "@storybook/addon-info";
import { configure, addDecorator } from "@storybook/react";
import { GlobalStyle } from "../src/globalStyle"
import * as React from "react";

const req =  require.context('../stories', true, /\.stories\.js$/);

addDecorator(withInfo());
addDecorator(style => <><GlobalStyle />{style()}</>);

configure(req, module)

```

## Conclusion

After this, you only need to stop and restart your project, and all the components will have a new style.
I hope this post can help you.

Thanks!!
About Go's simplicity; prefetching; & DBs for serverless
Tags: todayilearned, database, serverless, go
Published: 2019-12-17 13:00:09

*TL;DR notes from articles I read today.*

### [The value in Go’s simplicity](http://bit.ly/36uEF8J)

- Super strong forward compatibility with careful attention to versioning and dependency. Libraries are super stable, and you can have very few external dependencies. 
- Great restraint to add ‘good-to-haves’ versus what you really need. So you get only two generic(ish) data structures of arrays (slices) and dictionaries (maps). 
- It comes with almost everything you need: the basic go test framework for testing; a sync package that covers most sync primitives that you may need; and an encoding package that works with json, xml, csv and other common formats.
- The internal formatting tool gofmt provides enough consistency that your code looks idiomatic. This makes open-source code a lot more readable too. 

*[Full post here](http://bit.ly/36uEF8J), 5 mins read*

---

### [All about prefetching](http://bit.ly/2LH5xds)

- Network Information APIs allow you to use different strategies for different connection types to improve prefetching performance.
- Four common prefetching strategies are as follows. Many websites use a combination of these. 
    - Interaction-driven - uses mouse and scroll activities as signals
    - State-driven - uses current page or URL to prefetch next logical step
    - User-driven - matches each specific user’s patterns of past usage, account information, etc
    - Download everything - so all the links in a page or all the bundles for an app.
-  The prefetch resource hint can be used to prefetch on all major browsers except Safari. You can either manually add prefetch resource hints with no dependencies or build tools based on developer configurations or use dedicated prefetch tools such as quicklink, Guess.js or Gatsby.

*[Full post here](http://bit.ly/2LH5xds), 7 mins read*

---

### [Databases that play nice with your serverless backend](http://bit.ly/2sjX2hu)

- Modern cloud-native DBs, that expose stateless REST APIs, work best for serverless computing.   
- Amazon’s Aurora Serverless variant scales to demand, resizes to meet storage capacity and handles routine maintenance as a managed service. Its Data API feature works with SQL DBs. 
- With Amazon DynamoDB, designing your data to work it while supporting access patterns is hard. Complex queries can be tricky too. 
- Microsoft’s Azure Cosmos works with several APIs & supports multiple data models. It lets you choose the exact tradeoffs between performance & consistency. 
- Google’s Cloud Firestore works well for web and mobile apps. It has built-in security without requiring a backend and it syncs across clients in realtime. 

*[Full post here](http://bit.ly/2sjX2hu), 7 mins read*

---

*[Get these notes directly in your inbox every weekday by signing up for my newsletter, in.snippets().](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
A cute crab in single div
Tags: codepen, css, saas, html
Published: 2019-12-17 12:56:55

Have you ever watched a crab walking back and forth in the sand?
No worries. A cute crab made of a div is crawling backwards and forwards at CodePen output window. 

Track the crab here,
{% codepen https://codepen.io/sabitha_kuppusamy/pen/qBENzpw %}
Microservices: OAuth2 vs Simple JWT Authentication
Tags: help, security, microservices
Published: 2019-12-17 12:44:12

I am trying to figure out, how I should implement the security for my microservices architecture.


For example, I have a client(web), a gateway and some other microservices.

Now I am thinking, should I implement my own Authentication/Authorization server(not an OAuth2), which will just authenticate the user? Or should I just pick a standard like [keycloak](https://www.keycloak.org/) or [uaa](https://docs.cloudfoundry.org/api/uaa/version/74.4.0/index.html#overview)?

Does it make sense to use a fully OAuth2 capable server?