teleren/devto huggingface dataset:
Benefits of Meditation
Tags: meditation, burnout, mentalhealth, wellness
Published: 2021-09-04 08:37:09

---
canonical_url: https://blog.stoicoders.com/benefits-of-meditation
---
Our constantly evolving IT industry is exciting and bring about great opportunities for learning and growth. However, being on our toes can be stressful and may lead to long term health consequences. I have personally dealt with it the hard way. 

I resorted to meditation as a personal experiment and I am documenting my journey in public through my twitter handle. 

After consistent practice for more than 50 days, I am observing noticeable changes. I would like you to reap the benefits of meditation too. Here is an infographic that represents all the advantages meditation can offer for us. 

Kickstart your wellness journey! 

![Benefits of meditation infographic](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/73xqmatvdc8qaa4v8pxr.png)
A generic Software as a Service
Tags: showdev, saas, satirical
Published: 2021-09-04 08:14:56

![Generic image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bupswrw308rnxyemsuvq.png)

Hey guys!
It's me, Generic Name. 
I'm happy to announce the launch of my new SaaS, Generic SaaS!
Generic SaaS is what I can best describe as a Hello World as a Service. Going to the /api endpoint will return a Hello World JSON object.

As of now, the service is free, however in the future we wish to give 100 free, then $199,999 per Hello World.

I would appreciate if you could check it out!

https://genericsaas.ml

(This is not a real SaaS. This is purely satirical. The site does work and the api endpoint does return a JSON object, but it will never earn revenue and is not a real startup)
Tips memancarkan aura
Published: 2021-09-04 07:22:16

Menurut para ilmuwan aura, balok energi yang ada sejak lahir di bumi. Aura ini berbentuk radiasi warna yang baik yang mengelilingi makhluk hidup secara mendasar, setiap orang memiliki semua orang yang menjelaskan mengapa kadang-kadang seseorang memiliki perasaan yang tidak dapat dijelaskan.

Setiap orang harus menerima bahwa aura positif pada tubuh akan sangat berguna dalam kehidupan sehari-hari. Ini terjadi karena sifat aura positif yang dapat menyebabkan perasaan bahagia. Selain itu, bahkan orang-orang akan membenci kenyamanan jika mereka berada di dekat Anda.

Namun, aura dapat menghilang perlahan-lahan dengan berbagai situasi, seperti masalah keluarga, retak hubungan, pekerjaan yang tidak pantas dan pengalaman buruk lainnya.

Ada cara Anda harus memancarkan aura positif dan memberikannya kepada orang di sekitar Anda, melihat beberapa tips berikut yang perlu Anda ketahui.

Visit All : https://www.kreatizen.my.id/2021/08/tips-ampuh-mengeluarkan-aura-positif.html
Chrome DevTools: Port forwarding allows localhost URLs to work on mobile
Tags: devtool, chrome
Published: 2021-09-04 07:19:31

Port forwarding lets you view your local website, even it's hosted on a custom domain, directly on your android device.

Chrome to Phone my localhost URL from desktop
Remote Debug the mobile localhost page and enable port forwarding
Refresh and observe that no command line was needed!

1. Set up [remote debugging](https://developer.chrome.com/docs/devtools/remote-debugging/) between your development machine and your Android device. When you're finished, you should see your Android device in the list.

2. Click **Port forwarding** button. `localhost:8080` is set up by default.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z380f3va97ej8r2pdglj.png)

3. Check **Enable port forwarding**. If you want to set up other ports, follow the steps 4 and 5. Otherwise skip to step 6.


4. In the **Port** textfield on the left, enter the `localhost` port number from which you want to be able to access the site on your Android device. For example, if you wanted to access the site from `localhost:5000` you would enter `5000`.

5. In the **IP address and port** textfield on the right, enter the IP address or hostname on which your site is running on your development machine's web server, followed by the port number. For example, if your site is running on `localhost:7331` you would enter `localhost:7331`.

6. **Click Done.**

You can read the full procedure on the official [DevTools Documentation](https://developer.chrome.com/docs/devtools/remote-debugging/local-server/)
Drop Links to Your Linkedin so We Can All Connect effectively
Tags: linkedin, opportunities, career, opensource
Published: 2021-09-04 07:17:51

Are you on LinkedIn?

LinkedIn has still opened up more opportunities than any other platform so if you aren't, create an account!

I've made friends, huge financial gains and a huge network of smart people by being a little active on there. Best time to start working on your profile there is when you don't need it. 🚀

Connect with me 👇
https://linkedin.com/in/niteshtaliyan/

Let's all connect on LinkedIn, drop your links below. 💜
Tales from the Real World - Leveraging Azure as a Telco provider
Tags: cloud, azure, industry, telco
Published: 2021-09-04 07:05:19

![Tales from the Real World - Leveraging Azure as a Telco provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd5xb1fbjt71bs5zwgg5.jpg)

**This post was originally published on Fri, Sep 3, 2021 at [cloudwithchris.com](https://www.cloudwithchris.com/episode/leveraging-azure-as-telco-provider/).**

In this session Chris is joined by Ivo who will explain how Telco providers are leveraging Azure to offer services to their customers. He will explain how they transform and what the future will be. He will also cover the benefits and struggles that they faced on the way.

{% youtube dmVfw4PPE0s %}
cucumber with selenium-webdriver
Published: 2021-09-04 07:03:19

First you have to install web driver that you prefer

For me, I'm using __chromedriver__

Install `selenium-webdriver` gem
```
gem install selenium-webdriver
```

Then install `chromedriver`, currently I am using the latest chrome browser version 93

1. Download `chromedriver` from [chromedriver's website](https://sites.google.com/a/chromium.org/chromedriver/downloads)
2. Choose the driver that support with your browser, eg: ChromeDriver 93.0.4577.15
3. Extract the zip file and install the package
4. Move the executable to under /opt/WebDriver/bin (create if  the does not exist).

For more detail [visit](https://www.selenium.dev/documentation/)

I get an example from cucumber official website but have a few tweak to get it works in my local machine

```
# features/search_cheese_on_google.feature
Feature: Visit google using web driver
  Everybody wants to see the result when we search something on google

  Scenario: search for cheese
    Given I am on the google search page
    When I search for "cheese"
    Then the page title will start with "cheese"
```

In step definition,

```
# features/step_definitions/webdriver_step.rb
require 'rubygems'
require 'selenium-webdriver'

Selenium::WebDriver::Chrome::Service.driver_path = "/opt/WebDriver/bin/chromedriver"

Given('I am on the google search page') do
  @driver = Selenium::WebDriver.for :chrome
  @driver.get "http://google.com"
end

When('I search for {string}') do |string|
  element = @driver.find_element name: "q"
  element.send_keys "cheese"
  element.submit
end

Then('the page title will start with {string}') do |expected_result|
  wait = Selenium::WebDriver::Wait.new timeout: 10
  wait.until { @driver.title.downcase.start_with? "cheese" }
  puts "Page title is #{@driver.title}"
  @driver.close
  expect(@driver.title).to include expected_result
end
```
run 
```
cucumber
```

You would the result something like this

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qs0yr34n0tcvxmlqn4jp.png)
 
Well done!
CGN7 - Cloud Gaming Notes Episode 7 - Game Streaming and Cloud-Powered Gaming
Tags: cloud, gaming, streaming, gamedev
Published: 2021-09-04 07:00:11

**This post was originally published on Wed, Sep 1, 2021 at [cloudwithchris.com](https://www.cloudwithchris.com/episode/game-streaming/).**

In this session, Chris is once again joined by Lee Williams. Chris and Lee talk through industry trends around Game Streaming (i.e. streaming games to your device, rather than livestreaming what you're playing to others), and the opportunities this brings to game creators and consumers.

{% youtube T6x-53wVsE8 %}
Best Back-end Web Development Frameworks
Tags: framework, webdev, django, laravel
Published: 2021-09-04 06:38:46

Choosing the best backend web development framework is a little bit harder for beginners. With the so many availabilities of web frameworks, it’s confusing to choose the best web framework according to your skills.

Here are best web development frameworks. Sequence doesn't matter, every frameworks are best.

##1. Django
Django is one of the most popular web frameworks written in python. Django framework follows Model View Template (MVT) pattern. If you already know python programming or your background is python then this is the best web framework.

This back-end framework is optimal, reduced coding, pluggability, greater reusability, and faster development.

Django Rest Framework is also best and easier to make REST API

Personally, I used this framework.

Tutorials:

[Todo app in Django](https://www.codesnail.com/django-todo-app-tutorial/)
[Blog app in Django](https://www.codesnail.com/django-blog-tutorial/)

##2. Laravel
Written in PHP

Laravel is a PHP framework that follows Model View Controller (MVC) architecture. People who love PHP can easily learn Laravel.

It offers a modular packaging system equipped with a dedicated dependency manager. Laravel is rated as one of the best web frameworks.

##3. Flask

Written in Python

Flask is a Python-based micro web framework. It is micro in the sense that Flask aims to keep the core simple but extensible. Developers that have a grasp of Python can easily adapt to working with Flask. As a micro-framework, it’s perfect for applications that require heavy customization.

##4. Express.js

Written in JavaScript

Express.js, aka Express, is a backend web application framework designed for building web applications and APIs. It provides a thin layer of fundamental web app features. And with a myriad of HTTP utility methods and middleware, creating a robust API is quick and easy.

##5. Ruby on Rails

Written in Ruby

Ruby on Rails, also known as Rails, is a server-side framework written in Ruby. It offers default structures for a database, web pages, and web service. Scalability is one of the main reasons for many users to opt for Ruby on Rails.

Read full article: [Best Back-end Web Development Frameworks](https://www.codesnail.com/backend-web-development-frameworks/)
useState in React
Tags: react, beginners, reactnative, reacthooks
Published: 2021-09-04 06:31:07

Hooks are a new addition in React 16.8. 

They let you use state and other React features without writing a class.

🔥🔥 <b>Concepts Covered</b>

* What are hooks in React ? 
* How to convert class state to function state with useState
* How to use the useState hook 
* Best way to define initiate state in useState

 {%youtube JAKWkN10xBU %}
JavaScript : ES6/Modern JavaScript Crash Course 
Tags: es6, javascript, beginners, webdev
Published: 2021-09-04 06:16:12

🔥🔥🔥🔥
One must know the <b>ES6</b> or Modern JavaScript Concepts before you working on <b>Angular<b/> or <b>React</b>. 

Learn Essential ES6 Crash Course in just one Hour with all practical scenarios. 

New ES6 syntax 
-------------------------------
00:00 Introduction to ES6
00:40 Let keyword
04:12 Const keyword
04:45 Default Parameters
07:13 Rest Operator
09:06 Spread Operator
11:10 Object Literal 
13:20 Template Literal
15:16 for of

Destructuring 
-------------------------------
17:02 Array Destructuring 
22:12 Obect Destructuring 

Modules in JavaScript
-------------------------------
25:43 Modules in Javascript
25:46 What is Modules ?
26:05 Create Module
27:27 Export function constructor and functions
28:26 Import Module

Class in JavaScript
-------------------------------
31:40  Need of class in JavaScript
33:50 Create an Object of Class
35:40 Getter & Setter
38:53 Inheritance in Javascript

Arrow Functions
-------------------------------
45:40 Introduction to Arrow functions
46:12 Create Arrow Function
46:53 With Single Parameter
47:15 With Zero Parameter
48:02 How this works in Arrow functions
53:57 Arguments with Arrow functions
55:13 When to use arrow functions

Promise in JavaScript
-------------------------------
55:36 Introduction to Promise
55:42 What is Promise ?
56:24 Life cycle of Promise
57:22 Crete Promise
1:01 Consuming Promise
1:05:00 Catching Error
1:06:21  Finally
1:06:42 Attach handlers
1:07:51 Chaining Promise

#es6 #javascript #react #angular

{% youtube 1WCA0W5tI08 %}
Foobar: Solar Doomsday
Tags: foobar, python, algorithms, google
Published: 2021-09-04 06:03:47

Solar Doomsday
==============

<small>Who would've guessed? Doomsday devices take a LOT of power. Commander Lambda wants to supplement the LAMBCHOP's quantum antimatter reactor core with solar arrays, and you've been tasked with setting up the solar panels.</small>

<small>Due to the nature of the space station's outer paneling, all of its solar panels must be squares. Fortunately, you have one very large and flat area of solar material, a pair of industrial-strength scissors, and enough MegaCorp Solar Tape(TM) to piece together any excess panel material into more squares. For example, if you had a total area of 12 square yards of solar material, you would be able to make one 3x3 square panel (with a total area of 9). That would leave 3 square yards, so you can turn those into three 1x1 square solar panels.</small>

<small>Write a function solution(area) that takes as its input a single unit of measure representing the total area of solar panels you have (between 1 and 1000000 inclusive) and returns a list of the areas of the largest squares you could make out of those panels, starting with the largest squares first. So, following the example above, solution(12) would return [9, 1, 1, 1].</small>

Test cases:
Input: 15324
Output: [15129,169,25,1]

Input: 12
Output: [9,1,1,1]

Python
```python
from math import sqrt

def solution(area):
    res = []
    while area > 0:
        square = int(sqrt(area))**2
        area -= square
        res.append(square)
    return res
```
Vocabulary Building Day 8
Tags: gre, day8
Published: 2021-09-04 05:35:40

1. **undermine**(verb): to weaken
![alt text](http://thepowermoves.com/wp-content/uploads/sign-someone-is-undermining-you.jpg)
[Checkout Pronunciation](https://www.google.com/search?q=undermine&oq=undermine&aqs=chrome.0.69i59l2j35i39j46i131i199i291i433i512j0i131i433i512j0i433i512j46i131i433i512j0i433i512j46i131i199i291i433i512j0i433i512.4012j0j9&sourceid=chrome&ie=UTF-8)

2. **veracious**(adjective) :speaking or representing the truth.
![alt text](https://thesaurus.plus/img/synonyms/a136/veracious.png)
[Checkout Pronunciation](https://www.google.com/search?q=veracious&oq=veracious&aqs=chrome.0.69i59j0i433i512j46i175i199i512l6j0i512j46i175i199i512.3985j0j9&sourceid=chrome&ie=UTF-8)

3. **volubility**(noun): the quality of talking or writing easily and continuously.
![alt text](https://satgrecatvocabulary.files.wordpress.com/2015/06/voluble-e28093-characterized-by-ready-or-rapid-speech-talkative-nonsense.jpg?w=392&h=329)
[Checkout Pronunciation](https://www.google.com/search?q=volubility&oq=volubility&aqs=chrome..69i57j0i512l7j0i10i512j0i512.12596j1j9&sourceid=chrome&ie=UTF-8)

4. **semblance**(noun): the outward appearance or apparent form of something, especially when the reality is different.
![alt text](https://thesaurus.plus/img/synonyms/308/semblance.png)
[Checkout Pronunciation](https://www.google.com/search?q=semblance+meaning&oq=semblance&aqs=chrome.0.0i433i512j69i57j0i131i433i512j0i512l7.4293j1j9&sourceid=chrome&ie=UTF-8)
5. **malady**(noun): a disease or sickness.
![alt text](https://www.bitgab.com/uploads/1595046477-malady-1595046477.jpg)
[Checkout Pronunciation](https://www.google.com/search?q=malady&oq=malady&aqs=chrome..69i57j0i67i433j0i67l2j0i512l6.2744j0j7&sourceid=chrome&ie=UTF-8)
I hope this helps you if you are preparing for GRE exams.
JavaScript promises and async functions
Published: 2021-09-04 05:30:56

---
title: JavaScript promises and async functions
published: true
---
When learning async/await, I am sure you wrote that function that returns a Promise and you used async/await to check out how it works. But the reverse is also true. You can write an async function and use it as a promise. This is because, an async function anyway returns a promise.

For example,
`async function myfunc() { return 'Hi';}`

You can then use it like this
`myfunc().then(() => console.log('got it'))`

Similarly you can just replace new Promise and then calling resolve and reject, with an async function that either returns a value or throws an error and use it just like a Promise, for the simple reason, IT IS A PROMISE. Irrespective of whether you return anything or not, an async function ALWAYS RETURNS A PROMISE.

The following code should demonstrate just that. Of course, once you have an environment where async/await are supported, there is little point in using the old promise syntax.
```
async function f1(num) {
  if (num < 5) return 'Hello world'
  throw 'Error'
}
f1(3)
 .then((data) => console.log('Got=', data))
 .catch((e) => console.log('Error=', e))

f1(6)
 .then((data) => console.log('Got=', data))
 .catch((e) => console.log('Error=', e))
```
PWA || MAKING APP synchronous || Auto update assets
Tags: pwa, webdev, javascript
Published: 2021-09-04 05:12:25

## Updating pwa
Whenever you change the version of service worker the app gets auto updated.
And also you can show interface for update.
*But You have to make cool app* like Amazon android which updates automatically when Amazon wants.
## let's get started
To make app like that you have to cache only your index.html.
(If you have to give styled interface , you can add style.css also)
### index.html
```html
...

<div id="app" class="full-body">
<H1>You're offline<H1>
</div>

<script src="update.js"></script>
...
```
one script that will update content.
> If you are using the framework like MDL or bootstrap.You have to place their scripts after update.js

### update.js
```js
var template = "you're online now";
var app = document.querySelector("div#app");
app.innerHTML=template;
```
This is process which will update your app when you will update the template variable
## Making more complex
In my app I have created 3 tabs which are create,markdown to pdf, settings.
Each tab have it's own template file. 
You can check here.
{% github NotableApp/formal-stack-pdfs %}
And whenever the js file reads it on tab is changed and display content after reading means in my app content is purely synchronous with user .
> You can check here :
https://formal-stack.netlify.app/ 

## Example of my app
In my app you can see I have created a loader and different tabs when you tap on tab the html template for that tab loads and the loader hides.
On every click on tab button the `ui.js` file reads the page template stored in `pages` directory and shows content.
> You can see here https://github.com/NotableAPP/Formal-stack-pdfs/tree/main/APP/pages 

In my app I have created my own extension which is `.stackformal`.In this type of file I have stored the html code which appears on the call means on tab opened.
## temp.js 
In my app I have created temp.js file which handles update temporary and after the service worker update app became stable.
```
Written by SGI with 💕
```
Looking for contributor in a project
Tags: opensource, github, programming
Published: 2021-09-04 04:51:31

So the full story is I need a contributor for a project.Basically I am working on an web application in which it will be requiring lot of programming technology logos in **svg format**.
So what you need to do:
1. Go to this github [repo](https://github.com/tazim404/tech-stack)
2. Clone this repo

**NOTE: You will get logos folder, stacks.json and tech.txt file.**

3.Now put logo on the folder which you want to contribute with.
4.Update stacks.json file.
5.Update tech.txt file (add name of tech you have added).
6.Make the pull request.
Encode / Decode Hexadecimal string to/from binary data
Tags: go
Published: 2021-09-04 04:50:34

ช่วงนี้ต้องจัดการข้อมูลที่เป็น binary ซึ่งบางครั้งข้อมูลอยู่ในรูปแบบ [BCD](https://en.wikipedia.org/wiki/Binary-coded_decimal) ซึ่งถ้าให้เขียนเป็นเลขฐานสองโดยตรงก็จะยาว และยากต่อการอ่านเวลา debug เกินไป ดังนั้นก็เลยแปลงให้อยู่ในเลขฐานสิบหกดีกว่าเวลาต้อง debug หรือ log ข้อมูล

สำหรับ Go มี package [`encoding/hex`](https://pkg.go.dev/encoding/hex) ที่มีฟังก์ชันให้เราใช้แปลงไปมาระหว่าง binary data (`[]byte`) ไปเป็น hexadecimal `string` ได้ง่ายๆอยู่ คือฟังก์ชัน

```
func EncodeToString(src []byte) string

func DecodeString(s string) ([]byte, error)
```

ตัวอย่างการใช้งานเช่น เมื่อเราต้องการแปลงจาก Hex ที่เป็น string กลับไปเป็น binary data

```
package main

import (
	"encoding/hex"
	"fmt"
	"log"
)

func main() {
	bcdNumberHex := "1234"
	bcdNumberBytes, err := hex.DecodeString(bcdNumberHex)
	if err != nil {
		log.Fatal(err)
	}
	for _, b := range bcdNumberBytes {
		fmt.Printf("0x%x ", b)
	}
// Output:
// 0x12 0x34
}
```

ตัวอย่างการใช้งานเช่น เมื่อเราต้องการแปลงจาก binary data กลับไปเป็น Hex string

```
package main

import (
	"encoding/hex"
	"fmt"
)

func main() {
	bcdNumberBytes := []byte{0x12, 0x34}
	bcdNumberHex := hex.EncodeToString(bcdNumberBytes)
	fmt.Println(bcdNumberHex)

// Output:
// 1234
}
```
How to get Clone a private Github repo!?
Tags: github, git, opensource, programming
Published: 2021-09-04 04:33:08

Hello all, this is my first post on dev.to community 

I had a simple problem with `git clone ` a private repo to my desktop, I tried many [commands from StackOverflow](https://stackoverflow.com/questions/2505096/cloning-a-private-github-repo) and other websites and issues from GitHub, and nothing my issue not solved 

**today I solved my problem and want to share my solution with you**
 
everything is about the access token to get access now, 

> #### Create Personal Access Token on Github
> From your Github account, go to **Settings** => **Developer Settings** => **Personal Access Token** =>  **Generate New Token** (Give your password) => **Fillup the form** => click **Generate token** => **Copy the generated Token**, it will be something like `ghp_sFhFsSHhTzMDreGRLjmks4Tzuzgthdvfsrta`

after that in your command type ```https://<PERSONAL-ACCESS-TOKEN>@github.com/<user_name"the owner user name " >/<repo_name>.git```

that's it, your repo will get cloned correctly and without any disruptions

I hope you will find my post is Interesting and if you have any comments feel free to comment or `commit `;)