teleren/devto huggingface dataset:
Primeiro release da Devgym
Published: 2023-02-11 12:10:09

Opa! Espero que você tenha tido um excelente final de ano, e que 2023 seja incrível pra todos nós.

Esse é o primeiro capítulo da [Devgym.com.br](Devgym.com.br), uma academia para devs onde são encontrados desafios técnicos inspirados em testes práticos de entrevista de emprego. A ideia foi inspirada por algumas plataformas gringas como o [frontendmentor](https://www.frontendmentor.io/) e o [codecrafters](https://codecrafters.io/) mas tem algumas diferenças particulares.

Os desafios são todos gratuitos e qualquer dev pode usar a plataforma para pedir code review dentro da comunidade que será criada ao redor dela.

{% embed https://www.youtube.com/watch?v=cZFuHjohQ70 %}

Além disso a ideia é que a longo prazo, através de um Plano Pro, devs tenham acesso a soluções oficiais de desafios, assim como um material de apoio como um vídeo explicando as decisões tomadas até a solução.

Aos poucos eu vou descrevendo aqui e no canal do YouTube os próximos passos da Devgym. Qualquer dúvida ou sugestão pra plataforma, é só entrar em contato em qualquer lugar.
Frontend Mentor QR Component
Tags: webdev, opensource, css, beginners
Published: 2023-02-11 11:50:26

Hey, guys welcome to this step-by-step tutorial on how to build a preview card component. Without wasting time let's jump right into it. To get started download these starter files. Make sure you signup/signin to frontend mentor if necessary.

In case you want a video tutorial: Check out mine
{% embed https://youtu.be/s2o--Ry1v4U %}
```html
Getting Started with the HTML(study it carefully)`
<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- displays site properly based on user's device -->

  <link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
  
  <title>Frontend Mentor | QR code component</title>

<link rel="stylesheet" href="./style.css">
</head>
<body>
  <div class="container"> <!---Always good to have coontainer, it will 
help us center it!
!--->

      <div class="card">
          <div class="card-img">
            <img src="./images/image-qr-code.png" alt="">
          </div>

          <div class="card-content">
            <div class="card-title">
              
         <h3> Improve your front-end <br/> skills by building projects</h3>

            </div>
            <div class="card-body">
     <p>
      Scan the QR code to visit Frontend Mentor and take your coding skills                               to the next level
     </p>    
            </div>
          </div>
      </div>
    
  </div>


<!--- Attribution not required!--->
</body>
</html>
```
```css
/* From style Guide and it's for the font */
@import url("https://fonts.googleapis.com/css2family=Outfit:wght@400;700&display=swap");
/* It centers the card in the dead center */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
/* Some basic card styles */
.card {
  width: 300px;
  background: white;
  padding: 15px;
  border-radius: 20px;
}
/*Helps us control the image*/
.card-img img {
  height: 300px;
  border-radius: 20px;
}
/* Applying a bacckground and font */
body {
  background-color: hsl(212, 45%, 89%);
  font-family: "Outfit", sans-serif;
}
.card-content {
  text-align: center;
  padding: 10px;
}

.card-body {
  color: hsl(220, 15%, 55%);
}
h3 {
  font-size: 22px;
}
```
nyc school menu 2023
Published: 2023-02-11 11:33:44

[https://multischolar.com/school-calendar-nyc/](https://multischolar.com/school-calendar-nyc/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)
https://plaza.rakuten.co.jp/chenlee/diary/202302110001/
https://www.provenexpert.com/nyc-school-menu/
https://www.producthunt.com/@nycschoolmenu
https://www.divephotoguide.com/user/nycschoolmenu/
https://vocal.media/authors/nycschoolmenu
https://www.lifeofpix.com/photographers/nycschoolmenu/
https://seedandspark.com/user/nycschoolmenu
https://rosalind.info/users/nycschoolmenu/
http://phillipsservices.net/UserProfile/tabid/43/userId/198564/Default.aspx
https://app.roll20.net/users/11617325/nycschoolmenu
https://speakerdeck.com/nycschoolmenu
https://social.msdn.microsoft.com/Profile/nycschoolmenu
https://camp-fire.jp/profile/nycschoolmenu
https://plazapublica.cdmx.gob.mx/profiles/nycschoolmenu/activity
https://www.metal-archives.com/users/nycschoolmenu
https://storium.com/user/nycschoolmenu
https://leanin.org/circles/nycschoolmenu
https://trabajo.merca20.com/author/nycschoolmenu/
https://www.intensedebate.com/people/nycschoolmenu
https://www.mifare.net/support/forum/users/nycschoolmenu/
https://pinshape.com/users/2572423-nycschoolmenu
http://foxsheets.com/UserProfile/tabid/57/userId/120649/Default.aspx
https://www.kompasiana.com/nycschoolmenu
https://www.credly.com/users/nyc-school-menu/badges
https://www.myminifactory.com/users/nycschoolmenu
https://www.sqlservercentral.com/forums/user/nycschoolmenu
https://www.longisland.com/profile/nycschoolmenu
https://guides.co/a/nyc-school-menu/
https://myanimelist.net/profile/nycschoolmenu
https://www.iheart.com/podcast/269-nyc-school-menu-108716252/
The difference between Push, Pop, Shift and Unshift in Javascript Array
Published: 2023-02-11 11:25:35

Array is a very important concept in JavaScript and in programming as well. It is used to store related data in a single block. You can create it with the let, var or the const keyword.

```
//example
let arry = ["John", "Tobi", "Musa"];

```
It has some amazing methods, but we'll only explore 4.

The push() method is used to add an element at the end of the array. It also returns the added element.

`arry.push("Ifeanyi").
 console.log(arry);
// the result will be
["John", "Tobi", "Musa", "Ifeanyi"];`

The pop() method. It removes the last element in an array, it also returns the element.
`arry.pop();
console.log(arry);
//the result will be
["john", "Tobi", "Musa"];`

The shift() method. This method removes the first element in an array. It behaves like the pop() method but in an opposite direction. 
`arry.shift();
//the result will be
["Tobi", "Musa"];`

The unshift() method. This method adds a new element at the beginning of an array. It also behaves like the push() method but in an opposite direction.
`arry.unshift("Ayo");
//the result will be
["Ayo", "Tobi", "Musa];`
AWS Custom Lambda Layer
Published: 2023-02-11 11:22:21

**Lambda Layer:**
Used to share code between functions

**Package below into a Lambda layer:**
	1. Set of reusable functions that can be used across Lambda's.
	2. npm module that can be used across Lambda's.

Consider we have set of reusable functions like below in a file named _reusable.js:_
```
const getCountryCode = function(countryName) {
  let countryCodeMapping = {
	"India" : "IN",
	"United States of America" : "USA",
	"United Kingdom" : "UK"  
  };
  return countryCodeMapping[countryName];
};
module.exports = { getCountryCode }
```

**Folder structure:**
```
nodejs (FolderName)
	reusableCodeFiles.js
	package.json
	node_modules
```
**How to zip (Windows):**	
Right click the nodejs folder -> 7-Zip -> Add to "nodejs.zip"
	nodejs - foldername
	nodejs.zip

**How to use the Layer reusable code from Lambda:**

```
const reusableCode = require('/opt/nodejs/reusable');
// reusable is the name of file (.ie. reusable.js) inside nodejs zip file 

exports.handler = async (event) => {
	console.log(reusableCode .getCountryCode("India"));
        //Logs IN   
};
```
Open Source ChatGPT based Bing Search launched
Tags: openai, machinelearning, opensource, webdev
Published: 2023-02-11 11:20:15

We just launched our [ChatGPT based Bing style Website Search](https://aista.com/chatgpt-bing-website-search/) thing. It works by scraping your website for content, creating a machine learning model in the process, allowing your users to search your website using ChatGPT - **WITHOUT** ever leaving your website. Pretty cool if I may say so ^_^

Of course, the search feature will *only* give your visitors links from within your website, allowing your users to rapidly search your site, without ever having to leave it. Below is a screenshot of how it looks like.

![ChatGPT based Bing Search for your Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ql3sk7wtxixi85jhfdiy.jpg)

Psst, we'd appreciate some [GitHub luv](https://github.com/polterguy/magic) ... :)

The setup is easy. Unless you want to mess with the open source version, signup at [Aista.com](https://aista.com), create a cloudlet, go to Machine Learning, scrape your website, vectorise your training data - And embed a snippet of HTML into your existing website. It works with WordPress, Shopify, Wix, Joomla, Umbraco - And **watever** CMS you've got really. Below is a screenshot of how to scrape your website after having signed up.

![Create your own custom Bing and ChatGPT based website search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/785y1vngeucrxhdcjetj.jpeg)

The thing has like a _"bajillion"_ features, such as monitoring questions/answers, allowing you to manually spice up the model with training snippets for specific questions, spicing up your model with single-shot pages such as e.g. WikiPedia pages, etc, etc, etc. And you can of course set it up as a simple _"chatbot"_, such that it does _not_ return references, allowing visitors to talk to your site, etc.

If you like this, I would appreciate if you share it with your friends on Facebook, Twitter, LinkedIn, Reddit, _"whatever"_. And if you've got questions, feel free to [contact us](https://aista.com/contact-us/). You're of course free to [download the open source version](https://github.com/polterguy/magic), but if you want a rapid 5 minutes setup, the simplest is to signup below, at which point we'll take care of hosting, security, and almost all problems that might popup as you play around with things.

* [Get your own Bing / ChatGPT website search](https://aista.com)
Npm vs Yarn: What Should you use for managing packages in React?
Tags: react, webdev, javascript, programming
Published: 2023-02-11 11:17:58

Both npm (Node Package Manager) and Yarn are popular package managers for JavaScript projects, including React. The choice between npm and Yarn comes down to personal preference, but here are a few key differences to consider:

- **Performance**: Yarn was designed to be faster than npm, and in most cases, it is. Yarn caches packages locally on your machine, so if you need to install the same packages multiple times, the process will be faster with Yarn.

- **Consistency**: Yarn uses a lockfile to ensure that your dependencies are installed consistently across all your development machines and in production. This makes it easier to ensure that your application works the same way in different environments.

- **Security**: Yarn was built with security in mind, and it has a few features to help you keep your dependencies secure. For example, Yarn scans packages for known vulnerabilities and alerts you if there are any.

- **Compatibility**: npm is the default package manager for Node.js and has a much larger user base, so it has better compatibility with the packages you may need for your project.

In conclusion, both npm and Yarn have their strengths and weaknesses, and both can be used effectively to manage packages in React projects. If performance is your top priority, Yarn may be the way to go, but if compatibility is more important, npm is a safe bet.
What are portals in React?
Tags: react, javascript, beginners, programming
Published: 2023-02-11 11:17:43

In this article, we'll dive into the concept of portals in React and see how they can be used to enhance your UI components.

Portals in React are a powerful tool for rendering components outside of their parent component's DOM tree. They provide a way to detach a component from its parent and attach it to a different DOM node, rather than being inside its parent component. This allowing for greater flexibility and improved UI design. This can be useful in certain cases where you want to render a component that is logically a child of a certain component, but you need it to be physically detached from its parent component in the DOM tree.

With portals, you can create modals, tooltips, or other UI elements that need to be displayed on top of other components, regardless of their parent-child relationship. Portals are created using the `ReactDOM.createPortal` method and can be used to bring your components to life in new and creative ways.

Let's say, you might have a modal component that you want to render outside of your main app component, so that it appears on top of other components regardless of the parent-child hierarchy. Portals provide a way to do this by creating a new **root** in the DOM and attaching your component to it. You provide the component you want to render and the DOM node where you want to render it.

---

## For example:

```
function Modal({ children }) {
  return ReactDOM.createPortal(children, document.getElementById("modal-root"));
}
```

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

In above example, we have a Modal component that renders its children using a portal. The `document.getElementById('modal-root')` is a DOM node that we've created elsewhere in our HTML file (`index.html`), where we want to render our modal component.

This way, we can render the modal component outside of the main app component and have it appear on top of other components.

---

## DOM node that we've created in our HTML

```
<div id="modal-root"></div>
```

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

---

## Rendered HTML

The Modal component will be rendered into the `modal-root` element, which you would need to define in your HTML:

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


---

**🍀Support**

Please consider following and supporting us by subscribing to our channel. Your support is greatly appreciated and will help us continue creating content for you to enjoy. Thank you in advance for your support!

[YouTube](https://youtube.com/@codeofrelevancy)
[Discord](https://discord.com/invite/f8jwnzcRz2)
[GitHub](https://github.com/codeofrelevancy)
Common interview questions that you need to know as a junior JavaScript developer.
Published: 2023-02-11 11:09:05

## **What are the various data types that exist in JavaScript?**

These are the different types of data that JavaScript supports:
Boolean - For true and false values
Null - For empty or unknown values
Undefined - For variables that are only declared and not defined or initialized
Number - For integer and floating-point numbers
String - For characters and alphanumeric values
Object - For collections or complex values
Symbols - For unique identifiers for objects

## **What is JavaScript Hoisting?**

Hoisting is the default behavior of JavaScript where all the variable and function declarations are
moved on top. This means that irrespective of where the variables and functions are declared,
they are moved on top of the scope. The scope can be both local and global.

## **What are the features of JavaScript?**

These are the features of JavaScript:
Lightweight, interpreted programming language
Cross-platform compatible
Open-source
Object-oriented
Integration with other backend and frontend technologies
Used especially for the development of network-based applications.

## **What are "null" and "undefined"?**

In JavaScript null is an object, where undefined is a type. null means empty. It can be assigned as a value where you don't want to assign any specific value. undefined means when a variable is declared but no value is assigned to it.

## **What is DOM ??**

Document Object Model is a programming interface for HTML and XML. A webpage is an HTML document. We can't manipulate this document with a programming language. So DOM comes into play. DOM is an object-oriented representation of an HTML document. It represents the document as nodes and object which can be manipulated by a programming language such as JavaScript.

## **JavaScript arrow function.**

JavaScript arrow function is shorthand of normal function in JavaScript. But it has some limitations too.

*Does not have its own bindings to this or super, and should not be used as methods.
*Does not have arguments, or new.target keywords.
*Not suitable for call, apply and bind methods, which generally rely on establishing a scope.
*Can not be used as constructors.
*Can not use yield, within its body.

```
//Traditional Named Function with arguments
function add(x, y) {
  return x + y; 
} 

//Arrow Function 
add (a, b) => {
 return a + b;
}
```
The difference between lose equality and strict quality in Javascript
Published: 2023-02-11 11:05:54

In JavaScript, the qual value operator (==) is used to check whether a variable is equal to a value or not. Example
let p = "20";
if (p ==20){
  alert("yes");
}
Looking at this code, p is actually  qual to 20.
But if the if statement is like this
if (p === 20) it won't alert yes why?
Because, our strict equality or qual type and qual value operator also checks whether the values are of the same data types or not. Our "20" is a number string but what we passed in our logic is just a number.

Strict equality is really helpful, it helps you to avoid unnecessary bugs in your Codes. You can use lose quality but you have to be care on the data types.
Sachin Dev Duggal is ready to amplify their footprint in India with Builder.ai
Tags: ai, builder, webdev, appwritehack
Published: 2023-02-11 10:54:47

“Everyone's business is unique, and everyone's ideas unique, whether it's regional or the size of the company” says Sachin Dev Duggal. He continued with his words, what's universal is people are trying to unlock their potential, right? What's universal is they know it's software, but 20% of everything that someone's doing is unique to them. And that’s where we bring in this expert network from around the world which works at the top of the assembly line to give everyone a really tailored experience for what their application needs.

From the grocery store to the manufacturing floor, ideas are what fuel innovation. For these concepts to remain current, they must be digital. But a lot of individuals feel that it is out of their grasp, which is where Sachin Duggal’s Builder.AI comes in useful. Building readily customizable, cheap software for your company might make you feel more confident about becoming digital or remaining untechnical.

[Sachin Dev Duggal](https://www.hindustantimes.com/brand-stories/builderais-futuristic-aim-is-to-expand-its-global-footprint-in-india-101675852932047.html) construes the story of his journey of creating Builder.ai and from where he gets the idea of this innovative expert network and says, “I started a cloud computing company as soon as I came out of school, quit my job, where I was building a photo sharing app and got really rogered by a developer. And I thought to myself, I went to Imperial, did engineering. If it's so hard for me to get software built, gosh, it must be so difficult for the little bakery down the road. And that's really when we started this six years ago. Just over six years ago”.

Read Here : [Sachin Dev Duggal is ready to amplify their footprint in India with Builder.ai](https://www.hindustantimes.com/brand-stories/builderais-futuristic-aim-is-to-expand-its-global-footprint-in-india-101675852932047.html)
Concurrency Merge Sort Using Channels and Goroutines in Golang
Tags: go, concurrency, golan, beginners
Published: 2023-02-11 10:39:21

Merge sort is a divide and conquer algorithm used to sort a list of elements. The algorithm starts by dividing the unsorted list into n sublists, each containing one element. The sublists are then merged in a manner that results in a sorted list. The merging process involves comparing the elements of the sublists and arranging them in the correct order. The time complexity of merge sort is O(n log n), making it an efficient sorting algorithm for large lists.
Optimize sorting with concurrent Merge Sort using channels and goroutines in Go.
```
func Mergech(left chan int, right chan int, c chan int) {
	defer close(c)
	val, ok := <-left
	val2, ok2 := <-right
	for ok && ok2 {
		if val < val2 {
			c <- val
			val, ok = <-left
		} else {
			c <- val2
			val2, ok2 = <-right
		}
	}
	for ok {
		c <- val
		val, ok = <-left
	}
	for ok2 {
		c <- val2
		val2, ok2 = <-right
	}
}
func MergeSort(arr []int, ch chan int) {
	if len(arr) < 2 {
		ch <- arr[0]
		defer close(ch)
		return
	}
	left := make(chan int)
	right := make(chan int)
	go MergeSort(arr[len(arr)/2:], left)
	go MergeSort(arr[:len(arr)/2], right)
	go Mergech(left, right, ch)
}
func main() {
	a := []int{5,4,3,2,1}
	c := make(chan int)
	var wg sync.WaitGroup
	wg.Add(1)
	go func() {
		defer wg.Done()
		mergeSort(a, c)
	}()
	wg.Wait()
	var s []int
	for v := range c {
		s = append(s, v)
	}
	fmt.Println(s)
}
```
The Scientific Programming School is now at Learnitive.com
Tags: webdev, beginners, productivity, career
Published: 2023-02-11 10:30:04

The Scientific Programming School is closed and all its courses are moved into this new and advanced interactive learning platform called [edu.learnitive.com](https://edu.learnitive.com/)!


![edu.Leanitive.com](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2k7bgcylmqeptmlkzvxy.png)

The good new is we didn't forget you at all! The Learnitive platform is offering a $12 credit (gift) to all the previous Scientific Programming School students including you to purchase back all the courses they were enrolled into and more!

![edu.learnitive.com is offering a $12 gift credit.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j57300seb2f72w7gjmvu.png)

Please [login](https://edu.learnitive.com/login) into your account and purchase your desired "[program](https://edu.learnitive.com/programs)" by getting into the Learnitive.com >  Programs page. You should be able to get back all your courses and more! The amount is will be loaded as soon you as you re-login. You are also invited to create new courses at Learnitive.com. More coming soon!

Should you have any further questions, please feel free to let us know via the [contact page](https://edu.learnitive.com/contact). Let's watch a video on how to get credits at Learnitive.com

## What is Learnitive?

Learnitive (Learn + Interactive) is an interactive and advanced e-learning platform. It not only gives you the opportunity to watch lessons with video, but also allows you to execute interactive illustrations, codes and OS commands inside your browser! It supports 50+ programming languages.


![edu.learnitive.com](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26pqqi7792tht3lp4uh4.png)

## What do you learn at edu.learnitive.com?

Our instructors specialize on academic courses. Our mission is to inspire and develop people to achieve their goals in STEM. We enable great teachers to illuminate the soul of math, science, and engineering through bite-sized, interactive learning experiences.

## Any prerequisite?

Nope, none! You start learning immediately instead of fiddling with OS, VMs, SDKs and/ IDEs setups. It‘s all setup with Docker on the cloud.
CRM SOFTWARE
Published: 2023-02-11 10:12:32

Attention all businesses in Singapore! Are you tired of disorganized customer information and ineffective communication with your clients? Say hello to Genic Solutions - [CRM software](https://www.genicsolutions.com/customer-relationship-management/)! Our CRM platform is designed to streamline your customer management processes and improve communication. With our cutting-edge technology, you can easily store and access customer information, track and analyze sales performance, and automate marketing efforts. Say goodbye to manual processes and hello to increased efficiency and productivity. Upgrade your business today with Genic Solutions CRM solutions.