teleren/devto huggingface dataset:
Web servers with dart
Tags: dart, flutter, webdev
Published: 2022-01-17 16:00:18

So, you know `express.js` or `fastify` or `Koa.js`? Cool, but what if your primary language is [`dart`](https://dart.dev/)? You gonna learn Node.js just for that?!
  No right. I thought so.

So, what are we waiting for ? Let's get started for web servers in [dart](https://dart.dev/).

First of all, install the official `shelf` dependency.
```yaml
dependencies:
  shelf: ^1.2.0 # Prefer latest please !
```

Then, let's jump into the codes...
```dart
import 'dart:async';
import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart' as shelf_io;

Future<Response> manageRequests(Request request) async {
  print('[Debug] ${request.method} ${request.requestedUri.normalizePath().path}');
  switch (request.requestedUri.normalizePath().path) {
    case '/':
      return Response.ok(
        File('app/index.html').readAsStringSync(),
        headers: {
          'Content-Type': 'text/html',
        }
      );
    case '/index.html':
      return Response.ok(
        File('app/index.html').readAsStringSync(),
        headers: {
          'Content-Type': 'text/html',
        }
      );
    case '/tailwind.css':
      return Response.ok(
        File('app/tailwind.css').readAsStringSync(),
        headers: {
          'Content-Type': 'text/css',
        }
      );
    case '/script.js':
      return Response.ok(
        File('app/script.js').readAsStringSync(),
        headers: {
          'Content-Type': 'text/javascript',
        }
      );
    default:
      return Response.notFound('Not found');
  }
}

Future<void> serve() async {
  FutureOr<Response> Function(Request) handler = Pipeline().addHandler(manageRequests);
  try {
    HttpServer server = await shelf_io.serve(handler, 'localhost', 1134);
    print('[Info] Serving at http://${server.address.host}:${server.port} !');
  } catch (error) {
    print('[Warning] Port 1134 is already in use.');
    exit(0);
  }
}

void main(List<String>? args) async {
    await serve();
}
```

This will start the WebServer at the port `1134`.
Now Ofc there exists multiple libraries on [pub.dev](https://pub.dev) like `express.js` implemented in dart (with less features) but trust me, you seriously don't wanna get into those, this is the best way of making WebServers in [`Dart`](https://dart.dev/). More like fastest and easiest way in dart.

* Guess what, **This works in [Flutter](https://flutter.dev/) too...**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83mspu4nkaqpe40vfb7l.png)
How to change resolution of xcp-ng/XenServer VM (windows)?
Tags: xen, hypervisor, resolution, vm
Published: 2022-01-17 15:42:54

Follow the following steps

### Start in Recovery Mode

#### Windows 10
1. Open the `Windows Settings`
2. Click the `Update & Security` button
3. Under the recovery tab, press the `Restart now` button.

#### Windows 11
1. Press the Windows key to bring up the Start menu.
2. Next, `press and hold the Shift key` and click on the power icon from the Start icon.
2. Click on `Restart` once again at the confirmation prompt and wait until your PC boots directly into the recovery menu.


### Set Resolution

1. Navigate to `Troubleshoot > Advanced Options > UEFI firmware settings`.
2. Press `Restart`. During restart, the UEFI settings menu loads.
3. Navigate to `Device Manager > OVMF Platform Configuration`. This displays the current screen resolution.
4. Press `Enter` to see the screen resolution options.
5. Use the arrow keys to select the desired screen resolution and press `Enter`.
6. Press `F10` to save the changes and confirm your choice.
7. Reboot the VM to see the `XenCenter` console in an updated screen resolution.
How To: Undo the Last Commit From Your Remote Git Repository
Tags: github, git, beginners, tutorial
Published: 2022-01-17 15:31:53

To undo the last commit from a remote git repository, you can use the git `reset command`.

First you can use the following command to undo the last commit locally.
```bash
git reset HEAD^
```

Then you are able to use the following command to force push the local commit which was reverted to the remote git repository.
```bash
git push origin +HEAD
```
What is an NaN error in JavaScript?
Tags: javascript
Published: 2022-01-17 15:31:13


![keyboard](https://cdn.hashnode.com/res/hashnode/image/upload/v1642426483640/LxU95EVz1.jpeg)

Have you ever wondered what is `NaN` error coming in your project? 🤔

Today, in this article I am going to discuss the `NaN` error in detail.

### Let's get started 🚀
In JavaScript, NaN stands for **Not a Number**.
This error occurs when you parse something to a number that is not a number

Let's see it with an example,
```js
var helloWorld = parseInt(helloWorld);
```
This will return `NaN`

didn't get it? No problem let's get a little simpler
```js
var helloWorld = parseInt("Hello World");
```
`"Hello World"` is a `string` and we are parsing to an integer but that is not possible therefore the browser will return `NaN`

### `isNan()` Method
`isNan()` will return **true** if a value is **NaN**
![example](https://c.tenor.com/UAQtLSCj7ZsAAAAC/for-example-instances.gif)
```js
isNaN(18)
// false
isNaN(18.81)
// false
isNaN("JavaScript")
// true
isNaN("233.3")
// false
isNaN('17/01/2022')
// true
```
As you can see `numbers` will return false as they are not **NaN** even if, the number is in the form of `string`.
Any string (word or sentence) will return true as it is **NaN**

Me when `isNaN("123")` showing **false**:
![confusing](https://media3.giphy.com/media/3o6Mb774rffWwh0AXm/giphy.gif?cid=790b76112f180da4dd565201280ffee81cd23c536313fd33&rid=giphy.gif&ct=g)

What about you? Comment 👇

![wait a minute](https://media3.giphy.com/media/XrWwIchnRfynuvlpRF/giphy.gif?cid=ecf05e47ax8gpdq4b9hdljbvrwn8fzoq14e066etjbi9m3x4&rid=giphy.gif&ct=g)

### Here comes, something that contradicts
As discussed earlier, `isNan()` will return **true** if a value is **Not-a-Number(NaN)**
`Number.isNaN()` method while is completely opposite of `isNaN` method, here `Number.isNaN()` will return `true` if **number** is `NaN`

Let's go with an example,
```js
isNaN('JavaScript')
// true
Number.isNaN('JavaScript')
// false
```
```js
isNaN(18)
// false
Number.isNaN(18)
// true
```

***
Thank you for reading, have a nice day!
- Follow me on Twitter - [@codewithsnowbit](https://twitter.com/codewithsnowbit)
- Subscribe me on YouTube - [Code With SnowBit](https://www.youtube.com/channel/UCNTKqF1vhFYX_v0ERnUa1RQ?view_as=subscriber&sub_confirmation=1)
![Have a nice day.png](https://media1.giphy.com/media/dxP4KodrzNRL91Gkyy/giphy.gif?cid=ecf05e47oy2662od7onakbpjjmfizbw8i5shlaingerfzyhk&rid=giphy.gif&ct=g)
Engneer...student😑
Tags: career
Published: 2022-01-17 15:17:52

Hiii,😃🙌 all how are you doing? i hope you all are doing well
so, i am here to talk about related to career of an engineer student 
and i have some questions for you 🎃 
♻ how are your academics performance?
♻ are you all spending time on your career?
♻ how does covid-19 affect your academic-curriculum?
♻ are you getting a emotional support from parents or professors?
♻ are you even trying to enjoy your life? or you spent all day inside your home? 

`i have asked this question to myself and my answer is 😶
MY ALLOVER RELATED TO ACADEMICS AND COLLEGE LIFE IS DOWNSIDE 📉 AND I AM LIKE I DONT WANT TO THIS ANYMORE`

and pls let me know the answers 🙂 what are you feeling about so take care see you in next blog 👋👋
Term To SVG
Published: 2023-01-05 22:42:26

---
title: Term To SVG
published: true
date: 2022-01-17 15:14:22 UTC
tags: 
canonical_url: https://brandonrozek.com/blog/termtosvg/
---

With [`termtosvg`](https://github.com/nbedos/termtosvg) made by Nicolas Bedo we can make SVG animations from terminal output in the style of [asciinema](https://asciinema.org/). To install use [pipx](/blog/managepythonapps/).

```
pipx install termtosvg

```

To start recording, run the command `termtosvg`

```
termtosvg

```

It first outputs:

```
Recording started, enter "exit" command or Control-D to end

```

At “exit”, by default it will save the animation to a random filename in the tmp folder.

```
Rendering ended, SVG animation is /tmp/termtosvg_xmadgf9y.svg

```

To control the default save location, pass in a filename after `termtosvg`

```
termtosvg /path/to/savefile.svg

```

To record only the execution of a particular command, use the flag `-c`

```
termtosvg -c neofetch

```

I recommend that you resize the terminal window so that the frames generated match the desired width and height. You can instead use the `-g` flag to pass in a geometry. (“100x30” creates a screen with 100 colums and 30 rows)

Lastly, if you don’t want an animation, you can pass in `-s` and the result will be a folder of SVG files representing each frame.

```
termtosvg -s

```

Here is an example of an animation I made with this tool:

![](https://brandonrozek.com/files/images/blog/202201171031.svg)
Simple web scraper that reads all the links to JSON files in JS
Tags: javascript, webdev, tutorial, programming
Published: 2022-01-17 15:10:35

I had to get a list of all links on a webpage for a task I was working on. here I am sharing the snippet of code that I used. Let's discuss how to improve it 

```javascript
var tag = document.querySelectorAll("a");
var myarray = []
for (var i = 0; i < tag.length; i++) {
    var nametext = tag[i].textContent;
    var cleantext = nametext.replace(/\s+/g, ' ').trim();
    var cleanlink = tag[i].href;
    myarray.push([cleantext, cleanlink]);
};
function generateJson() {
    var hrefArray = [];
    for (var i = 0; i < myarray.length; i++) {
        let t = {}
        t.n = myarray[i][0]; t.m = myarray[i][1];
        hrefArray.push(t);
    };
    var win = window.open("Json");
    win.document.write(JSON.stringify(hrefArray));
}
generateJson()

```

**Steps**

1. You will need to open the website in your browser to get all links
2. Go to the console tab in Inspect element
3. Please paste the above code and press enter. A json file will open in a new window

**Screenshots**

1. How to Run


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

2. Result 


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


Please let me know your thoughts after reading
Teach me RANSAC Algorithm like I'm 5
Tags: datascience, machinelearning, python, tutorial
Published: 2022-01-17 13:51:10

I was in a computer vision class when I first heard about the **RANSAC** algorithm in OpenCV, at first I didn't quite get it, the instructor tried his best though, but I guess I'm a little dumb 😅. Hence my reason for writing this piece so anyone still struggling to figure it out can take deep breath of fresh air 😊.

**RANSAC** stands for Random Sample Consensus, an effective algorithm used for treating data affected by outliers. 

RANSAC is able to treat these kinds of data by grouping the data points into 2 separate categories:

- The inlier set and 
- The outlier set

By doing this, **RANSAC** eliminates your concerns of handling outliers. The outliers are simply ignored and now you only have the inlier data points to work with.

Lets have a look at the regression line fitted through the 2D data points.

![Image description](https://www.researchgate.net/profile/Mohammad_Adib_Khairuddin/publication/317841563/figure/fig2/AS:512573764505600@1499218516778/MGE13-Linear-Regression-Ln-Scatterplot-with-Linear-Regression-Line-of-Ln-Likes-L-i.png)

You might notice that some  of the data points fall in line or close to our fitting line while others fall out. The question now is, how can we separate the inliers from the outliers. You see where the **RANSAC** algo comes in? 😉😜

The RANSAC algorithm iteratively looks for the best fitting with the highest number of inliers. The fitting point with the highest number of inlier is choosen and that is the basics of what **RANSAC** is all about.

**Conclusion:**
Random Sample Consensus is basically a 4 ways procedure of dealing with outliers.

- Sample a small subset of datapoints and treat them as inliers
- Take the potential inliers and compute the model parameters
- Score how many data points supports the fitting.
- Repeat and take the best fitting score. 😁💃

**RANSAC** can be applied during image analysis to determine the position and orientation of a robot by analyzing the associated camera images.

My name is AC Nice and I love Computer Vision
Top 3 Colour Picker Websites , Must Try For Your Project .
Tags: css, webdev, design, programming
Published: 2022-01-17 15:03:51

## Top 3 Colour Picker Websites , Must Try For Your Project .

So , The First One Goes .

1) [Grabient.com](https://www.grabient.com/)

![Grabient Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6i7j09i5b2dy0jdzj1i.png)

2) [GradientHunt.com](https://gradienthunt.com/)

![GradientHunt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/57y8ec1v2bmfh12d0lty.png)

3) [GradientHunt By ShapeFactory](https://gradient.shapefactory.co/)

![Gradient Hunt By ShapeFactory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ievwks7tje34y957dasw.png)
Python Respect the .gitignore
Tags: python, todayilearned
Published: 2022-01-17 14:56:05

---
canonical_url: https://waylonwalker.com/til/gitignore-python/
cover_image: https://images.waylonwalker.com/til/gitignore-python.png
published: true
tags:
- python
- todayilearned
series: til
title: Python Respect the .gitignore
---

Many tools such as ripgrep respect the `.gitignore` file in the directory it's searching in.  This helps make it incredibly faster and generally more intuitive for the user as it just searches files that are part of thier project and not things like their virtual environments, node modules, or compiled builds.

> Editors like vscode often do not include files that are .gitignored in
> their search either.

`pathspec` is a pattern matching library that implements git's wildmatch
pattern so that you can ignore files included in your `.gitignore` patterns.  You might want this to help make your libraries more performant, or more intuitive for you users.

```python
import pathspec from pathlib import Path

markdown_files = Path().glob('**/*.md') if (Path(".gitignore").exists():
    lines = Path(".gitignore").read_text().splitlines()

    spec = pathspec.PathSpec.from_lines("gitwildmatch", lines)

    markdown_files = [
        file for file in markdown_files if not spec.match_file(str(file))
    ]
```

`pathspec` [home page](https://github.com/cpburnz/python-path-specification)

---

This is my til series, I try to post daily in this series on things that I learn or teach someone. All my tils are posted in [this feed](https://waylonwalker.com/til/) on my website.
Speed up your Website
Tags: javascript, webdev, programming, css
Published: 2022-01-17 14:54:05

# Speed up your webpage

we can speed up our webpage using some websites. Through this, we can develop our web development skills.

## 1  [Page Speed Insights](https://pagespeed.web.dev/)  
On this website, we can know our webpage's performance.

![speed.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1642429407895/QcZ7aY6mpV.png)

## 2 [CSS Minifier](https://www.toptal.com/developers/cssminifier/) 
CSS Minifier is a webpage that will reduce webpage size and unwanted lines and space.

![css minifier.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1642429705201/OpCIEIZdV.png)

## 3  [Minify](https://www.minifier.org/) 
On this website, we remove unwanted lines and functions.

![js.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1642429930955/SB9pH0HyZ.png)

## 4  [TinyJPG](https://tinyjpg.com/) 
Tinyjpg will help us to reduce the size of jpg without reducing it resolution.

![jpg.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1642430190433/OEKhk-cAyc.png)
Ci sono italiani su dev.to?
Published: 2022-01-17 14:53:54

Ci sono pochi lavori al mondo che necessitano di una formazione continua come quello del web developer: un settore talmente immenso e pieno di nuove cose da imparare da far diventare la curiosità quasi un difetto.

**Dev.to** è diventato da più di un anno la mia finestra su questo mondo. La stragrande maggioranza dei contenuti, come è normale che sia, sono in lingua inglese, ma almeno una volta al giorno trovo un post in un'altra lingua e allora mi sono chiesto: ma ci sono italiani su dev.to?

Questo post ha, da un lato, lo scopo di invitare gli altri sviluppatori della penisola italica a lasciare un "Ciao" nei commenti e dall'altro quello di sperimentare la funzionalità di pubblicazione di contenuti di questa piattaforma.

**p.s.**
Il fatto che esistano i tag **spanish** e **french**, ma non **italian** per indicare la lingua del post mi fa venire un certo rigurgito di patriottismo Gaberiano

{% youtube 5M7OnukqHxg %}
A css tip to remember
Tags: css, transform, tips
Published: 2022-01-17 14:47:48

---
title: A css tip to remember
published: true
description: A css transform tip to vertically position elements
tags: css,transform,tips
cover_image: https://images.unsplash.com/photo-1518644730709-0835105d9daa?&auto=format&fit=crop&w=1200&q=80
---

Hey everyone! 👋

Here is a quick tip you might find helpful while writing `css`. 

You might be surprised how `css` can confuse you doing something very simple as positioning an element. 

*The order by which you use the properties for a css `transform` property can give you different results.*

e.g Using a `translate` and `rotate` in a `transform` property together might give you different results based on what order you use them.

Checkout the codepen below:

{% codepen https://codepen.io/hunzaboy/pen/rNGRvJJ default-tab=result %}

Enjoy :) 

Cover photo by <a href="https://unsplash.com/@brucemars?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">bruce mars</a> on <a href="https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Google Maps Places API JavaScript
Tags: javascript, programming, tutorial
Published: 2022-01-17 14:44:28

{% youtube PAgjMTFCzIg %}

If you want to get all of the restaurant data from a specific city by text search in your application, you have come to the right place.

In this tutorial, you’re going to learn how to do exactly that using Google Maps Places API. Also, I will be covering how to get more information about a specific restaurant using place_id.

###STEP #1: Get the API Key

{% youtube ASiEw-eakWM %}

Log in to Google Cloud Platform

![alt text](https://softauthor.com/wp-content/uploads/2019/08/google-cloud-platform-console.png)

Then, go to Select a project ▾ drop-down menu which will open up a dialog box with your existing projects if any. Choose the one that you want to obtain an API key from.

![alt text](https://softauthor.com/wp-content/uploads/2019/08/select-a-project-google-places-api.png)

Otherwise, create a new project by clicking the NEW PROJECT button at the top right of the dialog box.

![alt text](https://softauthor.com/wp-content/uploads/2019/08/create-a-new-project-google-cloud-platform.png)

Once the project is selected, go to the Navigation Menu button at the top left of the page, choose **APIs & Services** → **Credentials**

![alt text](https://softauthor.com/wp-content/uploads/2019/08/apiservices-credentials.png)

Select **Create Credentials** → **API Key** which will open up a dialog box with your API Key. 🔑

That’s it… you have it! 🙂

###STEP #2: Make A Request On Places API

[Continue Reading...](https://softauthor.com/google-maps-places-api-javascript/)
Empleos en Data y Analytics LATAM — Ene 2022 - II
Published: 2022-01-17 14:31:08

Te compartimos las ofertas laborales del mes para áreas de Data, Analytics y Cloud 👨‍💻👩‍💻.
✅[Data Analyst- AIRA (Perú)]
(https://pe.indeed.com/viewjob?jk=cc7444fd96c5e2b2&tk=1fpk6kjf9n5fa800&from=mobhp_jobfeed)
✅[Data Engineer- Loka (Colombia)]
(https://co.indeed.com/viewjob?jk=70edddbe023dd89f&tk=1fpk6qgktu4b7800&from=serp&vjs=3)
✅[Data Scientist - Banco Pichincha (Ecuador)]
(https://ec.indeed.com/viewjob?jk=067d6c711fb7be5c&tk=1fpk6rouuhiin802&from=serp&vjs=3)
✅[Machine Learning Analyst - Olitel (Chile)]
(https://cl.indeed.com/viewjob?jk=2a34d73ce5023090&tk=1fpk6t82lu4ib800&from=serp&vjs=3)
✅[Data Analyst - IQVIA (Mexico)]
(https://mx.indeed.com/viewjob?jk=d7670117f3285b01&tk=1fpk6uhlkt520800&from=serp&vjs=3)
✅[Data Engineer- Toptal (Bolivia)]
(https://www.linkedin.com/jobs/view/2877875551/?eBP=NotAvailableFromMidTier&recommendedFlavor=ACTIVELY_HIRING_COMPANY&refId=NKMF%2BmnqjrE%2BCgpUbl4B5w%3D%3D&trackingId=bP9wjb8XQUdoyiGtrv7D4A%3D%3D&trk=flagship3_search_srp_jobs)
✅[Data Scientist - Media.Monks (Argentina)]
(https://ar.indeed.com/viewjob?jk=7e5643864312b71e&tk=1fpk72pseu1ev802&from=serp&vjs=3)
✅[Machine Learning Analyst - SoilProbe Solutions Inc. (Venezuela)](https://ve.indeed.com/viewjob?jk=3404669aa2fc6c22&q=Data+Engineer&tk=1fpk744nsn52g802&from=hpd&advn=7796948713395864&adid=381812308&ad=-6NYlbfkN0BT8UjAwk0DMgei7yD-mRf-LzOxorhxGWk7mTD9AHdvJu1x2SumQU4G5D6-9tFKvSZF4l11mtZe2ZryoV5ETOTxd-pS7SbLe7qmH5QPEJ22fo8OAGAi3_RIbZu1h7EyK9KOKuOXUXb7DRg51w2paFVzTSuDWMF3fg48rnd7HXAWC4cImHtr8HmyTAqDBUFxljadMIjxJbEbYrG7T903Vne05N8eHwOZ9-OyhuSFFgJlyY6KgcycbMx-ELubKrMLA619aFXBV3u5M3e9Agl4c-Y4Z68rj3e5pU6nenMkiDycck8bv0s2ZMKZGtwxeNOAByJSmRNo5EvXwvc3bC8aB1Bbi_JxAzsJ9Q0dLV5O4-Ybb-4Slu88XCG6ZWMyIvQ6Slk9hn8qAyJWVe2dcaqeIpzSangxZSjx-v5aSYmK9H-aPg%3D%3D&pub=4a1b367933fd867b19b072952f68dceb&vjs=3)


Aprende, aplica y crece en proyectos de Data y Analytics en Cloud.

Visita nuestra página:
👉🌐 datahack.la
How about editing a video by coding using a free to use API?
Tags: flutter, shotstackapi, webdev, dart
Published: 2022-01-17 14:30:11

I created a flutter web app that reads user's name and output a video showing the name, place (using IP address) and current time.
Isn't it cool?

Check it out: https://codethevideo.web.app/#/

I used [ShotStack API](https://shotstack.io/), free with watermark, that renders video in cloud according to a request json file(json format is described in the [docs](https://shotstack.io/docs/api/#shotstack)) which contains structure of timeline of the video.

Github Repo : https://github.com/sajithlaldev/CloudVideoRendering_ShotStackAPI.git
Using ExpressionEngine To Power Your JavaScript Frontend Using Bones
Tags: expressionengine, eecms, headless, vue
Published: 2022-06-01 20:17:23

---
title: Using ExpressionEngine To Power Your JavaScript Frontend Using Bones
series: Headless ExpressionEngine
published: true
date: 2022-06-04 14:26:00 UTC
tags: ExpressionEngine,eecms,headless, vue
canonical_url: https://u.expressionengine.com//article/using-expressionengine-to-power-your-javascript-frontend-using-bones
cover_image: https://u.expressionengine.com/asset/article-images/bones-banner.jpg
---

Let’s take a look at building a Vue.js frontend powered by headless ExpressionEngine using the [Bones](https://expressionengine.com/add-ons/bones) add-on.

Bones is a super simple way to utilize ExpressionEngine as a headless content management system for use in javascript frontends, static site builders, and more!

YouTube: {% youtube rOOziVmUvS8 %}

Find more information here:

Bones Hello World: [https://github.com/dougblackjr/bones-hello-world](https://github.com/dougblackjr/bones-hello-world)

 -- 

Originally published by [Doug Black](https://u.expressionengine.com/author/doug-black) at [u.expressionengine.com](https://u.expressionengine.com//article/using-expressionengine-to-power-your-javascript-frontend-using-bones)