teleren/devto huggingface dataset:
Day 23-33 of 💯: Hiatus & Moving from Dev.to to Hashnode
Tags: 100daysofcode, devjournal, hashnode
Published: 2022-10-23 09:37:45

> This series is a #100DaysOfCode challenge about the making of [Passwordless.ID](https://passwordless.id), a free identity provider with enlightening simplicity.
>
> {% embed https://passwordless.id %}

Hiatus & Moving from Dev.to to Hashnode
=======================================

In the past, I regularly posted my progress of the #100DaysOfCode challenge on Dev.to, like every couple of days. But since more than a week, I stopped doing so, for various reasons.

1. It's useless
---------------

Let's face it, I'm uselessly spamming the site with low interest post. Don't misunderstand me, the posts are not bad, they are just irrelevant for most of dev.to's audience. It's more like a personal dev diary to track progress, not technical articles where you learn something which would rather fit users here.

2. Family time
--------------

Progress is not always a straight line. Sometimes you need to take a side road or a pit stop for various reasons. I had to spend some time with my family and it was a welcome break anyway.

3. Too much time spent on it
----------------------------

Writing every two days was actually too much for me. On one hand, it helped track progress more closely, on the other hand writing this "diary" was "proportionally" taking too much time away. Precious time that could have been spent on writing actual code and progressing faster.

4. Talking in an empty room
---------------------------

There were very few views, very few "likes" and very rarely a feeback comment. I originally hoped to build up interest and a following this way, but in the meantime I feel like I'm only talking in an empty room. Like being on a podium of a conference where people already left.

Conclusion
==========

I cannot blame the little interest, it's just a dev progress journal from an unknown guy of a random project. I'm not quitting though. It's just time for me to take this into account, adapt and move on.

From now on, I will:

- Post less frequently but about more "visible" progress and things you can actually use
- Move the articles to their own domain https://blog.passwordless.id thanks to Hashnode

The move to Hashnode is nothing against Dev.to. Actually, I find Dev.to a very nice, friendly and welcoming community. It's just that my articles are often a mismatch for the community here. Also, it's nice to have them hosted on their own domain too. ^^ This is particularly helpful if you want to link to one of your article, to have them all in the same place, for SEO, and so on. There, you can continue to follow my progress if you like, I'd be thrilled. 😉

Lastly, as announcement, my next post will also be my first post published Hashnode and of course with a copy here on Dev.to. It will also include the screenshots of the app, finally! Stay tuned! Thanks for the support so far.
How to get data from Cloudflare worker GET/POST requests
Tags: cloudflare, workers, post, get
Published: 2022-10-23 08:50:57

## Cloudflare worker

Cloudflare Workers provides a serverless execution environment that allows you to create entirely new applications or augment existing ones without configuring or maintaining infrastructure.



## Cloudflare-worker-request-data

Getting data from Cloudflare-worker requests is not as easy as you were working with Express.js on Nodejs, it is necessary to understand the organization of request in Cloudflare-worker.

Cloudflare-worker-request-data is a JavaScript package released under MIT license, which can help you with getting data from a GET or POST request. With this package, it is not necessary to study the API of request from documentation file, and the usage is quite simple and straightforward.

### Installation
```
npm i cloudflare-worker-request-data
```

### Example
```
import { RequestData } from 'cloudflare-worker-request-data';

export default {
	async fetch(request, env, ctx) {

        const data = await RequestData(request)
        
        // do something with the data			

	}
};
```

### Description

RequestData(request) in the above example can get return of

1. a String in case of “application/text” or “text/html”
2. a Object in case of “application/json”, “application/x-www-form-urlencoded”, “mutipart/form-data”
3. a String which is empty if nothing parsed
4. The request shall be either in GET or POST, other methods of request will directly return you with an empty String.
404 Error as Url Shortner without db
Tags: tutorial, watercooler
Published: 2022-10-23 08:50:47

Hey,
Recently I created a small script with just few lines of code as Url Shortner.

First how it works then where I am using it.

1. How it works

This is my url : https://getus.live

Now anything you type like
https://getus.live/yourname

Will redirect it to default 404 page as nothing is 'yourname' on server / linked to server.

I modified 404 default page to catch anything after my domain name. In this case /yourname is catched by 404 page and array with key ( yourname) will be redirected to "value" of the key. This value is long url.


Workflow:
In index page I asked the user to give the long url and key.
This will write a array with key and value. The key here is /yourname and value will be longurl.

To see in action visit
https://getus.live
Try yourself.

2. Where I am using it

(1) Url Shortner
(2) Navigation System
(3) Referal System catching values etc
(4) Bash UI to run commands.

Bye!!!
Convert Excel to JSON within Excel
Tags: excel, json, conversion, exceltojson
Published: 2022-10-23 08:47:19

In this blog post, a free solution for converting Excel to JSON is presented.

> Excel-to-JSON add-in

Excel to JSON is a Microsoft Excel add-in which can convert Excel to JSON.

### Works with

1. Excel 2016 or higher, or
2. Office 365, or
3. Excel Online

### Advantage

1. Free
2. No download
3. No installation
4. Load only when needed
5. Load within Excel
6. No need coding in Python/JavaScript (for example)

## Excel-to-JSON add-in
### How to load this add-in

[Documentation](https://excel-to-json.wtsolutions.cn)

Video guide
{% embed https://youtu.be/U3uQQ9i6IGs %}


### Steps

1. Go to Excel 2016, Office365 or Excel Online.
2. Insert Tab > My Add-ins.
3. In the popup window, go to Office Store
4. Search “Excel-to-JSON”.
5. Add this add-in
6. After loading, go to the “Excel-to-JSON” tab.
7. Now you are ready to use this add-in.

### How to use this add-in

[Documentation](https://excel-to-json.wtsolutions.cn)

Video guide
{% embed https://youtu.be/NvDDN84vJ_0 %}

### Example

Example Excel sheet - Source

|Name|	Age|	Company|
|---|---|---|
|David|	27|	WTSolutions|
|Ton|	26|	WTSolutions|
|Kitty|	30	|Microsoft|
|Linda|	30|	Microsoft|
|Joe|	40	|Github|

Example JSON - Output

```


[
    {
        "Name": "David",
        "Age": 27,
        "Company": "WTSolutions"
    },
    {
        "Name": "Ton",
        "Age": 26,
        "Company": "WTSolutions"
    },
    {
        "Name": "Kitty",
        "Age": 30,
        "Company": "Microsoft"
    },
    {
        "Name": "Linda",
        "Age": 30,
        "Company": "Microsoft"
    },
    {
        "Name": "Joe",
        "Age": 40,
        "Company": "Github"
    }
]
```
How to create an image from an existing container
Tags: docker, beginners, tutorial, programming
Published: 2022-10-23 08:29:01

Hi everyone! Earlier we have created docker container using nginx:alpine image and now we will learn to create snapshots of docker container. To the readers who have not read my previous article you can find it [here](https://dev.to/deogadkarravina/create-docker-container-9nj). Don't forget to like it and share it😄

## Docker run
Let's create a container from nginx:alpine image and name it as "myweb" that will run on 80 port using Docker run command.

docker run -p 80:80 --name myweb -d nginx:alpine

![docker create container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/knvx1c66enzqrwr1b9co.png)

We can now check our newly created container
docker ps -a

![docker container list](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dk45h5d5f8x62d3o1pty.png)

## Docker exec -it
Docker exec command is used to execute a command in the running container.

docker exec -it myweb /bin/bash

![Docker exec error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2q9p3v9yyoqvkb94tsy.png)

It gives us an error, but why so??
Its because bash is not installed on our container so we are going to use /bin/sh.

![Docker exec resolve](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nbr23zpa3fav9vhof65h.png)

Now let's add Tutorial.txt file in the root directory of our container.

![Echo file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ehr39m6hj06kxi4p0w8c.png)

press **'Ctrl + D'** to exit

## Docker commit

Now we have our container ready we can create snapshot of our container by using **docker commit** comand along with the container name/Id and new container name.
 
docker commit myweb mynginx

![Docker commit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zz69lesn7v66cme6a6dr.png)

Let's check our newly created docker images.

docker images

![Docker images](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0w5whpqdyfhebcngpqk.png)

And let's check if our file is there in image by creating a container from that image.

![Docker new container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gipvdpiulmu77xbr6ifh.png)

Our new container is created with name myweb_v2, now we will check for our **Tutorial.txt** file in a new container.

![Docker exec new conatiner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xwnoeb7xzgn6xrvgobz.png)

That's it for today, Happy Coding!.....
What is JavaScript JSON📖
Tags: javascript, webdev, programming, tutorial
Published: 2022-10-23 08:27:09

✔ JSON stands Form JavaScript Object Notation(JSON), JSON is Text Based Data Format, that is used to store and transfer data,
it is usually useful to sent to data server to webpage,

**Syntax of JSON**

```
{
 "MoviesStar":[
  {"firstName":"John","lastName": "cena"},
  {"firstName":"linda","lastName": "Friday"},
  {"firstName":"Teresa","lastName": "Plamer"},
]
}
```

🔴This above JSON Syntax defines movie star name object: an array of 3 moviestar record 

⭐In JSON data stored in KEY/VALUE Pair separate by comma, 

✨**JSON DATA**

JSON data is written as name/value pairs, just like JavaScript object Properties, A name and value pair consists of field name(in double qoutes), followed by a colon, followed by value,
e.g "name": "Tony"


**JSON Objects**

The JSON object is written inside curly braces{}, JSON objects can contain multiple key/value pairs,

for e.g :- 

```
{
   "firstName":"Tony",
   "lastName": "stark"
}
```

**JOSN Arrays:**

JSON array is written inside square Brackets[]. 
for e.g:-

```
//JSON array
["audi", "BMW", "jaguar"]


//JSON Array containing  objects
[
  {"name": "Tony", "age": 48},
  {"name": "Peter", "age": 20}
]
```

🚫**Note**:
JSON data can contain objects and arrays. However, unlike Javascript objects, JSON data connot contain functions as value.

⭐**Accessing JSON data**
We can access JSON data using the dot notation LIKE this,

 

```
//JSON object
const data = {
"name": "john",
"age":  22,
"hobby": {
"reading": true,
"gamming" false,
"sport": "football"
},
"class":["JavaScript", "HTML", "CSS"]

//accessing  JSON object
console.log(data.name); //john
console.log(data.hobby); //{"reading": true,"gamming" false,"sport": "football"}

console.log(data.hobby.sport); //football
console.log(data.class[1]); //HTML
}
```
A Nice Developer Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-10-23 08:00:13

---
title: "A Nice Developer Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12594d2dedc.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_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:___ Why can't SQL and NoSQL Developers date one other?

___A:___ Because they don't agree on relationships.
 -->
Express JS - part 1
Tags: javascript, beginners, node, webdev
Published: 2022-10-23 07:35:05

## What is Express js?
> It is a framework for node js written over node js.

Creating a server in **node js** is very time taking as well as it is difficult to understand for beginners.

_visual representation_

![lines of code node vs express](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gffpdybjhj8mmpwq8u0t.png)

## Why Express js?

Express allows developers to focus on business logic. Instead of focusing on details(routing, parsing incoming body requests).

## Installing Express and Creating server.

* install express in your project as production dependencies.
```
npm install --save express
```

* get required modules - in **app.js**
```
const http = require('http)
const express = require('express')
```

* set the app with the express()
```
const app = express()
```

* create server by calling createServer method and pass **app** as callback handler
```
const server = http.createServer(app)
server.listen(3000)
```

run the **nodemon server**
`npm start`

If nodemon not installed follow these steps
```
npm install --save-dev nodemon
```

* make changes to the **package.json** file - in **script**, add the main js file where the server is initialized.

* in my case main file is **app.js**
```
"scripts": {
    "start": "node app.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
```
A Note of Command-T Installation with Vim-Plug
Tags: vim
Published: 2022-10-23 07:33:38

The following codes are all of what I need to write to install [Command-T](https://github.com/wincent/command-t) as a user of [vim-plug](https://github.com/junegunn/vim-plug).

```
# config.lua
### In the block of vim.call
Plug 'wincent/command-t'

### In the outside of vim.call
### declare to use Lua
require('wincent.commandt').setup()
```

```
$ cd /path/to/plugged/command-t/lua/wincent/commandt/lib
$ make
```

----

P.S.
My instant feedback of this plugin:
- Cannot search with ultimate pass?
  - From /home, it take like about 1s to show the search bar
- How to write less everytime I call (default is |:CommandT|
I am installing React but i'm unable to install need Help!!!
Published: 2022-10-23 07:13:16

`npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote git://github.scm.corp.ebay.com/cubejs/cluster2.git
npm ERR! fatal: unable to look up github.scm.corp.ebay.com (port 9418) (No such host is known. )

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\chinm\AppData\Local\npm-cache\_logs\2022-10-23T07_00_46_404Z-debug-0.log

chinm@LAPTOP-RC0HQA36 MINGW64 /
$ npm install -g create-react-app my-app
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote git://github.scm.corp.ebay.com/cubejs/cluster2.git
npm ERR! fatal: unable to look up github.scm.corp.ebay.com (port 9418) (No such host is known. )

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\chinm\AppData\Local\npm-cache\_logs\2022-10-23T07_05_07_937Z-debug-0.log`

getting this error please help!!!
Discrete Mathematics (NPTEL) Handwritten Notes
Tags: nptel, discretemaths, dm
Published: 2022-10-23 07:12:36

Hi everyone,
So few day ago, I was searching for notes of Discrete Mathematics course of NPTEL by IIT Ropar's Professor Dr. Sudarshan Iyengar and I found a website for this. But I was only able to view them but couldn't download them so I managed to download them anyhow and I am curating them all here. Enjoy!

Note: I do not own these notes and these are not my property. If these are yours then do comment on this post and I will give you proper credits for this.

[Week 1](https://github.com/Vaib215/RandomMe/raw/main/Discrete%20Mathematics%20Notes/Week 1.pdf)

[Week 2](https://github.com/Vaib215/RandomMe/raw/main/Discrete%20Mathematics%20Notes/week-2.pdf)

[Week 3](https://github.com/Vaib215/RandomMe/raw/main/Discrete%20Mathematics%20Notes/week-3.pdf)

[Week 4](https://github.com/Vaib215/RandomMe/raw/main/Discrete%20Mathematics%20Notes/week-4.pdf)

[Week 5](https://github.com/Vaib215/RandomMe/raw/main/Discrete%20Mathematics%20Notes/week-5.pdf)

[Week 6](https://github.com/Vaib215/RandomMe/raw/main/Discrete%20Mathematics%20Notes/week-6.pdf)

[Week 7](https://github.com/Vaib215/RandomMe/raw/main/Discrete%20Mathematics%20Notes/week-7.pdf)

[Week 8](https://github.com/Vaib215/RandomMe/raw/main/Discrete%20Mathematics%20Notes/week-8.pdf)
RUNME: Run your readme.md
Tags: vscode, beginners, typescript, node
Published: 2022-10-23 06:28:13

It is a waste of time to copy and paste the scripts from README.md file to execute in the terminal. 
To save us from doing this there is a extension [Runme](https://runme.dev/) which helps us execute the code directly from the README file without any hassle.

Consider you are having these in your README.md file

## Install dependencies

```sh
npm install
```

## run nodemon

```sh
npm run start:dev
```

RUNME extension shows it like:

![README.md](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n0sucsd7jktzggpvy3sa.png)

and from the tiny run button in the left you can execute the commands from README.md


Try it once, You will feel the need to have the extension with you.

If you like the post follow me for more.
{% user rahulrajrd%}
The Truth behind Implicit/Explicit form labels
Tags: a11y, html, forms
Published: 2022-10-22 17:55:32

Recently I've been hearing to avoid "implicit" labels and to favor explicit labels for accessibility reason. This was the story I was given, but it felt like there was something missing from the story.

```html
<!-- Implicit -->
<label>
  Text
  <input>
</label>

<!-- Explicit -->
<label for="example">Text</label>
<input id="example">
```

After doing some research I found, like with all things, there is some more nuance to the story.

1. Both are 100% fine and completely valid according to all language and accessibility specifications.
1. **HOWEVER**, specs and real world implementations are two different things. Some actual screen readers *do* in fact have problems reading labels properly.
1. The issue *is not* related to the code being nested in a label, but instead whether there is an `id/for` attribute involved.

**Sources:**

* Screen reader benchmark testing:
  * https://a11ysupport.io/tests/html_label_element_implicit
  * https://a11ysupport.io/tests/html_label_element_explicit

* * *

**TLDR:**

```html
<!--
  Bad: Though all screen readers *should* work with this,
  some just won't play nice with it.
-->
<label>
  Text
  <input>
</label>

<!--
  Works: This has the same support in screen readers as
  the next option, but semantically it's not great, as the
  label header contains non-text content
-->
<label for="example">
  Text
  <input id="example">
</label>

<!--
  Best: This separates the label tag and input so their
  duties are not conflated, it uses the for/id attributes
  that works in all screen readers
-->
<label for="example">Text</label>
<input id="example">
```

And of course, make sure to use unique ID's.
Generate a Dev.to token
Tags: devtoken, devdottotoken, devtokenhacksqaud, devtotoken
Published: 2022-10-23 05:54:56

Steps to generate/get Dev.tp token for hacksquad...

1. Goto [dev.to](dev.to)
2. then go to Setting

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4q0v0wy4n6dhzmkpbz74.png)



3.then Go to Extension in setting


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/powngx1m4bew5ov88f7i.png)


4.then Scroll Down................
......
..
.
.
.
.
.

5. 
  Select a Repo


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2c1itcs5a4842azhax09.png)



6. Name a project


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/erd4615np6zwkyjzwysk.png)



7. Click On generate API key you will get it




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oml2fnzrfwbhab1xfmh0.png)
Introduction to JavaScript
Tags: javascript, script, beginners, programming
Published: 2022-10-23 05:48:39

## What is JavaScript ?
**JavaScript was initially created to “make web pages alive”.**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wha678idm26ivjc5k54o.PNG)
JavaScript is Scripting language and programs write in this language called as Script.

Scripts are provided and executed as plain text. They don’t need special preparation or compilation to run.
645. Leetcode solution in python3
Tags: python, challenge, chiki1601
Published: 2022-10-23 05:34:57

```python
class Solution:
  def findErrorNums(self, nums: List[int]) -> List[int]:
    for num in nums:
      if nums[abs(num) - 1] < 0:
        duplicate = abs(num)
      else:
        nums[abs(num) - 1] *= -1

    for i, num in enumerate(nums):
      if num > 0:
        return [duplicate, i + 1]

```
#Leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/set-mismatch/
Resolving a common mistake with `jq`
Tags: cli, json, tooling
Published: 2022-10-23 05:22:26

> `jq` is a lightweight and flexible command-line JSON processor.

## Scenario:
You may want to use `jq` to display the `package.json` file you are working on in a JS project but you're likely to encounter this error.

`jq package.json`
```
jq: error: package/0 is not defined at <top-level>, line 1:
package.json
jq: 1 compile error
```
## Resolution:
The correct syntax includes an additional `.` which specifies which filter to use.
`jq . package.json`

From the [website](https://stedolan.github.io/jq/manual/#Basicfilters)
> The absolute simplest filter is `.`. This is a filter that takes its input and produces it unchanged as output. That is, this is the identity operator.
Test Post by Bloggu
Published: 2022-10-23 04:58:02

![Alt text](https://img.bloggu.io/ipfs/bafkreictq7i2x44vdpyagnhhhga4rkvr6kxztq3rewzur3bnzvw66cjc2i)

This is a test submission by Bloggu.

Code: 

```
import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("Hello, world!")
            .padding()
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
```
my populate is not working correctly here, it only return the posts without the user
Published: 2022-10-23 04:57:50

router.get('/get', verify, async (req, res) => {
const post = await Post.find({})
  .populate("user")
    .then(post => {
      res.json({
        status:200,
        message: 'successfull post',
        successfull:true,
        post:post, 
      });
    })
})