teleren/devto huggingface dataset:
Info About Omegle 
Tags: chat, freechat
Published: 2021-09-07 10:10:40

Here's the link for every stranger who comes to this site. Begin to chat with Omegle's <a href="https://omegle.us.org/">Omegle</a> strangers section and you'll be able meet anyone from any place across the globe. To make the chat enjoyable and exciting, use filters that are appropriate. There are filters that can be applied to gender and language , as well as country. Be sure to apply these filters to find the chat guy in your preferred country.
How to create a type for complex JSON object in TypeScript?
Tags: typescript, javascript, node, json
Published: 2021-09-07 10:00:15

Imagine having to deal with a complex JSON object and still having TypeScript typecheck in place. The complex objects cause us to use **any** in the code in order to navigate around the Typecheck of TypeScript. 

Sometimes, we may also have to turn off the linter rules in order to make this work.

```javascript
// eslint-disable-next-line @typescript-eslint/no-explicit-any
```

```javascript
private modifyRecord(record: any) {...}
```

We can define our custom types like below:
```javascript
type JSONValue =
    | string
    | number
    | boolean
    | JSONObject
    | JSONArray;

interface JSONObject {
    [x: string]: JSONValue;
}

interface JSONArray extends Array<JSONValue> { }
```
These kind of type is known as Recursive Type Aliases. After TypeScript 3.7 we can also define it in a confined way:

```javascript
type JSONValue =
    | string
    | number
    | boolean
    | { [x: string]: JSONValue }
    | Array<JSONValue>;
```

JSONValue circularly references itself.

Happy coding!

PS: Don't use **any** in the TypeScript.
What do you think about web design? Need your opinion...
Published: 2021-09-07 09:35:18

Hello guys, I'm a UI/UX designer and just recently I've been asked to create this website http://RealSpyApps.com. this is my best project thus far, could you give me any pointers on how I could improve? I'm still a junior designer and looking for all possible feedback. I've spent a lot of time on this client :) I attached some screenshots to take a look. 

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

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/33y5l66e5q8rgs5s7wou.jpg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfbh1itt700js5ppeb1f.jpg)
AWS: Cost Explorer -  costs checking on the CloudWatch Logs example
Tags: aws, devops
Published: 2021-10-01 07:54:52

---
title: AWS: Cost Explorer -  costs checking on the CloudWatch Logs example
published: true
date: 2021-09-07 09:17:39 UTC
tags: aws, devops
canonical_url: https://rtfm.co.ua/en/aws-cost-explorer-costs-checking-on-the-cloudwatch-logs-example/
---

### AWS: Cost Explorer -  costs checking on the CloudWatch Logs example

![](https://cdn-images-1.medium.com/max/1024/1*8QppZuMnRQSngTE4H4UqzA.png)

This post isn’t an overview of the AWS Cost Explorer service, but just a quick example of how to detect costs for your AWS account and its services.

So, when I came back from the [vacation](https://rtfm.co.ua/poezdka-v-kemer-turciya-foto/), I noticed that we’ve paid more than usually for the AWS CloudWatch for August — almost 50 dollars per day (included to the _Others_ on the graph below):

![](https://cdn-images-1.medium.com/max/1024/0*RlMtvsH33qke7ZNN.png)

To find out, what exactly in CloudWatch spends our money, in the _Filters_ choose the _CloudWatch_, and in the _Group by_ use the _Usage type_:

![](https://cdn-images-1.medium.com/max/1024/0*vW-hd3kTSbLJscXX.png)

And we can see, that DataProcessing-Bytes increased a lot during August, and this is the first point to the CloudWatch Logs.

Let’s check if it is so — switch _Group by_ to the _API Operation_:

![](https://cdn-images-1.medium.com/max/1024/0*yzIJGs-VD-kYlW6Y.png)

Wow! Now we can see, that from the 50 dollars per day we are paying 40 only to write new events to the CloudWatch Logs! The API operation name [PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) speaks for itself.

Okay, now we need to find out which Log Group generates most of all from the traffic.

Go to the CloudWatch Metrics, choose _Logs_ — _Log Groups Metrics_:

![](https://cdn-images-1.medium.com/max/949/0*FfxxCtWQqKYqMtPj.png)

Here, select all the IncomingBytes, and you'll see activity per all your Log Groups:

![](https://cdn-images-1.medium.com/max/1024/0*EUIBI0jesWyU09XI.png)

At the top, we have an Aurora cluster that has general log enabled for the monitoring, a one EKS cluster, our Dev environment, where we have a lot of activities, and a _cloudtrail-bttrm-management-events_ Log Group, where we have our CloudTrail activities, see [AWS: CloudTrail overview and integration with CloudWatch and Opsgenie](https://rtfm.co.ua/en/aws-cloudtrail-overview-and-integration-with-cloudwatch-and-opsgenie/).

So, the final thing is to tune those services’ logging settings.

For the CloudTrail we can disable logging about Write operations, as we didn’t use them for alerting, and exclude some AWS KMS and AWS RDS logging:

![](https://cdn-images-1.medium.com/max/826/0*sBh3yMhR7LdIXDE7.png)

And for the EKS cluster — disable all or a set of logs:

![](https://cdn-images-1.medium.com/max/886/0*BIYOHtrmYvNN6oaw.png)

Done.

_Originally published at_ [_RTFM: Linux, DevOps, and system administration_](https://rtfm.co.ua/en/aws-cost-explorer-costs-checking-on-the-cloudwatch-logs-example/)_._

* * *
Best Centos Docker Server
Published: 2021-09-07 08:54:43

Fast install for docker on Centos

```
sudo yum install -y yum-utils
sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo docker network create web
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

```
free udemy courses
Published: 2021-09-07 08:50:38

We have these FREE courses lined up for you for a limited time on UDEMY

Don't miss them !!

Code : FREESEP1

Validity: 9th Sep 2021

JavaScript - Basics to Advanced [step by step (2021)]


https://www.udemy.com/course/javascript-basics-to-advanced/?couponCode=FREESEP1&utm_term=98170214&utm_content=promo&utm_source=email-sendgrid&utm_medium=3033186&utm_campaign=2021-09-07
ENROLL NOW!

Python Programming - From Basics to Advanced level [2021]


https://www.udemy.com/course/python-programming-beginner-to-advanced/?couponCode=FREESEP1&utm_source=email-sendgrid&utm_medium=3033186&utm_campaign=2021-09-07&utm_term=98170214&utm_content=promo
ENROLL NOW!

The Complete ReactJs Course - Basics to Advanced (2021)


https://www.udemy.com/course/react-js-basics-to-advanced/?couponCode=FREESEP1&utm_source=email-sendgrid&utm_medium=3033186&utm_campaign=2021-09-07&utm_term=98170214&utm_content=promo
ENROLL NOW!

Machine Learning- From Basics to Advanced


https://www.udemy.com/course/step-by-step-guide-to-machine-learning-course/?couponCode=FREESEP1&utm_term=98170214&utm_content=promo&utm_source=email-sendgrid&utm_medium=3033186&utm_campaign=2021-09-07
ENROLL NOW!



Follow me if you want more
Mac OS Big Sur CPPFLAGS and LDFLAGS
Tags: opensource, python, cpp, osx
Published: 2021-09-07 08:48:58

While building python packages, dependency development libraries are required. We can install the libraries from homebrew were not found by pip for some reason.
Export the path used by homebrew for "include" and "lib".
```
export CPPFLAGS=-I/opt/homebrew/include
export LDFLAGS=-L/opt/homebrew/lib
```
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 43
Tags: php, javascript, webdev, tutorial
Published: 2021-09-07 08:29:30

Netflix provides streaming movies and TV shows to over 75 million subscribers across
the globe. Customers can watch as many shows/ movies as they want as long as they are
connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces
original content and also pays for the rights to stream feature films and shows.


In this video,we will learn about FFmpeg

{% youtube EhezpmU63PA %}


If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
Flatten an array using javascript
Published: 2021-09-07 08:26:26

Hello Everyone 👋
Thanks for showing the love on the previous post. Today, let's talk about how you can flatten an array using javascript.

Taking a test array: 
```javascript
const arr = [1,2,3,[4,5,[6,7],[8,9,10,[11, NaN, undefined]]]]
```
now we have to flatten all the elements of this array into a single array so that our output will look like this:

```javascript
result = [1,2,3,4,5,6,7,8,9,10,11, NaN, undefined]
```
Starting with a function name i.e, flattenArray that's going to take test array as a parameter.

```javascript
//function statement

const flattenArray = (input) => {

//initializing the result array

let result = []

//returning the output

return result;
}

//calling the function with test array as argument

flattenarray(arr)
```
1. First step we are going to iterate over each element of the array and concatenate each element in the result array. For that we have to run a for loop:

The concat() method is used to merge two or more arrays. This method does not change the existing arrays, but instead returns a new array. [(learn more)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)

```javascript
//this loop will iterate over each element in the array

for(let data of input){
   result = result.concat(flattenArray(data))
}
```
2. We're passing each element to the concat function as this is a recursive function. So when our function input becomes a single element then this function will return an error i.e, input is not iterable hence we have to apply another check condition.

```javascript
//if the input is not an array this will just return the value

if (!Array.isArray(input)){
    return input;
}

```
Now our code is ready to be execute. Here we're dividing our problem into smaller problem and using recursive function to achieve our final output.

Final Code 

```javascript
const arr = [1,2,3,[4,5,[6,7],[8,9,10,[11, NaN, undefined]]]]

const flattenArray = (input) => {
  let result = []

  if (!Array.isArray(input)){
    return input
  }

  for (let data of input) {
    result = result.concat(flattenArray(data))
  }

  return result;
}

console.log(flattenArray(arr));
```

Don't just read this article instead have some hands on [Live Demo](https://replit.com/join/bmmjtkatyr-nandkk05)

Stay tuned for upcoming articles ⚡️
What is PROCESIO?
Tags: productivity, operations, saas, startup
Published: 2021-09-07 08:16:31

Hi everyone👋 Excited to be writing our first post on the DEV community. To begin, I thought I'd share **what** we're doing and **why we're joining** here on DEV. 

We built [PROCESIO](www.procesio.com) with the idea to save time for developers when building **backends, automation, and integrations**. We wanted a platform that would allow to put together lego-like elements for the most used scenarios, but also allow to write custom code whenever needed so that we could address even the most niche cases. 

Some of the biggest challenges for developers these days are:

👉 **work overload**: there is a high demand for software development, and there is not enough workforce or capacity to meet this demand
👉 **time constraints**: too much time is wasted on boilerplate coding or repetitive tasks while most development projects have strict deadlines
👉 projects require **frequent maintenance, changes and updates** in highly dynamic and competitive business environments 

PROCESIO addresses these challenges by providing a sandboxed environment to build apps up to 5x faster by only coding what is relevant and important. You can define business logic, [prototype workflows](https://docs.procesio.com/article/40-how-to-create-a-basic-process), visually test, debug, and [build data models](https://docs.procesio.com/article/1-data-models), and extend the platform's functionality by creating [custom actions](https://docs.procesio.com/article/15-how-to-develop-a-custom-action).

{% youtube 4q2dPXT6Qu4 %}

That's it for now, next I'll be following up with a couple of use cases to actually see when PROCESIO can prove useful. 

In the meanwhile, feel free to play around with the tool through a free account [here](https://procesio.app/#/create-account).
Four Case Styles you should know!
Tags: programming, casestyles
Published: 2021-09-07 07:45:55

In programming, we are mostly not allowed to use space characters between words because it is interpreted as the end of identifier or beginning of something new.
Instead, we use certain naming conventions in order to use multiple words for naming variables, classes, functions, etc. in the source code.
Following are the most popular case styles used in programming: 
1. Camel case
2. Pascal case
3. Snake case
4. Kebab case

## Camel Casing:
![camelCase](https://www.pngitem.com/pimgs/m/138-1381844_camel-case-in-programming-hd-png-download.png)
For using the camel case style, the rule is to remove spaces and capitalize each word, except the first one.
Eg: `first name` will be written as `firstName` in this case style.
Application: The camel case style is used as the naming convention of variables and functions in various programming languages like JavaScript.

## Pascal Casing:
![PascalCase](https://media.istockphoto.com/illustrations/blaise-pascal-was-a-french-mathematician-physicist-inventor-writer-illustration-id926832916?k=20&m=926832916&s=612x612&w=0&h=kBBG_7Rx8Y4P_1OHGMx4j12-gcUV5t5NBIJrTeZKhzg=)
For using the pascal case style, the rule is to remove spaces and capitalize each word, including the first one.
Eg: `first name` will be written as `FirstName` in this case style.
Application: In Java, all classes, interfaces and enums are expected to use Pascal case. C# uses PascalCase for namespaces and even public methods.

## Kebab Casing:
![kebab-case](https://st2.depositphotos.com/3557671/11164/v/600/depositphotos_111644338-stock-illustration-meat-kebab-icon-of-vector.jpg)
The craving makes it difficult to write but by gathering all my self-control, here I go. The rule for kebab casing is to remove spaces and then add a hyphen "-" between each word.
Eg: `first name` will be written as `first-name` in this case style.
Application: In CSS, property names are written in this style. This style is also often used in URLs.

## Snake Casing:
![snake_case](https://p.kindpng.com/picc/s/47-479779_cartoon-snake-image-snake-animation-clipart-hd-png.png)
For using the snake case style, the rule is to remove spaces and add an underscore "_" to separate each word.
Eg: `first name` will be written as `first_name` in this case style.
Application: It is used conventionally in declaring database field names. Python uses the style for variable names, function names, method names, and module or package (i.e. file) names. PHP uses SCREAMING_SNAKE_CASE for class constants.
How I setup a new full stack project
Published: 2021-09-07 07:30:43

### Intro

I just created a [git repository](https://github.com/japrozs/ts-project-setup) about my latest boilerplate setup whenever I start a new projcet. It uses the following technologies

-   Redis
-   NodeJS
-   Express
-   Apollo GraphQL
-   TypeORM
-   Postgres

### For the react native app

-   @apollo/client
-   GraphQL Code generator
-   Expo
-   React Navigation

### How the code works

Even though I have explained in the git repo abouthow to start the server, i'll go through that briefly to tell you how it all works. Mainly, I've got a nodejs server, on top of which sits a graphql server alongside a redis server. The job of the redis server is to manage caching and sessions while the GraphQL API is used to handle queries and mutations.

This is how it all comes together

```bash
app
|_ expo
|_ @apollo/client
|_ @graphql-codegen (GraphQL Code generator)

server
|_ express server
	|	|_ apollo server
	|	|_ redis server
	|_  nodemailer to send requests and responses
```
Change span text jQuery - [SOLVED]
Tags: javascript, beginners
Published: 2021-09-07 07:28:35

## TL;DR Summary
Changing span text in jQuery is very easy and there are 3 ways to go about it:
(also let's assume we have HTML looking like this)
```html
<span id="one">first text</span><br />
<span id="two">second text</span><br />
<span id="three">third text</span>
```

**1) Change single element by ID**
```js
// change by ID
$('#two').text('jQuery text');

// change by index
$('span').eq(1).text('jQuery text');
```
Here all elements are selected with `$('span')` but you can select one by index like this `.eq(1)` (index starting from zero obviously).

![change span text jQuery](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9cmgjd25x2rurc88r6tb.png)

**2) Change all the elements - same text**
```js
$('span').text('jQuery text');
```
And the result will be something like this:
![change span text jQuery - the same](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4271c9eqp1c0eocgolhe.png)

**3) Change all the elements - different text**
```js
$('span').each((index, element) => {
  $(element).text(`jQuery text - ${index}`);
});
```
And here is how it looks like:
![change span text jQuery - unique](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/02j1b6n0ynfitdahpyvz.png)

And that's it.
Now you know how to change span text with jQuery. 

Until next time,
*Will*
*[Building an Algo-Trading Hedge Fund From Scratch](https://programmermoney.com/)*
Backend Dockerfile Setup
Tags: docker, devops, typescript, tutorial
Published: 2021-09-07 07:27:44


How to setup a dockerfile to containerize yout appliaction for deployment to various VPS of your choice and how to install it on your VPS. You can use the following dockerfile for your projects that are specially using typescript and yarn.

```dockerfile


FROM node:latest

WORKDIR /usr/src/app

COPY package.json ./
COPY yarn.lock ./

RUN yarn

COPY . .
COPY .env.production .env

RUN yarn build


ENV NODE_ENV production

EXPOSE 8080
CMD ["node", "dist/index.js"]
USER node


```

Then you can use the following commands to push it from your system and pull it from your VPS

```bash

docker build -t <tagname>
docker push <tagname>

## on your vps
docker pull <username>:<tagname>

```
Cryptographic frequency Analysis explained
Tags: cryptography, security, devops
Published: 2021-09-07 07:19:06

Frequency Analysis is the study of frequency of letters or group or letters in a ciphertext. This method is relatively older to the newer methods of cryptanalysis. This method is used to break classic ciphers, this method is really useful in breaking substitution ciphers. It is based on the fact that certain letters or group of letters in a specific language text occur with specific frequencies. There is a distribution of the frequencies of letters that occur in a particular language. For example: the letters `E`,`A`,`T` and `O` occur the most in a piece of text in the English language. Similarly, the letter pairs - `TH`, `ER`, `ON` and `AN` are the most common in a piece of text in the English language, these pairs are reffered to as bigrams.<br><br>

In some ciphers, the properties and patters of the plaintext is preserved in the ciphertext, and these patterns can easily be studied and then the cipher can be exploited. The ciphertext usually retains the properties of the plaintext when a single letter always gets encrypted to the same ciphertext letter, this usually occurs in substitution ciphers. This type of attack is called ciphertext-only attack. Ciphertext-only attack is the attack in which the cryptanalyst just has the access to the ciphertext and nothing else. The cryptanalyst, in some cases might also know the language of the plaintext, where the cryptanalyst can use techniques like frequency analysis and index of coincidence.<br><br>

When a plaintext is encrypted using a substition cipher, and the cryptanalyst know the actual language of the plaintext, the cryptanalys can easily find frequency distribution and sequences in the ciphertext in most cases. For example: if a ciphertext contains a high frequency of `R` in it and the plaintext language was English, the cryptanalyst would know that `R` would most probably be `E`, `T` or `A` in the plaintext as these letters occur the most in English, he would still need to try more combinations but frequency distributions make the combinations to try a lot lesser.
HOW MOBILE HEAVY VEHICLE INSPECTIONS HELPS YOUR TEAMS
Published: 2021-09-07 07:14:02

Heavy vehicle inspections are moving online. Technology is changing the way we approach work, and that includes heavy vehicle inspections. The mobile industry allows for innovation in how heavy vehicle inspections are done, and shows us what changes during the inspections themselves.

Consider heavy vehicle inspections being conducted using a mobile app. How are these inspections done this way? What are the benefits of using a mobile app for heavy vehicle inspections? As digital technology is making strides in various businesses, the old way of inspecting heavy vehicles is becoming outdated.

That is all the more reason to check out the HVI Platform, a mobile app that will fill your heavy vehicle inspection needs. Here is a list of reasons for why you should check out HVI:

● Create checklists within minutes.

● Access inspection forms anytime and anywhere.

● Create work order through inspections

● Defect and issue email notification

● Schedule inspections on the go

● Monitor maintenance flow mobily

● Set reminders for inspections and maintenance

● Parts and fuel management

● Purchase Order management

● Tyre management
 Read more https://www.heavyvehicleinspection.com/blog/hvi_mobile_app.html
My first significant refactoring of a project
Tags: beginners
Published: 2021-09-07 05:55:40

I built [QWERTYBall](www.QWERTYBall.com) as a project in bootcamp. To make it work, I'd furiously google an example of the feature I wanted, then just as furiously I'd add whatever framework, css, and code used in that example to my codebase. The resulting game worked great, but under the hood it was a hot mess. I dreaded a potential employer taking a look at my github repo and seeing the slap-dash approach I took to make the game work.

## Step 1: Organize it
The first step I took to refactor the game was just to organize it. It had been months since I wrote the code, and I wasn't sure how everything worked. I used on my all-time favorite VSCode extension, [Fold Plus](https://marketplace.visualstudio.com/items?itemName=dakara.dakara-foldplus), to collapse all the code and just see which functions were called and in what order. Unsurprisingly, all the functions were out of order, but I moved everything around so that they were as sequential as possible.

Next, I commented out the code into sections. Because it's a game, I organized the code in the following manner:

* Initialize Variables
* Launch App
* Start Game
* Game Play
* Game Over
* Save Game

At this point, I found that I still didn't truly understand the structure well enough, so I decided to diagram it using [LucidChart](www.lucidchart.com). Here's the diagram I created:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmen6yuwkixehelsv9n6.png)

This was a total game-changer. I felt as though I finally had a bird's eye view on how the code was structured. Seeing it this way helped me realize what code was superfluous, and what code was not even used in the first place. I ended up making several successive versions of the diagram because I kept finding new ways to clean up the code.

This will be the first installment of a series devoted to this refactor. Next up, I'll detail how I reduced my CSS code from a ridiculous 8,053 lines to just ~~615~~ 252--and I have further to go!