teleren/devto huggingface dataset:
How I'm helping a non profit licensing org and You can too
Tags: opensource, discuss, showdev
Published: 2022-01-21 15:34:11

Open source projects are the backbone of internet.
From web servers to browsers mostly everything is open source and yet still there are people who steal open source project code , I'm referring it as stealing because they don't follow the license!
To prevent this ,a non profit community driven company named **Open Source Protector** with a motto that open source projects should be used as their license allows them to use it, OSP includes a few licenses one for commercial use,one for personal use and one for non profit use.If someone registers their project [here](https://dumbo-programmer.github.io/osp.github.io/protect.html) under any license osp provides(you can choose) , your project will be in their database and protected .If someone misuses your project you can file a report [here](https://dumbo-programmer.github.io/osp.github.io/report.html) and the community will help you legally. You can also contribute to OSP [here](https://dumbo-programmer.github.io/osp.github.io/contrib.html) and your github name will be included in the front page.Honestly this isn't a bad idea , it is actually a decent one . After-all having protection wouldn't hurt.
[OSP](https://dumbo-programmer.github.io/osp.github.io/)
Using hosts file to test websites with live domain on Mac - TEST LIVE
Published: 2022-01-21 15:18:27

`cd /etc`

`sudo nano hosts`

Insert the below:

`127.0.0.1 websitesareawesome.co.uk www.websitesareawesome.co.uk`

Then when you go to `websitesareawesome.co.uk` or `www.websitesareawesome.co.uk` in the browser it will actually be looking at the source from `127.0.0.1` but using those domains.
Installing Node Js. Ubuntu, and Gulp - Tips
Tags: tutorial, ubuntu, javascript, webdev
Published: 2022-01-21 15:15:15

I recently spent four days in the terminal trying to start a jQuery application. **Here are some mistakes I made so you don't have to.**

One, follow the documentation step by step. Even when I had one space or letter off, I had trouble installing the packages. 

Two, when typing in your Sudo password, Windows will keep it invisible for confidentiality, so commit it to memory if possible, and don't worry if you can't see it.

**Here's a very helpful tip.** You know how in JS, you can use `console.log` to debug? Here's a easy way to debug in Ubuntu to make sure that everything is working correctly. 

       gulp --version
       npm --version
       node --version
       npx --version 

You should get four sets of numbers like this: `6.14.4`.
 
**Also,** if running an application, and you're using `npm run watch`, make sure you have both a **local and external access URL**. 

And of course, don't give up. The problem will be solved, and hopefully with these tips you won't be in the terminal as long as I was.
how to make multi ussd on android
Published: 2022-01-21 15:07:57

Hi guys, I'm trying to do multi ussd with java on android, I can't do it.
I looked at the documentation of telephonyManager on android, with it I can execute a simple ussd request like *160#, but when I want to execute a ussd like *144*2*1#, I can't find the right way to do it. Thank you for your future reactions.
responsive vertical navbar  tailwind css | react | next js || glassmorphism desgin | html | css
Tags: webdev, beginners, tutorial, react
Published: 2022-01-21 15:06:29

responsive vertical navbar  tailwind css | react | next js || glassmorphism desgin | html | css

video link : https://youtu.be/v1u-WOCuyYY

in this video you will be creating a responsive vertical navigation bar working on all screen sizes using react | next js and tailwind css 
the video includes the follwing topics 🔥🔥🔥!
1- using  flexbox containers to align: the navigation links  and their associated svg icons , the logo and the user informations and the html  unordered list of links
2- using svgs in a react or a next js web application
3-tailwind css responsivity variants (sm,md,lg) to make our navbar work on all screen sizes
What is a Single-Page Application [ SPA ]?
Tags: react, angular, vue, javascript
Published: 2022-01-21 15:03:36

## What is SPA?

SPA as the name suggests means when you load the app for once. In simple words, the pages don't reload when you click on something. on clicking on an element on the page, SPA only renders that element, instead of what traditional pages do (rendering the whole page with every 🖱)

**If you Notice Gmail** when you browse through your email you’ll notice that not much changes during navigation - the sidebar and header remain untouched as you go through your inbox.

The three most popular SPA tools are:

1. ** Angular**: developed by Google and now almost ten years old)

2. **React**: created by Facebook a few years later

3. **Vue**: developed by an ex-Google employee and which has enjoyed a surge in popularity over the past few years.

---
## Examples of SPA

* Facebook
* Google Maps
* Gmail
* Twitter
* Google Drive

---
## Pros of SPA

1. **Speed and Response Time** because you are loading everything at once

2.  a **better User Experience** as users can access information very quickly.

3. **Caching** as SPA only have to request data from the server one time, upon initial download.

---
## Cons of SPA

1. SEO is the biggest problem with SPAs because of fewer pages and HTML Content.

2. will not work for users who have disabled Javascript in their browser


---
if you like this article then follow me on [Twitter](https://twitter.com/justansub)
I learn and try to simply stuff for you :)

Thanks For Reading!
Gradual Typing in Python
Tags: python
Published: 2022-01-21 14:53:20

---
canonical_url: https://waylonwalker.com/til/gradual-typing-python/
published: true
tags:
- python
series: til
title: Gradual Typing in Python
---

I've referenced a video from Anthony Sotile in passing conversation several times.  Walking through his gradual typing process has really helped me understand typing better, and has helped me make some projects better over time rather than getting slammed with typing errors.

{% youtube Rk-Y71P_9KE %}

## Step 1

Run Mypy as is, don't get fancy yet.  This will not reach into any functions unless they are alreay explicitly typed.  It will not enforce you to type them either.

``` bash
pip install mypy mypy .
# or your specific project to avoid .venvs
mypy src
# or a single file
mypy my-script.py
```

## Step 2

Next we will add `check-untyped-defs`, this will start checking inside functions that are not typed.  To add this to your config create a
`setup.cfg` with the following.

``` toml
[mypy] check_untyped_defs = True
```

## Step 3

The final stage to this series is to add `disallow_untyped_defs`.  This will start requiring all of your functions to be type hinted.  This one is probably the toughest, because as you type functions mypy can uncover more issues for you to fix.  Often times the list of errors grows before it shrinks.

``` toml
[mypy] check_untyped_defs = True
```

## Anthony's video

Make sure that you watch Anthony's video, give him a sub, he deserves it for all the great things he is doing for the python community.

{% youtube Rk-Y71P_9KE %}
TIL: JavaScript's void Operator
Tags: todayilearned, javascript
Published: 2022-01-21 14:30:39

---
title: TIL: JavaScript's void Operator
published: true
tags: TIL,javascript
canonical_url: http://matheusrich.com/til-javascripts-void-operator/
---

Today I discovered the [`void`operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void#immediately_invoked_function_expressions) in JavaScript. It evaluates an expression but always returns `undefined`.

```js
console.log(void "hello world") // prints `undefined`
```

It can be used on a [<abbr title="Immediately Invoked Function Expressions">IIFE</abbr>](https://developer.mozilla.org/en-US/docs/Glossary/IIFE), which usually uses parenthesis to make the function definition be interpreted as an expression and not a declaration:

```js
void function() {
  console.log("hello world")
}();
// prints "hello world"

(function() {
  console.log("hello world")
})();
// prints "hello world"

function() {
  console.log("hello world")
}();
// SyntaxError
```

This operator is also useful to ensure that an arrow function always return `undefined`:

```js
// changes to the return value of `doSomething` won't affect this code
button.onclick = () => void doSomething();
```

## Caveat

It’s important to note that this operator has a [high precedence](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table) with right-to-left associativity, so you may want to use parenthesis to correctly construct some expressions:

```js
void "hello" + " world" // parsed as: (void "hello") + " world"
// => 'undefined world'

void ("hello" + " world") // parsed as: void ("hello" + " world")
// => undefined
```
Started 2022 by updating portfolio website
Tags: react, webdev, showdev, nextjs
Published: 2022-01-21 14:20:18


I was thinking about making some changes in my portfolio website since past few months. I couldn't able to do so in 2021. So I started my 2022 by updating portfolio website. I want to share what major changes I made.

### <u>Major Changes</u>

- [Projects Page](https://mahmad.me/projects)
In previous version, I had projects list on home page. Now I added separate page for projects. [Code](https://github.com/MA-Ahmad/myPortfolio/blob/main/pages/projects.tsx)

- [Popular Articles](https://mahmad.me)
Removed ~~projects list~~ from home page and added popular articles. [Code](https://github.com/MA-Ahmad/myPortfolio/blob/main/components/home-page/PopularArticles.tsx)

- [Linked with Prisma ORM](https://www.prisma.io/)

- [Post Like Feature](https://mahmad.me/blog)
Now user can like posts and posts likes will be updated in real time wrt dev.to posts likes. [Code](https://github.com/MA-Ahmad/myPortfolio/blob/main/components/ui/LikeButton.tsx)

- [Dotted squares](https://mahmad.me)
Updated layout by adding dotted squares on both sides of page(from left to right). [Code](https://github.com/MA-Ahmad/myPortfolio/blob/main/components/layout/appLayout.tsx)

### Minor Changes
* Updated 2021 Achievements.
* Updated links hover colour wrt selected links colour from CMS(colour mode switcher).
* Added fallback skeleton for post cover image.
* Added multiple animations on hover and click events. 

### Future Work
* Show Post views
* Identify unique post likes
* Add changeLog page

Website link: [ma-ahmad](https://mahmad.me)
Github repo: [https://github.com/MA-Ahmad/myPortfolio](https://github.com/MA-Ahmad/myPortfolio)

### Projects Page
![projects page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbg92g895ewf06qkp19t.png)

### Blog Post
![post page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdadr8gsqas0zon0h6xn.png)

## Show your support

Give a ⭐️ on Github if you like this portfolio!
Flutter & Socket Tutorial for Beginners: Build Typeracer Clone
Tags: flutter, node, tutorial, socketio
Published: 2022-01-21 14:17:07

Flutter & Socket Tutorial for Beginners: Build Typeracer Clone 

Link: https://youtu.be/DabC5B508tQ

Features:
1. Create/Join Room with validation
2. Copy Room Code
3. Displaying Typed Words, Current Word & Words to be Typed
4. Real Time Progress of Users in Same Room
5. Leaderboard displaying User's WPM
6. Responsive UI
Paracetamol.js💊| #23: Explica este código JavaScript
Tags: javascript, webdev, spanish, beginners
Published: 2022-01-21 14:15:16

## **¿Qué imprime este código JavaScript?**

```js
!!null;
!!"";
!!1;
```

-     A: `false` `true` `false`
-     B: `false` `false` `true`
-     C: `false` `true` `true`
-     D: `true` `true` `false`


Respuesta en el primer comentario.

---
Paracetamol.js💊| #22: Explica este código JavaScript
Tags: javascript, spanish, beginners, webdev
Published: 2022-01-21 14:14:43

## **¿Qué imprime este código JavaScript?**

```js
[[0, 1], [2, 3]].reduce(
  (acc, cur) => {
    return acc.concat(cur);
  },
  [1, 2]
);
```

-     A: `[0, 1, 2, 3, 1, 2]`
-     B: `[6, 1, 2]`
-     C: `[1, 2, 0, 1, 2, 3]`
-     D: `[1, 2, 6]`

Respuesta en el primer comentario.

---
#Event – En Febrero hablamos de #Serverless y Computer Vision 👀 @MSFTReactor
Tags: englishpost, computervision, event, february
Published: 2022-01-28 14:41:41

---
title: #Event – En Febrero hablamos de #Serverless y Computer Vision 👀 @MSFTReactor
published: true
date: 2022-01-21 14:14:00 UTC
tags: EnglishPost,ComputerVision,Event,February
canonical_url: 
---

Buenas ! Enero fue un mes donde tuvimos varias sesiones sobre Serverless en el Microsoft Reactor en Toronto. En Febrero repetiremos algunas de esas sesiones en Español! Feb 04, Utilizando modelos de Azure Custom Vision en Azure Functions. GitHub Materials Feb 11, Utilizando modelos de Computer Vision entrenados con LOBE en Azure Functions GitHub Materials… [Continue reading #Event – En Febrero hablamos de #Serverless y Computer Vision 👀 @MSFTReactor](https://elbruno.com/2022/01/21/event-en-febrero-hablamos-de-serverless-y-computer-vision-%f0%9f%91%80-msftreactor/)
Improving MetaMask with custom tokens 🪙
Published: 2022-01-21 14:00:05

## Intro

MetaMask, by default, displays ERC20 tokens held in your wallet. Here’s how to add your custom tokens to your metaMask wallet!

## What are my options?

There are 2 primary methods of adding a custom token to MetaMask:

1. Through [Etherscan](https://etherscan.io/)
2. Directly through your wallet

Let’s talk about Etherscan first!

## Etherscan approach

1. Open your browser
2. Navigate to Etherscan
3. Search for your tokens contract
4. Click on more and click “Add Token to MetaMask (Web3)”
![Image of etherscan token address with option to add token to wallet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/li582pxmjf5mrgtkiah8.png)

5. Go back to your wallet
6. Select “Add Token”

![Image of MetaMask wallet with option to add token](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxe2lxhmgbbwv7dce61v.png) 

And that’s it! navigating to your account page will show your new token:

![Image of MetaMask wallet with new token present](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kkdy5a2nkf1jrlwvh7wi.png) 

Let’s try that again with the MetaMask Token Detection feature!

## MetaMask Token Detection

If you hold your token in your wallet, you can use MetaMasks experimental Auto Token Detection feature, which will attempt to auto-load tokens held within your wallet. Simply navigate to MetaMask, open settings and find Experimental. Then set it to on:

![Image of MetaMask experimental Auto Token Detection feature](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w70nis1gdkzltg5p5l2l.png)

And after a time, your token should appear!

If you liked this post don't forget to hit me up on 🐦 at [brandonkpbailey](https://twitter.com/brandonkpbailey) or GitHub at [brandon-kyle-bailey](https://github.com/brandon-kyle-bailey)
Express JS: Handling endpoints dynamically with classes
Published: 2022-01-21 13:44:45

```ts
// main.js

import { registerEndpoints } './utils/registry'

const express = require("express");

const Application = express();

(async () => {
	await registerEndpoints(Application, "../routes");
})();
```

```ts
// src/utils/registry 

export async function registerEndpoints(
	application: Application,
	dir: string = ""
) {
	const filePath = path.join(__dirname, dir);
	const files = await fs.readdir(filePath);
	const originalDir = dir;
	for (const file of files) {
		const stat = await fs.lstat(path.join(filePath, file));
		if (stat.isDirectory())
			registerEndpoints(application, path.join(dir, file));
		if (file.endsWith(".js") || file.endsWith(".ts")) {
			const { default: Endpoint } = await import(path.join(dir, file));
			const endpoint = new Endpoint();

			application.use(endpoint.path, endpoint.run);
		}
	}
}
```


```ts
// src/utils/structures/BaseRoute

export default abstract class BaseRoute {
	constructor(private path: string) {}

	getPath(): string {
		return this.path;
	}

	abstract run(req, res, next): void;
}
```

```ts
// src/routes/mySingleCallbackRoute.ts

import BaseRoute from "src/utils/structures/BaseRoute";

export default class mySingleCallbackRoute extends BaseRoute {
	constructor() {
		super("/mySingleCallbackRoute");
	}

	async run(req, res) {
        	res.send("Hello!")
	}
}
```

```ts
// src/routes/myMultipleCallbacksRoute.ts

import BaseRoute from "src/utils/structures/BaseRoute";

function Multiple(...functions) {
	return function (
		target: Object,
		key: string | symbol,
		descriptor: PropertyDescriptor
	) {
		const original = descriptor.value;

		descriptor.value = function (...args: any[]) {
			functions.forEach((func) => func(...args));

			original.apply(this, args);
		};

		return descriptor;
	};
}

export default class myMultipleCallbacksRoute extends BaseRoute {
	constructor() {
		super("/myMultipleCallbacksRoute");
	}

	@Multiple(
		function (_, __, next) {
			console.log("Middleware could be here :eyes:");
			next();
		},
		function (req, __, next) {
			if (req.body.id) {
				console.log(
					"Maybe only return next callback only if req.body.id was provided :eyes:"
				);
			}

			next();
		}
	)
	async run(req, res) {
		res.send("Hello!");
	}
}
```
Simple Image Picker with React Native
Tags: expo, reactnative, imagepicker, javascript
Published: 2022-01-21 13:40:50

In this blog, we are going to create a simple image picker with [expo-image-picker](https://docs.expo.dev/versions/latest/sdk/imagepicker).

First of all install _expo-image-picker_. 
By running this command in your terminal:
```terminal
expo install expo-image-picker
```

Now import this components inside your app.

```javascript
import * as ImagePicker from 'expo-image-picker';
```
We will also use Image component from react-native to display selected Image:
```javascript
import {  Image } from 'react-native';
```

Than we will create a function inside our component:
```javascript
const pickImage = async () => {
   let result = await ImagePicker.launchImageLibraryAsync({
      mediaTypes: ImagePicker.MediaTypeOptions.All,
      allowsEditing: true,
      aspect: [4, 3],
      quality: 1,
    });

// more code ...

}
```

To View this image inside our component we will use react state:
```javascript
const [images,setImages] = React.useState(null);
```

And than we will update pickImage function:
```javascript
  const pickImage = async () => {
    // No permissions request is necessary for launching the image library
    let result = await ImagePicker.launchImageLibraryAsync({
      mediaTypes: ImagePicker.MediaTypeOptions.All,
      allowsEditing: true,
      aspect: [4, 3],
      quality: 1,
    });

    // New code block
    if (!result.cancelled) { 
      setImage(result.uri);
    }
  };

```

We can display image like this:
```javascript
{image && <Image source={{ uri: image }} style={{ width: 200, height: 200 }} />}
```

To open image picker we will call pickerImage function on Button press:
```javascript
<Button title="Pick an image from camera roll" onPress={pickImage} />
```

This is how our app looks like at the end:

```javascript
import React, { useState, useEffect } from 'react';
import { Button, Image, View, Platform } from 'react-native';
import * as ImagePicker from 'expo-image-picker';

export default function ImagePickerExample() {
  const [image, setImage] = useState(null);

  const pickImage = async () => {
    // No permissions request is necessary for launching the image library
    let result = await ImagePicker.launchImageLibraryAsync({
      mediaTypes: ImagePicker.MediaTypeOptions.All,
      allowsEditing: true,
      aspect: [4, 3],
      quality: 1,
    });

    console.log(result);

    if (!result.cancelled) {
      setImage(result.uri);
    }
  };

  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Button title="Pick an image from camera roll" onPress={pickImage} />
      {image && <Image source={{ uri: image }} style={{ width: 200, height: 200 }} />}
    </View>
  );
}

```

I Hope this article helps you.
Happy coding:)
Test your Ruby skills with Evrone Quiz and win prizes!
Tags: programming, ruby, beginners, webdev
Published: 2022-01-21 13:36:00

Evrone is, above all, a skilled Ruby team. And, as experts in Ruby development, we’d like to invite you to test your knowledge in our new [Ruby Quiz](https://quiz.evrone.ru/ruby?utm_source=devto_en&utm_medium=article&utm_campaign=quiz1-anons) compiled by top senior developers.

Inside, you’ll find seven questions with several possible answers, only one of which is correct. If you answer all the questions correctly, you get an opportunity to win one of the prizes: Apple AirPods Pro, Yandex.Station or an Electrolux humidifier!

We will choose the winners using a random number generator on the [Evrone YouTube channel](https://www.youtube.com/c/EvroneDevelopment). Stay tuned!
🎬JavaScript Fetch API - Easy Example 🙌
Tags: html, css, beginners, javascript
Published: 2022-01-21 13:29:20

Use fetch API to get some data from an any external API 
and display it on your website: step-by-step from SCRATCH…

***
{% youtube rRvDGhx8Kgo%}

***

###Source Code:

**HTML**

```HTML
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>JavaScript Fetch API | Simple Example</title>
  <link rel="stylesheet" href="style.css">
  <script src="https://kit.fontawesome.com/fc0bcca8a3.js" crossorigin="anonymous"></script>
</head>

<body>

  <div class="results">
    <div class="result" id="cat_result">
      <p>Random Cat Placeholder</p>
    </div>
    <div class="result" id="dog_result">
      <p>Random Dog Placeholder</p>
    </div>
  </div>


  <div class="buttons">
    <button id="cat_btn">
      <i class="fas fa-cat"></i> Get Cat
    </button>
    <button id="dog_btn">
      <i class="fas fa-dog"></i> Get Dog
    </button>
  </div>


  <script src="app.js"></script>
</body>

</html>

```

**JavaScript**

```JavaScript
const cat_result = document.getElementById('cat_result');
const dog_result = document.getElementById('dog_result');
const cat_btn = document.getElementById('cat_btn');
const dog_btn = document.getElementById('dog_btn');

cat_btn.addEventListener('click', getRandomCat);
dog_btn.addEventListener('click', getRandomDog);

function getRandomCat() {
	fetch('https://aws.random.cat/meow').then((res) => res.json()).then((data) => {
   cat_result.innerHTML = `<img src=${data.file} alt="cat" />`;
});
}

function getRandomDog() {	fetch('https://random.dog/woof.json')
.then((res) => res.json())
.then((data) => {
 dog_result.innerHTML = `<img src=${data.url} alt="dog" />`;
	});
}
```
web design dubai
Published: 2022-01-21 13:13:55

The checklist looks so good. It is great sharing such information to others. Many people don't tell their success methods they are using in ranking their websites. Our [web designing company in dubai](https://www.webengrave.com/web-development-company-dubai) will help in case of designing a website. On the other hand many [online erp software dubai](https://www.realsoft.ae/) contributed their own ways, same as [accounting software in uae](https://www.coralme.com/most-used-accounting-software-in-the-uae/).