teleren/devto huggingface dataset:
How do you find cool names for your side projects?
Tags: discuss
Published: 2021-05-22 13:45:24

Having side projects is fun and sometimes one of them will even be launched and used by a large crowd.

Often times it starts with an idea and the name for the project will come based on a set of features, a target market or some other aspects.

But sometimes the idea is there but coming up with a name for it is hard - I'm sure everyone knows the struggle.

**How do you find cool names / codenames for your projects?**

Any resources / generators you use?
A specific strategy to find a name?
Node.js : Check Permissions of a File or Directory
Tags: node, programming, webdev, javascript
Published: 2021-05-22 13:44:46

`fs.access()` determines whether a path exists and what permissions a user has to the file or directory at that path.

`fs.access` doesn't return a result rather, if it doesn't return an error, the path exists and the user has the desired
permissions.

The permission modes are available as a property on the `fs` object, `fs.constants`

* `fs.constants.F_OK` - Has read/write/execute permissions (If no mode is provided, this is the default)
* `fs.constants.R_OK` - Has read permissions
* `fs.constants.W_OK` - Has write permissions
* `fs.constants.X_OK` - Has execute permissions (Works the same as fs.constants.F_OK on Windows)

# Asynchronously Check Permissions of a File or Directory
```javascript
var fs = require('fs');
var path = '/path/to/check';
// checks execute permission
fs.access(path, fs.constants.X_OK, (err) => {
 if (err) {
 console.log("%s doesn't exist", path);
} else {
 console.log('can execute %s', path);
 }
});
// Check if we have read/write permissions
// When specifying multiple permission modes
// each mode is separated by a pipe : `|`
fs.access(path, fs.constants.R_OK | fs.constants.W_OK, (err) => {
 if (err) {
 console.log("%s doesn't exist", path);
 } else {
 console.log('can read/write %s', path);
 }
});
```

# Synchronously Check Permissions of a File or Directory
`fs.access` also has a synchronous version `fs.accessSync`. When using `fs.accessSync` you must enclose it within a `try/catch` block.
```javascript
// Check write permission
try {
 fs.accessSync(path, fs.constants.W_OK);
 console.log('can write %s', path);
}
catch (err) {
 console.log("%s doesn't exist", path);
}
```


<a href="https://www.buymeacoffee.com/rkycom" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

With all that being said, I highly recommend you keep learning!

Thank you for reading this article. Please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/www-rajeshkumaryadav-com/) and [Twitter](https://twitter.com/rky_com).
Node.js : Checking if a file or a directory exists
Tags: node, programming, webdev, javascript
Published: 2021-05-22 13:44:07

# Asynchronously
```javascript
var fs = require('fs');
fs.stat('path/to/file', function(err) {
 if (!err) {
 console.log('file or directory exists');
 }
 else if (err.code === 'ENOENT') {
 console.log('file or directory does not exist');
 }
});
```
# Synchronously
Here, we must wrap the function call in a try/catch block to handle error.
```javascript
var fs = require('fs');
try {
 fs.statSync('path/to/file');
 console.log('file or directory exists');
}
catch (err) {
 if (err.code === 'ENOENT') {
 console.log('file or directory does not exist');
 }
}
```

<a href="https://www.buymeacoffee.com/rkycom" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

With all that being said, I highly recommend you keep learning!

Thank you for reading this article. Please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/www-rajeshkumaryadav-com/) and [Twitter](https://twitter.com/rky_com).
How To Deploy NodeJS Express App On Heroku (Free Hosting)
Tags: programming, heroku, webdev, node
Published: 2021-05-22 13:15:46

Hello guys,
Today I am going to show you how to deploy your NodeJs (Express) app on Heroku as Free.

First, I want to write an article about it but I prefer to show you with practical video. So, I recorded and uploaded on my YouTube Channel.

It only takes about 10 minutes to watch. If you interested, You can watch here: 

https://www.youtube.com/watch?v=wFFZ2nl067c

Thanks a lot guys.
See you on next article.
Bubble Sort (3 min recap)
Tags: javascript, algorithms
Published: 2021-05-22 13:15:30

---
title: Bubble Sort (3 min recap)
published: true
description: 60 seconds to memorize the concept
tags: #js #algorithm

---

## Motivation

> It's shiny benefit is it's implementation simplicity, but be aware (*it comes with a heavy price*) it should not be applied on large datasets since its performance is *O(n)^2* which is quite... terrible...

## Basic Idea

> The basic idea is very simple - we should go over each item in our collection by comparing the **current** item with its **right** closes neighbor.
> In case we find that the left item is bigger then right one **\[left > right\]** \- we simply switch their places and continue to the next neighbors.
> 
> This way we make sure that the biggest number is always **BUBBLED UP** to the **most right** place.
> *If we continue this procedure for each item in the collection then we can claim that we have incrementally sorted collection of items*

## Pseudo Code

```js
done = false
while !done
    done = true
    for i = 0 .. items.length
        if items[i] > items[i + 1]
            swap(a[i], a[i + 1])
            done = false
```

## Code Snippet

```js
  let dataSet = [1, 6, 2, 3, 4, 5, 7];

  const bubbleSort = () => {
    let done = false;
    while (!done) {
      done = true;

      for (let i = 0; i < dataSet.length; i++) {
        if (dataSet[i] && dataSet[i + 1] && dataSet[i] > dataSet[i + 1]) {
          [dataSet[i], dataSet[i + 1]] = [dataSet[i + 1], dataSet[i]];

          done = false;
        }
      }
    }
  };
```

## Example

> Since Svelte compiler allows us to write *almost* identical to standard JS - i have sketched a simple example of the algorithm triggered by a button click.
> [BubbleSort (*Svelte REPL*)](https://svelte.dev/repl/de1a7f8e226943a29aa9bc5f7094b601)
Converting DMS (Degrees, Minutes, Seconds) to Decimal & Decimal to DMS
Tags: javascript, node, react, npm
Published: 2021-05-22 13:12:45

Everytime I am looking for npm package that will meet my requirements and end up by not finding any package on npm site I always try to write it myself and then publish it to npm so last week I was working on the features which need to receive a DMS (Degrees Minutes and Seconds) value and then convert it to Decimal and return the decimal so I wrote this package which does all the case the first function does convert DMS to Decimal and the second function does convert Decimal to DMS.

The **Dms2Decimal** function take 4 parameters degrees, minutes, second as an integer and direction as a string, it will return 0 if not found and return decimal numbers if found.

The **Decimal2DMS** does take 2 parameters decimal as a float and type as a string the type value need to be latitude or longitude and this will return null if not found or it will return a string in this format 23°34'5"N if found.

**Implementation**

```JavaScript
    import { Decimal2DMS, DMS2Decimal } from 'dms-to-decimal';
    
    // Converting Degrees Minutes Seconds to Decimal 
    const degree = 46;
    const minutes = 59;
    const seconds = 5;
    const direction = 'N';

    const converDms2Decimal = DMS2Decimal(degree, minutes, seconds, direction);
    console.log(converDms2Decimal); // Output: 46.984722222222224

    // Converting Decimal to Degrees Minutes Sesonds
    const type = 'longitude';
    const decimal = -122.90222222222222;

    const converDecimal2DMS = Decimal2DMS(decimal, type);
    console.log(converDecimal2DMS) // Output: 122°54'7"W
```

here are the link to the npm package and I am busy with Python.



https://www.npmjs.com/package/dms-to-decimal
Create a temp directory for your app in Node.js
Tags: webdev, node, todayilearned
Published: 2021-05-23 17:16:54

---
title: Create a temp directory for your app in Node.js
published: true
date: 2021-05-22 12:59:58 UTC
tags: webdev,nodejs,til
canonical_url: https://blog.mastykarz.nl/create-temp-directory-app-node-js/
---

![Create a temp directory for your app in Node.js](https://blog.mastykarz.nl/assets/images/2021/05/banner-node-tmp.png)

When working with Node.js, you might need to create a temporary folder for your app. Here's how to do it.

Node.js is a convenient platform for all kinds of purposes: from hosting web apps to running tools or scripts to automate your work. What's really cool about Node.js is that it's just JavaScript. If you know JavaScript from building front-ends, you can reuse your existing knowledge for building web apps, tools, and scripts.

## Creating temp directories in Node.js

When building apps in Node.js you might need to create a temp directory for your app. Here is how to do it.

```javascript
const fs = require('fs');
const os = require('os');
const path = require('path');

let tmpDir;
const appPrefix = 'my-app';
try {
  tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), appPrefix));
  // the rest of your app goes here
}
catch {
  // handle error
}
finally {
  try {
    if (tmpDir) {
      fs.rmSync(tmpDir, { recursive: true });
    }
  }
  catch (e) {
    console.error(`An error has occurred while removing the temp folder at ${tmpDir}. Please remove it manually. Error: ${e}`);
  }
}

```

Let's get through it step by step. You start, by loading the necessary dependencies: `fs`, `os`, and `path`. Next, you define a variable `tmpDir` which we'll use to store the full path to our temp directory. you need to define it outside the `try..catch` clause so that you can access it in the `finally` clause to delete the folder when you no longer need it. Next, you create the temp directory for our app.

You start by retrieving the location of the system temp folder using the `os.tmpdir()` function. You combine it with a prefix for our app using `path.join()`. This is optional, but it makes it easier to locate our app's temp directory if needed. Then, you use the `fs.mkdtempSync()` function, which adds a random string to the specified prefix (in our case the system's temp folder and our app's prefix) and creates a folder on that path. After you created the folder, you can start working with it.

An important part of working with temp folders is cleaning them up when they're no longer needed. To do this properly, you need to wrap your logic in a `try..catch..finally` statement. Your code goes in `try`. If an error occurs, you can handle it in the `catch` segment. Finally, no matter if your logic succeeded or failed, Node.js will execute the code in the `finally` block where you should remove your app's temp directory and all its files using `fs.rmSync(tmpDir, { recursive: true })`. You also need to keep in mind, that deleting the temp directory can fail. If that happens, you should print the full path to the temp directory, so that users can remove it themselves.
عمده فروشی آنلاین دلیو
Tags: wholesale
Published: 2021-05-22 12:53:37

عمده فروشی آنلاین دلیو بستری مناسب برای خرید های عمده و مامور خرید کافه و ها و رستوران ها می باشد. 
شما می توانید در بستر دلیو اقدام به خرید لوازم قنادی نمایید. 
همچنین یکی دیگر از محصولات دلیو ماکارونی می بشد که می توانید در این بستر به خرید ماکارونی نیز بپردازید
deliv.ir
Day 3/30 : Responsive Task Management Dashboard using HTML and CSS
Tags: html, css, webdev, tutorial
Published: 2021-05-22 12:18:09

Welcome to Day 3 of this [Challenge](https://dev.to/somanathgoudar/30dayschallenge-30-days-extreme-html-css-challenge-50k1). This is what I created today. 

**➜ Here is the Demo :**
![Task Management Dashboard](https://1.bp.blogspot.com/-JH62BeI-8MI/YKOXiecJWvI/AAAAAAAAABA/2Z9BoWrR9K015JI2JCHD7yTYJZkfJnSDACLcBGAsYHQ/s16000/p3.gif)

**➜ Video Tutorial :**

{% youtube mvXX32keamM %}
**➜ Source Code :**
https://www.futurecodersweb.com/2021/05/responsive-task-management-dashboard.html


**➜ Instagram Post and Reel for Day 3 :**
[See Post and Reel](https://www.instagram.com/future_coderss/)

------------------------------------------------------------------

Hey, If You don't know what is happening here. Don't Worry, I am doing a crazy challenge 😅. Read More about it from the post below.

{% link https://dev.to/somanathgoudar/30dayschallenge-30-days-extreme-html-css-challenge-50k1 %}

**Support Me :**
👉 Buy me a Coffee: https://www.buymeacoffee.com/somanathgoudar
👉 [Follow Me on Instagram](https://www.instagram.com/somanath_goudar/)
👉 [Follow Future Coders on Instagram](https://www.instagram.com/future_coderss/)
👉 [Subscribe to My Main Channel](https://www.youtube.com/channel/UC_nTrhTr5fnBGjOxnkPUmmA)
👉 [Subscribe to Channel Created for this Challenge](https://www.youtube.com/channel/UCzGSyMOf2jPt1MkNBB3SJ3g)

------------------------------------------------------------------
Daily Developer Jokes - Saturday, May 22, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-05-22 12:00:05

---
title: "Daily Developer Jokes - Saturday, May 22, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Saturday%2C%20May%2022%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12590d3e5c1.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What do computers love to do at the beach?

___A:___ Put on some spam block for protection so they can safely surf the net while catching some .WAVs!
 -->
What is .env file in node JS
Published: 2021-05-22 11:38:53

Its environment variables file. In simple term, it is a variable text file. In this file we set a variable with value and that you wouldn’t want to share with anyone, purpose of file is keep as secret and secure because in .env file we store our database password, username, API key etc…

 > how you can set variable 
   > create a file called .env
   > open it in any editer 
> Then 
You can easily set your environment variables and values with the syntax ENV_VARIABLE=VALUE and boom! 🙂
![.env](https://res.cloudinary.com/coder-202/image/upload/v1621670720/venu18/Screenshot_2021-05-22_at_1.34.56_PM_p4qr3y.png)

>This how you can use these variables in your Node JS porject. 
Run it on your command line `npm i dotenv --save`
`require('dotenv').config()` Is required in the file where you want to use.
To see if you have connected with your .env simply console `console.log(process.env);`
![OUTPUT](https://res.cloudinary.com/coder-202/image/upload/v1621671052/venu18/Screenshot_2021-05-22_at_1.40.33_PM_dhbxef.png)

See some more example 👇

```
require('dotenv').config()
const db = require('db')
db.connect({
  host: process.env.DB_HOST,
  username: process.env.DB_USER,
  password: process.env.DB_PASS
})
```  
!NOTE
.env includes sensitive information, so it should not be pushed with your code/GIT repo. Please make sure!
This is how you can avoid .env to push in your repo using GIT.

Create a file called `.gitignore` in the root directory of your project, then open it, then write `.env` in it. Now git will avoid pushing your .env file, you can know more about how .gitignore works [here](https://www.atlassian.com/git/tutorials/saving-changes/gitignore)

HAPPY CODE LIFE
Pass list of objects in Intent using Kotlin
Tags: kotlin, android
Published: 2021-05-22 11:16:30

---
title: Pass list of objects in Intent using Kotlin
published: true
description: 
tags: kotlin, android
canonical_url: https://lwgmnz.me/2021/05/21/pass-list-of-objects-in-intent-using-kotlin/
//cover_image: https://direct_url_to_image.jpg
---

Every Android developer is familiar with passing data between Activities using Bundle. The old Java way was to implement Parcelable class and then you override all the required methods. See example below. You can read more of the details here.

```
public class MyParcelable implements Parcelable {
     private int mData;

     public int describeContents() {
         return 0;
     }

     public void writeToParcel(Parcel out, int flags) {
         out.writeInt(mData);
     }

     public static final Parcelable.Creator<MyParcelable> CREATOR
             = new Parcelable.Creator<MyParcelable>() {
         public MyParcelable createFromParcel(Parcel in) {
             return new MyParcelable(in);
         }

         public MyParcelable[] newArray(int size) {
             return new MyParcelable[size];
         }
     };

     private MyParcelable(Parcel in) {
         mData = in.readInt();
     }
 }
```
I’m not really a fan of this type of implementation because it will make my data class more difficult to read and confusing.

Typically it is complicated to pass a list of objects between Activities. But lately in Kotlin all you have to do is simple.

First, in your data class you implement Serializable.

```
@Entity
data class ItemCount(
    @ColumnInfo(name = "id") val itemID: Int,
    @ColumnInfo(name = "name") val name: String
): Serializable {
    @PrimaryKey(autoGenerate = true) var id: Int? = null
}
```

Then in your source Activity, you add it to your bundle and cast it as Serializable.
```
val intent = Intent(this, FinishScanActivity::class.java)
intent.putExtra("list", listItemCount as Serializable)
startActivity(intent)
```

In your destination Activity, you retrieved the list.
```
val listItemCount: MutableList<ItemCount>  = intent.getSerializableExtra("list") as MutableList<ItemCount>
```
And that’s it.
A Creative Digital Agency Focused On Growing Brands Online

Tags: digitalmarketingagency
Published: 2021-05-22 10:34:19

Qattaf tech Helps Businesses take their Technology to the next level. Get an Instant Quote for our Top-Rated digital services in the San Gabriel Valley & Throughout Los Angeles County.

Qattaf tech has been providing exceptional Digital services to many businesses in the San Gabriel Valley and beyond. 

Named by Awards as one of the Pakistani most innovative digital agencies, Digital Marketing specializes in the design & Web development of digital products, websites, eCommerce, and apps. We partner with organizations who want to do more, engage better, and disrupt their categories. Fast.

http://qattaftech.com/
http://qattaftech.com/proxy-provider/

Office No 104 ,1st Floor Habib plaza Barkat market, Garden Town, Lahore, 54000
Tel                : +923094393314
Phone        : 971-999-9293
Skype ID   : akhawazbro
Mail           : contact@qattaftech.com
What are your thoughts on no-code builders?
Tags: discuss, nocode, watercooler, webdev
Published: 2021-05-22 11:12:05

I see no-code builders being launched right, left and centre. Let's talk about them.

I recently came across [YCode](https://www.ycode.com/). If you've ever worked with WordPress before, you'll notice that the no-code builders are very similar to the drag and drop builders used by a lot of WordPress themes like [Elementor](https://elementor.com/), minus the need to set up WordPress. Feels like we always had "no-code builders" around; we just called them "drag and drop builders."

Right now, no-code builders seem like an excellent option to create websites which involve basic CRUD operations. But how good are these builders for building something complex, something that involves doing things on the backend, integrating with other applications etc.? Is it possible to create micro-tools, for example, like [Typefully](https://typefully.app/) using these builders? If yes, please let me know what no-code tools would you need to use to make something like this. At what point/level of complexity should one not use a no-code builder?

I'd love to hear everyone's thoughts on this.
I made an Emoji App with Electron - Geniemoji
Tags: javascript, html, css, discuss
Published: 2021-05-22 10:59:44


# Geniemoji 🧞‍♂️
The Emoji Genie

{% youtube 2k41mwqKN9A %}
> [Download for your OS here](https://github.com/virejdasani/Geniemoji/releases)

## What is [Geniemoji](https://virejdasani.github.io/Geniemoji/)?
Geniemoji is an app that makes using emojis on desktop simpler than ever           
It works on operating systems including Windows, MacOS, and Linux!           
It is an open source, desktop app built using Electron                         
Its purpose is to serve you with the most relevant emojis based on your command!

## How does it work?
- Geniemoji lives in your Menu Bar once the app is launched
- The app doesn't show up in the dock or anywhere else
- You can summon Geniemoji using either the shortcut keys: <kbd>Control</kbd> + <kbd>e</kbd> or by pressing its icon in the menu bar
- The shortcut keys are the same across all operating systems

# This is Geniemoji 🧞‍♂️
![](https://virejdasani.github.io/Geniemoji/assets/SC-menuBarIcon.png)

> Geniemoji lives in your menu bar 👆    

![](https://virejdasani.github.io/Geniemoji/assets/SC-navigation.png)

> Geniemoji start page 👆              

![](https://virejdasani.github.io/Geniemoji/assets/SC-angryEmoji.png)

> Geniemoji emoji search 👆                

![](https://virejdasani.github.io/Geniemoji/assets/SC-geniemoji.png)

> Geniemoji emoji search 👆
Elasticsearch Analyzers – Basic Analyzers
Tags: elasticsearch, analyzers
Published: 2021-05-22 10:23:27

https://grokonez.com/elasticsearch/elasticsearch-analyzers-basic-analyzers

Elasticsearch Analyzers – Basic Analyzers


In this tutorial, we're gonna look at some basic analysers that Elasticsearch supports.

<!--more-->
<h2>1. Keyword Analyzer</h2>
<code>keyword</code> analyzer returns the entire input string as a single token.
<pre><code class="language-json">
POST _analyze
{
  "analyzer": "keyword",
  "text": "Java Sample Approach"
}
</code></pre>
Terms:
<pre><code class="language-json">
[ Java Sample Approach ]
</code></pre>
<h2>2. Whitespace Analyzer</h2>
<code>whitespace</code> analyzer breaks text into terms whenever it encounters a <strong>whitespace</strong> character.
<pre><code class="language-json">
POST _analyze
{
  "analyzer": "whitespace",
  "text": "The Java Sample Approach's tutorials."
}
</code></pre>
Terms:
<pre><code class="language-json">
[ The, Java, Sample, Approach's, tutorials. ]
</code></pre>
<h2>3. Simple Analyzer</h2>
<code>simple</code> analyzer breaks text into <strong>lower cased</strong> terms whenever it encounters a character which is not a letter.
<pre><code class="language-json">
POST _analyze
{
  "analyzer": "simple",
  "text": "The Java Sample Approach's tutorials."
}
</code></pre>
Terms:
<pre><code class="language-json">
[ the, java, sample, approach, s, tutorials ]
</code></pre>
<h2>4. Stop Analyzer</h2>
<code>stop</code> analyzer is just like <code>simple</code> analyzer, but supports removing <strong>stop</strong> words (<code>_english_</code> stop words by default).
<pre><code class="language-json">
POST _analyze
{
  "analyzer": "stop",
  "text": "The Java Sample Approach's tutorials over years."
}</code></pre>
Terms:

more at:

https://grokonez.com/elasticsearch/elasticsearch-analyzers-basic-analyzers

Elasticsearch Analyzers – Basic Analyzers