teleren/devto huggingface dataset:
We are hiring Java DEV (From Anywhere)
Tags: java, security, redis
Published: 2020-06-17 18:21:47

We are looking for a Senior Astronaut in Java who has knowledge or mastery of this Stack:

Java Core and Stack Spring Cloud (Microservices);
Cloud, Stream;
Gateway;
Zookeeper, Security, Config Server;
ReactiveX (Non Blocking IO Servers like Netty);
RESTful Design;
Security Oauth2, JWT and Asymmetric and Symmetric Cryptography;
Coding skills, automated tests and refactoring skills;
Data Frameworks;
Nosql (MongoDB sharding solution);
Streaming (Kafka);
In-Memory (Redis);
Relational Databases. (Mysql).

Monnos operates globally and is 100% officeless, you can work from anywhere in the world. Apply in the form below:

✅ https://monnos.zendesk.com/hc/en-us/articles/360049657694
Wednesday Links - Edition 2020-06-10
Tags: java, kotlin, database
Published: 2020-06-10 10:30:22

Chaos Monkey for Spring Boot - John Fletcher & Manuel Wessner @ Spring I/O Bridge ( 32 min ) 🐒
https://www.youtube.com/watch?v=WeQFMEBp8nw

Simple & effective G1 GC tuning tips ( 8 min read ) 🗑️
https://blog.gceasy.io/2020/06/02/simple-effective-g1-gc-tuning-tips/

JVM Pauses - It's more than GC ( 9 min read ) ⏸️
https://blanco.io/blog/jvm-safepoint-pauses/

Validate Spring Boot Configuration Parameters at Startup ( 7 min read ) 🛂
https://reflectoring.io/validate-spring-boot-configuration-parameters-at-startup/

Explaining Event Sourcing with Data Structures (1/3) ( 6 min read ) ♨️
https://4comprehension.com/explaining-event-sourcing-with-data-structures-1-3/

Upgrading ReadWriteLock ( 9 min read ) 🔐
https://www.javaspecialists.eu/archive/Issue279.html

Single-Primary Database Replication ( 4 min read )  🗄️
https://vladmihalcea.com/single-primary-database-replication/

Vaadin with Spring Boot 2.3.0 ( 20 sec read ) 🧩
https://twitter.com/simas_ch/status/1269560725225209859

Changing coding habits to be stream-friendly ( 1 min read ) 🚿
https://blog.frankel.ch/changing-coding-habits-stream-friendly/

Kotlin 1.4-M2 Released ( 4 min read ) 🙌
https://blog.jetbrains.com/kotlin/2020/06/kotlin-1-4-m2-released/

Migrating Spring Boot’s Build to Gradle ( 5 min read ) 🧳
https://spring.io/blog/2020/06/08/migrating-spring-boot-s-build-to-gradle
Breaking bootstrap container with css grid
Tags: html, css, bootstrap, webdev
Published: 2020-06-17 17:56:56


I recently had to develop a component where the interface had to exceed the limit of its container on one side, while the content on the other side remains inside the container.

In addition to breaking the container on one side, the width of the text and image could vary from card to card, as we can see in the figure below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gj3p42ol71u0n26k6ifs.jpg)

After imagining several different ways that I could do this, I solved the problem with CSS grid. Bearing in mind that the site uses the bootstrap grid, I deconstructed the bootstrap container into columns, where the middle columns correspond to the width of the container at the different breakpoints, and the first and last column corresponds to the rest of the space leftover from the container.

```scss
//card container
.cc {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: 350px;

  @media (max-width: 575.98px) {
    grid-template-columns: 15px repeat(10, 1fr) 15px;
  }

  @media (min-width: 576px) and (max-width: 767.98px) {
    //540px / 10
    grid-template-columns: 1fr repeat(10, 54px) 1fr;
  }

  @media (min-width: 768px) and (max-width: 991.98px) {
    //720px / 10
    grid-template-columns: 1fr repeat(10, 72px) 1fr;
  }

  @media (min-width: 992px) and (max-width: 1199.98px) {
    //960px / 10
    grid-template-columns: 1fr repeat(10, 96px) 1fr;
  }

  @media (min-width: 1200px) {
    //1140px / 10
    grid-template-columns: 1fr repeat(10, 114px) 1fr;
  }
}
```

Below we can see how to build the card.

```html
<div class="cc">
  <div class="tc tc--7-12">
    <p class="mb-0 text-body mlt">Lorem ipsum dolor sit amet.</p>
  </div>
  <div class="ic ic--1-6">
    <img src="https://images.pexels.com/photos/1287083/pexels-photo-1287083.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" alt="image">
  </div>
</div>
```

To give the perception that the image is coming out of the container it can use column 1 to column 13 (-1).

```scss
//image container
.ic {
  &--7-13 {
    grid-column: 7 / -1;
  }

  &--1-6 {
    grid-column: 1 / 6;
  }
}
```

For the text to be within the dimensions of the bootstrap container it can occupy columns 2 to 12.

```scss
//text container
.tc {
  align-self: center;
  &--2-6 {
    grid-column: 2 / 6;
  }

  &--7-12 {
    grid-column: 7 / 12;
  }

  //boostrap container padding
  @media (min-width: 576px) {
    padding-left: 15px;
    padding-right: 15px;
  }
}
```

I am sharing this because who knows, it may be useful for someone, the question is, did I complicate this? to see the complete example: [click here](https://codepen.io/flavio_amaral/pen/bGEwqLm)

{% codepen https://codepen.io/flavio_amaral/pen/bGEwqLm %}
Getting started with Git and Github
Tags: git, github, codenewbie, versioncontrol
Published: 2020-06-17 17:49:45

###**Steps for working on a new Project from scratch**:

*Precondition: You have already created a Github repository to commit codes to.*

1. **git init** (Initialize git repository)
2. **git status** (check for untracked and tracked files)
3. **git add .** (for all files) or **git add {filename}.** (for a specific file)
4. **git commit -m “message”** (save changes to the local repository)
5. **git remote add origin {remote url}** (connecting to Github repository)
6. **git push origin master** or **git push origin {branchname}** (pushing code from local to remote master branch or other named branch)


**Note** : *Please remember not to work on the master branch directly, always create different branches for different purposes.* To work on branch use the following command always before adding codes to the staging area:
**git checkout -b {branchname}**  

###**Steps to start working with other's repository and contributing**:

*Precondition: Fork the repository in Github which you want to contribute to.*

1. **git clone {remoteurl}** (Clones your fork repository in local. For first time user) 
or 
**git pull {original_repo_url} master** (To always pull the latest code from main repository, from second time don't clone but pull)

2. **git checkout -b {branchname}** (Change the branch from master to other)
3. **git add .** or **git add {filename}**
4. **git commit -m “message”** (save changes to the local repository)
5. **git remote add origin {remote url}** (connecting to Github repository)
6. **git push origin {branchname}** (pushing code from local to remote branch)
 

NOTE: **Post push request go to Github and create a pull request so that your changes can be added to the main program and be viewed by others too.**
Designing Data Intensive Apps — Um resumo
Tags: architecture, database, distributedsystems
Published: 2020-06-17 17:49:06

Estou lendo o livro [Designing Data Intensive Apps](https://amzn.to/2YaKEhB) e resolvi fazer esse resumo aqui para servir de referencia para algumas ideias principais explicadas no livro. Esse resumo não substitui a leitura do livro. Irei abordar os temas do livro de forma mais superficial e quem quiser se aprofundar, [leia o livro](https://amzn.to/2YaKEhB).

[Capítulo 1 — Sistemas de dados](https://dev.to/brenoferreira/designing-data-intensive-apps-um-resumo-390c)

[Capítulo 2 — Principais modelos de banco de dados](https://dev.to/brenoferreira/designing-data-intensive-apps-resumo-cap-2-4b75)

[Capítulo 3 — Como funciona o storage de um banco de dados](https://dev.to/brenoferreira/designing-data-intensive-apps-capitulo-3-1693)

[Capítulo 4 — Serialização e fluxo de dados](https://dev.to/brenoferreira/encoding-e-dataflow-4p60)

[Capítulo 5 — Dados distribuídos - Replicação de dados](https://dev.to/brenoferreira/dados-distribuidos-replicacao-de-dado-1n96)
Road to Genius: smart #20
Tags: javascript, beginners, computerscience
Published: 2020-06-17 17:48:27

Each day I solve several coding challenges and puzzles from Codr's ranked mode. The goal is to reach genius rank, along the way I explain how I solve them. You do not need any programming background to get started, and you will learn a ton of new and interesting things as you go.

![coding challenge](https://dev-to-uploads.s3.amazonaws.com/i/7945adlggiw49bp0tmpf.png)

Even though this challenge contains quite a lot of code, it's pretty easy to solve. We only need to fix the bugs 💧 and ☃️, so we don't even have to fully analyze & understand the code to complete it.

The first bug 💧 is easy since it's just the initial declaration of a variable, you can quickly skim through the code and you'll find that `profit` is the only variable that hasn't been declared yet, so that must be it.

The last bug ☃️ appears to be a function call, because it provides an argument `arr`, and the only function here is `maxProfit`.

![coding challenge answer](https://dev-to-uploads.s3.amazonaws.com/i/w57hjq88m3fkl8i0zotk.png)

Now that we've solved it, let's take a moment to analyze what the code is doing. It starts with an array `arr`, and then calls `maxProfit(arr)`. If you look closely at the for-loop, it starts from index 1 (instead of 0), then the if-statement checks whether the previous value from the array is smaller than the current value; if it is then: `profit = MathMax(profit, price - min)`. If it's not then `min = MathMin(min, price)`. In a nutshell its computing the profit with some specific requirements that we don't know (but can analyze).

---

Join me on the Road to Genius and upgrade your programming skills, at https://nevolin.be/codr/
Day 7 of #100DaysOfCode
Tags: 100daysofcode
Published: 2020-06-17 17:42:23

Today’s Progress: I have finished the Tesla Stats component of My Tesla Battery Range Calculator with React and Redux and completed all challenges in the CSS flexbox and CSS grid coding challenge at https://freecodecamp.org.

Link to work: https://github.com/Kyawkhaing444/react-tesla-range-calculator
Django: Add tweet button with plain HTML/CSS, no JavaScript
Tags: django, html, css, twitter
Published: 2020-06-17 17:34:35

Do you want to have "Tweet" button on your personal site without the need to use Twitter JavaScript library? You can, and it only takes a bit of code. Twitter supports special "intent" url which can be configured to pre-populate new tweet on Twitter.com.

In this post I will show you how I integrated this into my site to give the readers option to quickly tweet my posts if they choose. I am so far not using any JavaScript because I don't need it and I didn't want to change this just for Twitter.

Let's get started.

The first step is to prepare the url in Django and send it to template where it can be rendered inside `a` tag.
I have created this handy helper method:

```python
def get_tweet_intent(post: BlogPost):
    url = urllib.parse.quote('https://nemecek.be{0}'.format(post.get_absolute_url()))
    text = urllib.parse.quote_plus(post.title)
    tweet_intent = "https://twitter.com/intent/tweet?text={0}&url={1}&via=nemecek_f&hashtags={2}".format(text, url,
                                                                                                         post.category.hashtags)
    return tweet_intent

```

It expects instance of `BlogPost` which is my model class for posts and returns tweet_intent as a string.

I am using the `urlib.parse.quote` method to correctly encode the url and also the `quote_plus` variant to encode title. The difference is that the "plus" version also encodes spaces.

Then it is just a matter of constructing the url.

The format is this:

```javascript
"https://twitter.com/intent/tweet?text={tweet text}&url={url to link to}&via={ username or user id}&hashtags={ hashtags separated by comas}"
```

You can also check out the official [docs](https://developer.twitter.com/en/docs/twitter-for-websites/tweet-button/guides/web-intent).

Once you send it to the template as `tweet_intent` or anything else you want, you can create the element:

```django
<a class="tweet-button" href="{{ tweet_intent }}" target="_blank">Tweet</a>
```

And possibly some styles 🙂

```css
.tweet-button {
    float: right;
    padding: 5px 20px;
    background-color: #1DA1F2;
    color: white;
    border-radius: 5px;
}
```

The background color is the "Twitter blue".

And that is how you can create Tweet button with Django, HTML and CSS.
Using created_at field to improve pagination performance
Tags: ruby, mysql, postgres
Published: 2020-06-17 17:27:48

##Introduction
We know the pagination becomes very slow if we use `offset` based pagination alone, as time progress and the DB gets accumulated with a huge volume of records. 

This post is intended to give some hints on improving pagination performance.

---
Assume we have `posts` table with following fields
id
title
description
created_at
updated_at

Assume we have 1M records in the posts table.

```sql
  mysql> select * from posts order by created_at desc, title asc limit 20 offset 0; 
```
The query takes 0.08 secs. 

```sql
mysql> select * from posts order by created_at desc, title asc limit 20 offset 50000; 
```
The query takes 1.17 secs. 

```sql
mysql>select * from posts order by created_at desc, title asc limit 20 offset 75000;
```
The query now takes 2.60 secs. So the time gets increases when ever the offset value increases. 

To handle this one, we shall filter the records using `created_at` field and indexing the `created_at` field.

Step: 1 fetch the latest created record date

```sql
 mysql> select created_at from posts order by id desc limit 1
```
Assume we get the result as `2020-05-01 13:00:40.949669`

Now we shall use this `created_at` for pagination.

Fetching first page.

```sql
mysql> select * from posts where created_at <= '2020-05-01 13:00:40.949669' order by created_at desc, title asc limit 20
```
The query takes just 0.07 seconds. 

Assume the 20th record of the result as follows
```sql
  117414 | Money saving schemes | Personal Finance   | 2020-05-01 13:00:29.981149 | 2020-06-17 13:00:29.981493
```

Now to fetch the second page, we need to filter the records using the above `created_at` value. i.e `2020-05-01 13:00:29.981149`

Now the query will be
```sql
  mysql> select * from posts where created_at <= '2020-05-01 13:00:29.981149' order by created_at desc, title asc limit 20
```
The query takes same 0.07 seconds.

> The main advantage with this sort of pagination takes almost the consistent time i.e 0.07 secs (here) whenever we fetch any page. This type of implementation is well suited for `endless pagination`.
Align Strings using PadEnd
Tags: javascript, beginners
Published: 2020-06-10 08:25:22

![padEnd Img](https://i.imgur.com/46DLXEh.png)
Hi All,

Now we are going to talk about **Align Strings using PadEnd** as shown in the above image. If you are not familiar with padEnd then read [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) first.

Ok let's start.

####HTML: 

```
<div id="table"></div>
```

####JS:

```
let stringsMap = {
  Name: 'Alwar G',
  Age: '24',
  'Marital Status': 'single',
  Skills: 'HTML, CSS, JS'
 };
 let objKeys = Object.keys(stringsMap);
 let keysSpace = Math.max(...objKeys.map(el => el.length));
 let table = document.getElementById('table')
 objKeys.forEach((key) => {
   let ele = document.createElement('pre');
   ele.innerHTML = `${key.padEnd(keysSpace)}: ${stringsMap[key]}`;
   table.appendChild(ele);
  });
```

Here we have `strings map` to disaplay the details. From the `strings map` we need to find which key string is the longest string in the keys. For that first we need to get all key strings length. that is 

```
let objKeys = Object.keys(stringsMap);
objKeys.map(el => el.length);
// [4, 3, 14, 6]
```
After this we should find the longest number from the above array

```
Math.max(...objKeys.map(el => el.length));
// 14
```

Now we got the maximum string length. So, we need to align the strings based on this length. Here `PadEnd` will play a virtual rule. How?🤔
let's see

```
let table = document.getElementById('table')
objKeys.forEach((key) => {
  let ele = document.createElement('pre');
  ele.innerHTML = `${key.padEnd(keysSpace)}: ${stringsMap[key]}`;
  table.appendChild(ele);
 });
```
While iterating object, we are creating the pre element and append this element to the `table` div.

Also we are setting the innerHTML of pre element as `${key.padEnd(keysSpace)}: ${stringsMap[key]}`. Here `key.padEnd(keysSpace)` will make the needed space to make the correct alignment.

Now we got the output.

![got it](https://i.imgur.com/jggWglj.gif)

Thanks for reading. I hope you enjoyed this post.
Create Chatbot with Dialogflow webhooks, Python, & AWS Lambda
Tags: tutorial, aws, python, chatbot
Published: 2020-06-17 17:11:04

{% youtube q9cTrLLoRg8 %}
Let's understand, How to create a chatbot with Dialogflow webhook, Python, AWS Lambda, and DynamoDB. In this video, the main focus will be to connect your webhook to your database for a dynamic response from your chatbot. I have used Python in AWS Lambda and DynamoDB for Database but you can use your languages and database that you are comfortable in. 

You can create your own client-side chatbot using NodeJs and Python sample code link given below

NodeJS: https://github.com/googleapis/nodejs-dialogflow
Python: https://github.com/googleapis/dialogflow-python-client-v2

Github: https://github.com/codingx01
Twitter: https://twitter.com/TechParida
Linkedin: https://www.linkedin.com/company/codingx/
Facebook: https://www.facebook.com/codingx
Instagram: https://www.instagram.com/coding.x/

Please do Like, Share, Comment, and Subscribe!
React Animation with Framer Motion
Tags: react, javascript, webdev, frontend
Published: 2020-06-17 17:07:19

---
title: React Animation with Framer Motion
published: true
description: Animate your React Project using Framer Motion Library
tags: #ReactJs #JavaScript #webdev #frontend
---

# Getting Started

It's time to advance you React project, make more interesting add some animation. if you've ever tried in react to add transition you may feel bad, so let's introduce you a simple Library which gets the job done without any pain, so let's install the package first:

```
npm install framer-motion

# Yarn
yarn add framer-motion
```

It's good idea to create new react project then install the `framer motion` in it.

First import the package:
```
import { motion } from "framer-motion";
```

the framer-motion is all about `<motion>` component, and the second `<motion.div>` is html elment what you want to animate, cause without element nothing happen in even css, the animation is being controlled by `<motion.h1>` whenever you want to animate you UI you should invoke motion component

```
return (
   <motion.div>
      Hello, Framer-Motion
   </motion.div>
)
``` 

What happened nothing, wait there is another thing to introduce `animate` props, there we define our animation logic, like opacity, color and so on... accepts all the CSS properties.
let's give it short:
```
return (
   <motion.div animate={{ opacity: 0, x: 300}}>
      Hello, Framer-Motion
   </motion.div>
)
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yslzfecgrq1u5l6trkcl.gif)


isn't cool?! but it too fast let's make it a little bit slow, if you remember I said we can use CSS properties in Framer-Motion it's time to use the `Transition: duration`:

```
<motion.div 
      animate={{ opacity: 0, x: 300 }} 
      transition={{ duration: 3 }}>
      Hello, Framer-Motion
</motion.div>
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/m3b1kil8c0pbzfifwuik.gif)

[SandBox](https://codesandbox.io/s/dreamy-grothendieck-g6bjl?file=/src/App.js:139-272)

I hope tomorrow I'll post another post, that's it for now, thanks for your valuable time!

Resources:
https://www.framer.com/api/motion/animation/
Video: https://www.youtube.com/watch?v=2V1WK-3HQNk&list=PL4cUxeGkcC9iHDnQfTHEVVceOEBsOf07i
A OS Cleaner for Debian Based Linux distributions !
Published: 2020-06-17 17:03:58

I have written a python script that will show and delete the unnecessary caches and files from a operating system (debian based ).
### This sript will clear the :
- packages that are no longer required
- Clean up APT cache
- systemd journal logs (more than 7 days)
- Clean the thumbnail cache

Most of the time these files takes a lot of storage !
and using a bunch of commands to remove them are quit boring .
So i have gathered the commands  and added them in a python script.
[Here is my git repo have a look](https://github.com/jspw/Cleaner) 

Usages :
  - Clone repo :`git clone https://github.com/jspw/Cleaner.git`
        
  - Chnage directory : `cd Cleaner`
        
  - Check the caches : `sudo python cleaner.py -s`
    
  - Clear the caches : `sudo python cleaner.py -c`

feel free to suggest any option or command to add or report  any error in the script .
**Thanks**
d
Tags: deno, versionmanager, javascript, typescript
Published: 2020-06-17 16:56:14

---
title: d
published: true
description: A Deno-invoking version manager for Deno
tags: deno, versionmanager, javascript, typescript
//cover_image: https://direct_url_to_image.jpg
---

# d, a Deno-invoking version manager for Deno

This is a simple shell script that invokes a specified Deno version, including downloading & extracting it if it doesn't exist.  It's similar in spirit to the various [dvm](https://github.com/search?q=dvm) forks, but is written in `sh` (not even `bash`, so should work everywhere, except Windows, for which MRs are welcome).

Examples below assume `d` is in your path.

Pass all arguments along the latest version of `deno`:

```
$ d --version # delegates to latest deno
deno 1.1.0
v8 8.4.300
typescript 3.9.2
```

Pass all arguments along to a specific version of `deno`:

```
$ d --use 1.0.0 -- --version # use a specific version of deno
deno 1.0.0
v8 8.4.300
typescript 3.9.2
```
Invoke a script using the latest version of deno:

```
$ d run https://deno.land/std/examples/welcome.ts
Download https://deno.land/std/examples/welcome.ts
Warning Implicitly using master branch https://deno.land/std/examples/welcome.ts
Compile https://deno.land/std/examples/welcome.ts
Welcome to Deno 🦕
```

Currently in prerelease form.

Available at https://gitlab.com/northscaler-public/d.
File issues at https://gitlab.com/northscaler-public/d/-/issues.
Mirrored to https://github.com/northscaler/d.

Enjoy!
auto-py-to-exe
Published: 2020-06-17 16:40:53

I'm sorry if this is in the wrong spot, but it seemed that I had to start a new post.

I was delighted to see the Python to EXE program.  It seemed to work perfectly (I picked just one file to test) but in Windows 10 I got the error shown in the picture.  I hope there is an easy fix!

And I hope the picture shows - it doesn't in the preview, but here's most of the message:  "The program or feature cannot start or run due to incompatibility with 64-bit versions of Windows."
Let's Look at Networking Modes
Tags: linux, webdev, beginners, devops
Published: 2020-06-17 16:38:20


Many of us, confused about Networking Modes. I hope this will helps you to understand.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hxzv150nhmja3c572zup.jpeg)


👌 Thanks for your time & passion. Feel free to ask me anything.
If you have any issues & queries. [Follow me on Twitter ](https://twitter.com/eng_sadhan)