teleren/devto huggingface dataset:
Graph theory Problems
Tags: graph, graphtheory, graphproblems, graphalgorithms
Published: 2022-12-08 22:09:42

Graph theory is a branch of mathematics that studies the structure and properties of graphs. Graphs are mathematical objects that consist of a set of vertices, or nodes, and a set of edges that connect these vertices. Graphs can be used to model various real-world scenarios, such as social networks, transportation networks, and communication networks. 

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

More on https://hecodesit.com/graph-theory-problems/
Instalando Rspec em Rails 7
Tags: rspec, testing, rails
Published: 2022-12-08 21:53:38

Para que o seu código seja bom, é necessário que seu código seja testado, se não, o código não é bom, mesmo que que esteja organizado, legível, etc.

Então para testar os nossos códigos, nós vamos instalar a Rspec em Rails.

Antes de começar, vamos criar uma aplicação rápida.

```bash
rails new testando_codigo --skip-test
bin/rails db:create db:migrate
```

Esse comando `--skip-test`, serve para não criar o diretório `test/`.

Pronto, agora com aplicação criada, vamos colocar a gem.

Abra no arquivo Gemfile, e coloque a `gem "rspec-rails"` no grupo de desenvolvimento e teste, como você pode ver embaixo.

```ruby
...
group :development, :test do
  ...
  gem "rspec-rails"
end
...
```

Agora, vamos executa o `bundle install`.

```bash
bundle install
```

Pronto, agora o rspec está instalado na aplicação, porém ainda falta uma coisa, os arquivos.

Para gerar os arquivos de rpsec, rode o código abaixo.

```bash
rails generate rspec:install
```

Isso vai criar o diretório `spec/`, e alguns arquivos necessários para teste.

Com isso, nós estamos pronto para testar.

Eu não vou mostrar como que testa, mas eu farei uma série de postagem de teste, como 'model', 'request', 'view', etc.

Bem, vamos continuar.

Vamos gerar um scaffold, para livrar o trabalho de escrever o teste.

```bash
rails g scaffold usuario nome
```

Pronto com scaffold gerado, execute o `rspec`.

```bash
rspec
.
.
.
Finished in 1.34 seconds (files took 7.56 seconds to load)
27 examples, 0 failures, 14 pending
```

Pronto, com rspec instalado, você pode testar que o seu código.

Então é isso, tchau!
Introduction to Terraform
Published: 2022-12-08 21:51:02

**Terraform**
It is  tool for building, changing and versioning infrastructure safely and efficiently locally or in the cloud 



**Keys Features of Terraform**

1. **Infrastructure as code** - Using High level configuration syntax
2. **Execution Plans-** It shows steps of what terraform will do when you apply the configuration 
3. **Resource Graph-** Builds a graph of all the resources that provides insight into the creation and modification of any non-dependent resources.
4. **Change Automation** :it is the change process in infrastructure with requires minimal effort that requires the Execution Plan and Resource graph in order to aviod human error.
MongoDB Atlas Hackathon 2022 on DEV: Ramble messenger
Tags: atlashackathon22, webdev, mongodb, nextjs
Published: 2022-12-08 21:41:59


## What I built
A simple web messenger application with capabilities to get realtime push notifications when online.


### Category Submission: About Real-time


### App Link [Ramble chat app](https://rambler-chat.herokuapp.com/)

The app is hosted on heroku platform the only one who allow websockets to work. Unlike the Vercel serverless containers on which websockets don't work.


### Screenshots
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ia8vqs36ujjrosr95mwy.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iticphfoc0md9xpscbtp.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gkts066sbl0v2prc9ygy.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o0ksjd8y3jgu61wvn0j1.png)


### Description
This application is built with NextJS, MongoDB, SocketIO, ReactQuery, MaterialUI, Next Api Decorators and Next Auth. 

It uses the famous ReactHookForms and Yup resolver for form invalidation and submission. I am using the yup resolver here to ban words from the app.


### Link to Source Code
[Source code](https://github.com/akshayjpatil/ramble)


### Permissive License
[MIT License](https://github.com/akshayjpatil/ramble/blob/main/LICENSE.md)


## Background
A messenger for schools and colleges to allow students and faculty mingle in a healthy, moderated application maintained by school authorities.


### How I built it

I Used Mongo db collection `users` to store user information and their activity of when they were last seen and if they are currently online.

Next, another collection of `messages` which stores the messages sent to offline users. If the users are already online the socket.io directly emits the message to the user.

I used change streams to watch users coming online and get all the messages related to that user from `messages` collection and emit them to the online user.

This solution is very scalable as the messages themselves are not stored in the database and are stored on the local device. We can also expand the security to add e2e encryption to messages.

Another feature I can think of if you are looking at having to see messages on other devices as well is on-demand chat backup. App can create a backup and then download it automatically when the user logs in on a new device or browser.

#### Note: Also this is my first post on Dev. Please be kind...
AWS has announced the availability of AWS Outposts in Egypt
Tags: aws, cloud
Published: 2022-12-08 21:31:39

AWS has announced the availability of AWS Outposts in Egypt

https://lnkd.in/gNSFjUXS

Amazon Web Services (AWS)
#AWS_MENA_Cloud_Roadshow
#AWS #technology #egypt #outposts #cloud

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6f1d2tqfehqsvrhr0gb4.jpg)
ezy – open-source gRPC client, alternative to Postman and Insomnia
Published: 2022-12-08 21:28:12

https://github.com/getezy/ezy

![Preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yn69138ajn4xwpsecq8j.gif)

In this release I have concentrated on user experience:

- Full support of shortcuts

- Reworked collections management

- Notifications

- Improved UX

gRPC clients I’ve worked with had drawbacks and didn’t fit my use-case in a way I was expecting, since I’ve started working with gRPC 3+ years ago.

Since then, I wanted a tool that fits any need in gRPC world. This is why I created ezy.

Compared to Insomnia and Postman, ezy offers better streams support, allows you to use Server-Side and Mutual TLS with custom TLS certificates, works with gRPC-Web and has a more slick UI/UX.

If you are looking for a gRPC/gRPC-Web client which fits your needs, give ezy a chance!

I’d love to hear your feedback and answer any questions regarding ezy.
Hyperiondev - Web Dev bootcamp - Day 4
Tags: webdev, beginners, codenewbie, javascript
Published: 2022-12-08 21:21:21

**Settling in**

Getting used to the flow of things now. Lecture length and how to organise life around the work required to complete task etc.

Live lecture today ran much smoother. Two hours and plenty of basic info on loops & controlling the flow of programs in JS.

Task 7 - Build Your Brand 1
The first career focused task/section. A great intro of working with linkedIn, keeping a list of potential contacts. Setting career goals and focusing on the steps required to progress through the bootcamp but also build a professional network and portfolio.
Looking forward to more of these career resources and working with the careers team at Hyperiondev.

Task 8 - More loops - While, do..while.
Intro to whole loops and effective ways of utilising them with while(true) statements. Code challenges included the favourite "Is string a palendrome?" Everyone loves this one right.

Last lecture of the week tomorrow. Getting good feedback on my submitted work so far, I've got myself nicely ahead of the live lectures as I've covered most of this basic JS stuff previously on codecademy. However I'm expecting to slow down once the going heads into new territory for me.
How to work less than 8 hours with high productivity?
Tags: productivity, career, performance
Published: 2022-12-08 21:07:39


You don't need to work 8 hours a day. the most productive people don't do that because they prefer to work less than 8 hours with 100 per cent of focus at it without distractions.
While most people who work for 8 hours are not done it at height performance levels because, when they work they mix work with distractions such as social media.
so to work less than 8 hours a day with top productivity follow these steps:

-  Start working early because The first three hours of your day are the best for high productivity . At this time your brain is most attuned first thing in the morning

- Don't check your social media or email before you finish your deep work.

-  The best work happens in short intensive spurts, for 1 to 3 hours. But this must be “Deep Work,” with no distractions.

- Spend 20% of your energy on your work and 80% of your energy on recuperation and self-improvement.

- When you are working, be at work. When you are not working, stop working. By taking your mind off work and actually recovering, you’ll get high development in your work.
MongoDB Atlas Hackathon 2022 on DEV
Tags: atlashackathon22, react, node, webdev
Published: 2022-12-08 21:01:44

**What I built**
A website with information on international organizations around the world.

**Category Submission:**
Search No More: Build an application with full-text search capabilities using MongoDB Atlas and Atlas Search.

**App Link**
[https://companyprofileinfo.netlify.app/](https://companyprofileinfo.netlify.app/)

**Screenshots**


![Home Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/34kg79203nml0aa6bqry.png)


![Category Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n72kiegw8xtemwjc99ca.png)


![Search and Auto search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1d5szcuo40ecsydqv7qr.png)


![SearchPage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f26unzbxd4xfvvsz7vm8.png)

**Description**

If you love a company, you might want to find out more about its history, products or services, mission and values, and other aspects. Discover the company's website, social media channels, executive interviews, and competitors by researching the company's website and social media channels. Visiting the company's headquarters or physical location, attending events where the company is represented, or connecting with others who are passionate about the company may also be of interest. Explore the company in depth to learn what makes it special and why you admire it.

**Link to Source Code**

Backend: [https://github.com/femakin/Company](https://github.com/femakin/Company)
Frontend: [https://github.com/femakin/CompanyData](https://github.com/femakin/CompanyData)


**Permissive License**

MIT

**Background**

(What made you decide to build this particular app? What inspired you?)

I built this website because I wanted to learn more about the companies whose products or services I use on a daily basis. I wanted to understand the history and values of these companies, as well as their products, services, and other offerings. By gaining this information, I can make more informed decisions about the products and services I use, and I can better understand the companies that I rely on in my daily life. Additionally, by sharing this information with others, I hope to help others learn more about the companies they use and make more informed decisions as well.

**How I built it**

While building this app, I learned how to use MongoDB Atlas and picked up new skills such as Mongo aggregation and building indexes. I found that utilizing MongoDB Atlas allowed me to efficiently store and access the data I needed for the app, and I enjoyed learning about these new features of the database.
I hate Amplify
Published: 2022-12-08 20:48:52

Be warned, rant ahead.

![Me rn](https://media.giphy.com/media/5R2XVoMUnUmhxX5dWI/giphy-downsized-large.gif)

I hate Amplify. I've been using it for around 2 weeks, because serverless-next.js [no longer works with Next v13](https://github.com/serverless-nextjs/serverless-next.js/issues/2497).

Anyways, no worries, because I can just use Amplify, right?

Well, immediately after switching to it their CI/CD simply did not work. No idea why. It claimed to be enabled, but it was clearly not working. Spent some time trying to debug it and I'm not the only one. Whatever. Guess I'll just login and manually click the deploy button every time from the AWS console for the time being.

![Great start](https://media.giphy.com/media/mReMZcNMQ2RRl11slg/giphy.gif)

Bringing me to why I'm writing this rant of a blog post — 
Today, after my latest deployment, [ReadShape](https://readshape.com) was down for an hour. Surely it's because I messed something up, right?

As it turns out, not really. It's simply because the Next.js runtime was no longer getting the environment variables. It only got them during build time, which is why the build didn't fail, but since I'm utilizing [Next's ISG](https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration) the server will still need access to them.

However, as you guessed, it didn't. Why not? No idea. Why was this working fine before? No idea.

After digging through Amplify's GitHub issues, turns out that if you want these variables to be accessible during runtime in your `next.config.js` you need to "forward" the variables by doing the following:

```js
env: {
  MY_VARIABLE: process.env.MY_VARIABLE,
}
```

Why wouldn't AWS simply do this themselves? Because fuck you.

![Thanks for listening](https://media.giphy.com/media/l2Je53EP800isL9fO/giphy.gif)
JavaScript web__constants (Node.js-friendly)
Tags: webdev, javascript, es6, metaprogramming
Published: 2022-12-08 20:44:05

### Intro

> All magic based upon [import.meta operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta) natively baked-in on ES6 modules (ESM)

Bear in mind the following:
```diff
/* --- This is also mentioned in the code ---
URL scheme depending on :
a) server (web, Node.js) => http(s)://
b) file-system (Node.js only) => file:///
*/
```

{% embed https://replit.com/@projektorius96/esmexportsmeta %}

Open sanbox in a dedicated tab & run the following on a shell:

> node index.mjs
One finished Discord poll feature!
Tags: opensource, discord, javascript
Published: 2022-12-08 20:25:40

Hello there! This week, I worked on finally finishing the poll feature for [Wego Overseer](https://github.com/rickklaasboer/wego-overseer) that I have talked about in my two previous posts. Make sure to check those out, too!

This week was not as easy as previous one, and some work required workarounds, so let me tell you more about it!

#### Where we left off

Last week, I implemented a simple voting using simple text and 3 hard-coded reactions. From that point I wanted to implement nicer poll message and custom emotes.

## Using Discord embeds for nicer message

Embeds are card-like components from Discord.js that have Title, Description, Footer, Color, and such properties.

For nicer messages, I used embeds with question as a title and an optional description that the user might want to set as voting options explanation / elaboration / etc. As the Footer, I set user's avatar and name, as well as a timestamp.

## Custom emojis

There was quite a lot of difficulties with setting custom emojis mostly because there are a lot of variations to check for. There are Unicode ones, Discord general ones, and guild ones (from a given server). 

Since Discord emojis are not single characters, I used comma-separation for splitting the voting options. I then extracted emoji Id if it was from Discord (using `client.emojis.find()`), or used the entry itself, if it's a Unicode emoji, which were afterwards reacted to the message with.

If there was error parsing emoji, a separate ephermal message (i.e. only the poll creator can see) will be sent with those entries which couldn't be reacted with.

All of the code can be viewed [here](https://github.com/rickklaasboer/wego-overseer/pull/62).

## Some more work to do

After my initial commit, I wanted to implement voting using Discord buttons. They are much better-looking and allow for broader logic. 

However, for implementing buttons, it is needed to design database entries and events, for which I sadly did not have time because of deadlines week at college. 

After the busy weeks, I might actually come back to the feature to implement the buttons logic!
MongoDB Atlas Hackathon 2022 on DEV
Tags: atlashackathon22, webdev, javascript, programming
Published: 2022-12-08 18:27:48

## What I built
I have built a URL Shrinker App.

### Category Submission:
I have chosen a category below:

> Choose Your Own Adventure

This is the category which I think is well suited for me as a beginner. 
No restrictions, No limitations, Only imagination😀


### App Link
I choose replit as web hosting for my web app as it provides great tool and free hosting to the users.
In future there will be many features adding along with different domain/subdomain which will be more easy to use and remember...🤗
> Here is my app link: {% embed https://url-shrinker.harsh-singh-raj.repl.co/ %}


### Screenshots
Here are the beatifull screenshots of my URL-Shrinker app which uses the awesome cloud service of mongodb atlas:

- Landing Page

![Home page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1kdmbfxlmo63lthd0gti.png)

- Image with User Input

![Img with input](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ry3405jwjw232ofeini9.png)

- Image with Results

![Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w038su36ui8od3dpy58d.png)

Here in Results user gets the shortened url as result of long url.
You can test the link by visiting :

>http://url-shrinker.harsh-singh-raj.repl.co/mIKr4ZVi6 


### Description
This is an URL Shrinking app where users can create short url for their any long URLs and then use these short links wherever they want to use.
Example Use Cases of Short URLs are:-

- Make it easier to share your content.
- Make your URLs more appealing.
- Link Sharing.
- Character Limits

### Link to Source Code
Here is the source code for my web app
{% embed https://github.com/Harsh-Singh-Rajput/URL-Shrinker %}

### Permissive License
Permissive License used is:-

> MIT License

## Background
I decided to make this app as I faced some occasions and events where I needed a short Url for my purposes. There are many sites available but they require to make the account on their site in order to use the service which creates resistance, some requires payment method and others have annoying ads, which gives me inspiration to build my own URL shrinker web app where user can easily create short URLs without creating an account, without paying methods and without seeing annoying ads.
This was all possible by the free mongodb atlas cloud storage which enables me in building this app.


### How I built it
I utilised MongoDB Atlas for creating a database for short URLs through which I can redirect users to their respective pages with the help of id. I leart many new things along the way.
Thanks to MongoDB Atlas and their hackathon for providing great opportunity for learning and incorporating databases in the project.


### Additional Resources/Info
Resources which I used for building this app are:-
GeekForGeeks
StackOverFlow
Mongodb docs
And Last but not Least Google Search Engine😁
So you want Data Quality Control
Tags: database, datascience, qa, git
Published: 2022-12-08 20:21:09

I wrote an opus on [data quality control](https://www.dolthub.com/blog/2022-11-23-data-quality-control/).

I cover: 

1. The evolution of the modern data stack. 

    ![Modern Data Stack](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vqevzn4uabmwxzp78d84.png)

2. A model to think about data quality. 

    ![Data Quality Control](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/whc2oho2ids6t8cj1re5.png)

3. a survey of tools in the space.

    ![Data Quality Control Tools](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ied1mb0snpa9zlevzctu.png)
skybnb sample app - Mongo hackathon 2022
Tags: atlashackathon22
Published: 2022-12-08 20:13:43

## What I built
A sample skybnb app which shows the stay details of a place on input of the place name.  
 
### Category Submission:
Search No More: Build an application with full-text search capabilities using MongoDB Atlas and Atlas Search

### App Link
https://mongo-search-app.onrender.com/

### Screenshots


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



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








### Description
 A sample skybnb app which is gives us the listings(stays) available in  place we search.

We can get the listings(stays) by giving in a place name and that fetches all the listings in that area. By selecting on each listing we can view the info that listings along with the image of that listings.

### Link to Source Code

Frontend - https://github.com/manojkrishnak/mongo-search-fe
Backend - https://github.com/manojkrishnak/mongo-search-be
### Permissive License
MIT 

## Background
(What made you decide to build this particular app? What inspired you?)
I'm interested to try with Mongo Atlas Search feature. I have read through documentation and decided to try building some app which will give us the results on search. 

I wanted to have the use case with some good available data. Apparently, MongoDB provides some sample data. 

### How I built it
(How did you utilize MongoDB Atlas? Did you learn something new along the way? Pick up a new skill?)
I have learnt Mongo Atlas Search while building this app. I had to learn mongo aggregation, building indexes. I had build indexes which will be used by my app when an user selects an place from search results, we would be showing the search results on the selection of place.