teleren/devto huggingface dataset:
Automatically generate Postman collection from Apipie docs
Tags: ruby, postman, api, rails
Published: 2021-08-17 08:29:12

I often found myself having to create a Postman collection from our API so it's easier to test between the members of the team. But each time the collection ends up incomplete and it's a hassle to keep up to date.

For that reason, I created a new [Ruby gem](https://rubygems.org/gems/apipie-postman) ([Github](https://github.com/VictorMotogna/apipie-postman)) that automatically generates a Postman collection with all the tested endpoints covered with Apipie.

## How to use it

The setup & usage are pretty easy:
* add the gem to your `:development, :test` group in the Gemfile
* generate a Postman API key; details [here](https://learning.postman.com/docs/developer/intro-api/)
* add an initializer file to `config/initializers/apipie_postman.rb`:
```ruby
ApipiePostman.configure do |config|
  config.postman_api_key = 'your_postman_api_key'
  config.postman_collection_name = 'Your collection name'
  config.base_url = 'localhost:3000' # the base_url that you want in your postman collection
end
```
* run `bundle exec apipie-postman` - this will create the apipie_postman.rake file
* run `bundle exec rake apipie_postman` to run the task and generate docs


## Conclusion

Please let me know if you like it and any feedback you might have.

If any of you would like to contribute to the project, I also set up a [contributing guideline](https://github.com/VictorMotogna/apipie-postman/blob/main/CONTRIBUTING.md).
My first task as HNGI8 intern.
Published: 2021-08-17 08:19:08

What I intend to achieve by the end of my HNGI8 internship.

As a computer programming enthusiast, I am glad to be part of this internship. I am wishing to accomplish the following by the end of this 8 weeks internship as a back end developer:

I wish to progress to the final stage of this program

To make friends with other developers and improve my communication skills, work together with them as a team


To help colleagues when and where I can at the course of the program

Become an employable developer.

Having this in mind and preparing for the great tasks ahead, I will also like to post some important web links for my fellow beginners to help them learn.

Figma web design link : https://youtu.be/E1AQwpy6-Gk

GIT tutorial link: https://youtu.be/8JJ101D3knE

HTML tutorial for biginners : https://youtu.be/qz0aGYrrlhU

Python for biginners tutorial:https://youtu.be/rfscVS0vtbw

JavaScript for biginners:https://youtu.be/W6NZfCO5SIk.




Also here is a link to zuri internship program:
Https://zuri.team

My github link: https//:github.com/fortunate85

My figma link:
Https//:figma.com/@fortunate85
SQLAlchemy Events
Tags: python, sqlalchemy, flask
Published: 2021-08-17 08:07:17

During the normal operation in SQLAlchemy ORM objects may be created, updated, and destroyed. SQLAlchemy provides hooks into this object life cycle so that you can control your application and its data.

These callbacks allow you to trigger logic before or after an alteration of an object's state.

Here is a sample of Flask-SQLAlchemy Model

```
class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)

    def __repr__(self):
        return '<User %r>' % self.username
```

If we want to add callback to lowercase username before save, we can use `sqlalchemy.event.listens_for` 

```
from sqlalchemy import event


class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)

    def __repr__(self):
        return '<User %r>' % self.username


@event.listens_for(User, "before_insert")
def lowercase(mapper, connection, target):
    target.username = target.username.lower()
```

By using `sqlalchemy-events` [library](https://pypi.org/project/sqlalchemy-events/), we can simplify those event listen to

```
from sqlalchemy_events import listen_events, on


@listen_events
class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)

    @on("before_insert")
    def lowercase_username(mapper, conn, self):
        self.username = self.username.lower()

    def __repr__(self):
        return '<User %r>' % self.username
```
Goals for HNG8 internship
Tags: internship
Published: 2021-08-17 07:59:06

I want to become a jack of all trades and also a master of all in the web development space at the end of my career, tough task I know but still I want to get it done and I feel this internship is a move in the right direction so let's get it!

Plus I would love to use this oppurtunity to meet new people, nice people to be precise that can have an inpact on my journey likewise I on theirs.

If anyone reading this wants to join in on the next one or this one, heres a link [HNG8 link](https://zuri.team)

Here are some tutorials for beginners:
[Figma](https://www.youtube.com/watch?v=3q3FV65ZrUs)
[Github](https://www.youtube.com/watch?v=SWYqp7iY_Tc)
[JavaScript](https://www.youtube.com/watch?v=PkZNo7MFNFg)
Pagination in MongoDB
Tags: mongodb
Published: 2021-08-17 07:46:29

What is the Purpose of a Website? 
> To display data and to interact with the data📟
But there are Hundreds of documents present in the Servers and handling or present all of them at once can become overwhelming for the Users.

### This is where the concept of Pagination comes in.

APIs are designed in such a way that they provide results in the form of pages with a limited number of documents. 

Since MongoDB is specialized in handling data in the form of JSON objects that APIs use, let's understand how to achieve this.

## `find()` Method
The `find()` is a query method of MongoDB. It returns all or some documents based on the arguments passed inside the method.
But for simplicity let's just try to get all the data in the database. 

## `limit()` Method
The `limit()` method is another method of MongoDB. It accepts a **number type** argument, which specifies the number of documents **to get in a particular query**. 

> Let's say we want to have 15 documents in a single response object.
We can achieve this using the following code snippet : 
```javascript
db.posts.find().limit(15)
```

Now if we call this multiple times, we will always get the first 15 documents, but we do not want that.

## `skip()` Method
The `skip()` method is also a method of MongoDB. It also accepts a **number type** argument, which specifies the number of documents **to skip from the first document** entry in a particular query. 

We are getting 15 documents per query. So if we want the first page, we can use :
```javascript
db.posts.find().limit(15).skip(0)
``` 
For the next page, we have to skip the first 15 documents, so we use :
```javascript
db.posts.find().limit(15).skip(15)
```
And so on. 
### We see a pattern here: For page 1, we skip `15*(page_number - 1)`

So if we have a endpoint that receives the page number, we can directly use this formula to create a paginated query : 
```javascript
app.get("/posts/page?",async (req,res)=>{
let pageNumber = req.params.page;

let data = await db.posts.find().limit(15).skip(15*(pageNumber-1));
res.send(data);
});
```

Hope you learnt something new. 
You can also follow me on Instagram 👉 [jsdecaf](https://www.instagram.com/jsdecaf/)
Also connect with me on LinkedIn 👉 [thevinitgupta](https://www.linkedin.com/in/thevinitgupta/)

Do tell me in the comments if I was wrong somewhere!!👇👇
Jetpack Compose: Badge
Tags: android, jetpackcompose, kotlin, materialdesign
Published: 2021-08-17 07:43:17

Badges are widely used on android. Badge gives a display to notify the user when there are notifications or other important things. As in the message app that displays new messages with badges and many others.

Jetpack compose does this well. The new Jetpack Compose UI toolkit for android development has an API for displaying badges. The following is an example of its use on **Bottom Navigation Bar Item**.

```kotlin
import androidx.compose.material.Badge
import androidx.compose.material.BadgedBox
import androidx.compose.material.BottomNavigation
import androidx.compose.material.BottomNavigationItem
import androidx.compose.material.Icon
import androidx.compose.material.Text

BottomNavigation {
    BottomNavigationItem(
        icon = {
            BadgedBox(badge = { Badge { Text("8") } }) {
                Icon(
                    Icons.Filled.Favorite,
                    contentDescription = "Favorite"
                )
            }
        },
        selected = false,
        onClick = {}
    )
}
```

`BadgeBox` gives the child a place to display composable Badge(). This compostable is still in **Experimental** meaning it is not yet stable. Maybe it will be stable in the next few versions of jetpack compsoe. stay tuned

### Reference
https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary
My goals for HNGi8 internship August, 2021.
Published: 2021-08-17 07:40:51

Hi guys, I recently got invited for the HNGi8 internship program which just started and I am writing this article to enumerate my goals for the internship as well as include links to some useful programming materials. 
I am a backend web developer who has been learning the Go programming language for some time and the backend track of the internship is required to build and complete projects in the Go programming language so my goals and expectations are listed below:
1. To get better at collaborating on projects with other developers.
2. I aim to get better at building web servers and services in Go
3. I aim to pick up other technologies that I am not yet familiar with whether in Go or other programming languages.
4. I aim to connect with awesome, goal-oriented and driven developers.
Hopefully, I get really far in the program and probably make it to the final. Fingers crossed.
Please do checkout the Zuri team [here](https://zuri.team/) also do checkout this beginner tutorial on the Go programming language by Amanda Fawcett [here](https://www.educative.io/blog/golang-tutorial), [this] (https://www.youtube.com/watch?v=WhlNnf1711M&t=9s) one on HTML and CSS by the net ninja as well as [this](https://www.youtube.com/watch?v=QyFcl_Fba-k&list=PL4cUxeGkcC9jjuXmnTyPSMo5NZ8dANHSW) tutorial on Git by the net ninja, [here's](https://www.youtube.com/watch?v=WhlNnf1711M&t=9s) a tutorial on figma for beginner's. That's it. Thanks for reading.
What's the worst part about the JS ecosystem?
Tags: discuss, javascript, typescript, webdev
Published: 2021-08-17 07:37:12

_Photo by [m wrona](https://unsplash.com/@mwrona?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/hunted-house?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

Seriously, give me your honest opinion and save any rant: what's the worst part about being a developer in the JS ecosystem? What makes you roll your eyes up to the sky? What makes you wondering if you've chosen the right developer career?

Also, most importantly:

> What would you change, if you could?

Let me know in the comments 👇 or just leave a 🦄 and share this discussion 📣

Thanks for reading 🙏
HNG Internship 8 Task 1
Tags: hnginternship, hng, zuri, internship
Published: 2021-08-17 07:32:50

All Thanks to Zuri, the organizers of the HNG internship,  I'm finally working on my first blog post. This should be a habit soon I hope.

I'm Stanley, a front end developer or should I say an aspiring front end developer. I've done some work with html, CSS, and JavaScript and currently, I am learning React basics.

**MY GOALS FOR THIS INTERNSHIP** 

HNG is actually tough..so I've heard. I really hope I make it to the final stage and during this eight (8) weeks time period, I look forward to making good connections and developing industrial standard skills/expertise required for my Developer career.

**USEFUL LINKS 👇**

https://internship.zuri.team


FIGMA Beginner Tutorial: 
https://youtu.be/4W4LvJnNegA

GIT Beginner Tutorial:
https://youtu.be/8JJ101D3knE

HTML Beginner Tutorial:
https://youtu.be/pQN-pnXPaVg

NodeJs Beginner Tutorial:
https://youtu.be/Oe421EPjeBE
My HNGi8 x I4G internship
Tags: internship, learning, development
Published: 2021-08-17 07:27:49

My track is backend developer, and I'm currently doing an internship with https://zuri.team by the end of 8 weeks I will love to be employed in the technology company, I will have learnt how to work remotely via the Training and have made meaningful relationships with other developers in the program too.

Lastly by the end of the 8 week training I would have becomed more experiencd and passed all the tasked and training given to me they the organising team.

Below are some beginner tutorial

Beginner tutorial for Figmal
https://youtu.be/jk1T0CdLxwU

Beginner tutorial for Git
https://youtu.be/RGOj5yH7evk

Beginner tutorial for Phyton
https://youtu.be/rfscVS0vtbw

Wish me luck !!!
SambaHVL Eklentisinin Eklenti Marketi ile Yüklenmesi
Tags: samba, eklenti, liman
Published: 2021-08-17 07:25:42

## Liman Nedir?

Liman Merkezi Yönetim Sistemi Bilişim Teknolojileri süreçlerinizde bulunan bütün bileşenleri uzaktan, kararlı, güvenli ve genişletilebilir yöntemler ile merkezi olarak yönetmenizi sağlar. Eklentilerle genişletilebilir bir yapıdadır. Liman ile ilgili daha detaylı bilgi için https://docs.liman.dev/kullanim-kilavuzu/ adresi ziyaret edilebilir.

## SambaHVL Eklentisinin Market Üzerinden Yüklenmesi
İlk olarak **Eklenti Mağazasına** girmemiz gerekiyor, bunu da aşağıdaki iki yöntemden istediğinizi seçerek yapabilirsiniz:

1. Sol taraftaki menünün en altında bulunan **Eklenti Mağazası** ikonuna tıklayarak
2. Ekranın sağ tarafında bulunan ve üzerinde **Eklenti Mağazası** yazan **yeşil** butona tıklayarak

![Samba_Market_1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4l4r4trx9mjz48qx4djw.png)
 
**Eklenti Mağazasına** girdikten sonra **SambaHVL** paketini buluyoruz ve yanındaki yeşil **Yükle** butonuna tıklayarak işlemi başlatıyoruz.

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

**Onay** uyarısı geldiğinde **Tamam** butonuna tıklayarak işlemi başlatıyoruz.

![Samba_Market_3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91ibjdizesjgs0po1jrm.png)

İşlem sonlandıktan sonra **Sistem Ayarları / Eklentiler** kısmındaki tabloda **SambaHVL** eklentisini görüntüleyebilirsiniz.

![Samba_Market_4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s37sfj7e8h89z374wxjt.png)
Why not to eat everything in a plate?
Tags: productivity, todayisearched, programming
Published: 2021-08-17 07:16:52

Sometimes it happens so that you have lot of work to do and you feel, you could do more if you had 30 hours in a day. Personally this happens with me because I have too many things on **my plate.** 

This topic is huge and tons of books have been written on time management, to keep this short I would like to tell a short story of an **average international student** from India and how can he solve this problem.

Our character name is Ramesh. He came to Australia to study his Masters degree at age of 25, he had to work part time to make ends meet and study full time, that is **70 hours** of work weekly, moreover he has his own personal goal to learn programming which his degree does not provide and he has developed love for it. Everyday he wakes up and already has a lot to do, university assignments, part time job(physical work at a fuel station) and to **code** for 4 hours daily at least. This is a case of a full plate.

Now I have a solution for Ramesh, first of all he needs to think of his career as **5 years plan** and keep everything he does in that perspective. For university assignments he can do bare minimum to just pass if he understands that a particular subject would not help him in his career, **secondly** for part time job he does not need to earn more what is more than needed, this generally happens with an international students, in **race** of earning more they forget what they came for, weekly pay and huge increment in hourly rate compared to India, side tracks them of their goal. This feeling of earning more can be handled by again keeping your **long term career** in mind, the fear alone will push you towards your career.

Just handling these two parts will give you **more time** to code.
Getting unique values from a JavaScript array using Set
Tags: javascript
Published: 2021-08-17 07:06:23

Often we want to get unique values from a single array. Luckily for us, this is relatively easy in modern JavaScript.

To give you a small recap on how one would do this with a manual loop and push in JavaScript.

```js
original = ['Pizza', 'Chicken', 'Pizza', 'Fish', 'Quinoa'];

output = [];
original.forEach((item) => {
  if (output.indexOf(item) === -1) {
    output.push(item);
  }
});

// [ 'Pizza', 'Chicken', 'Fish', 'Quinoa' ]
```

As you can see, this removes the duplicate Pizza value.

## JavaScript Set to the rescue

This is something Set is super good at.

Let's say we need to loop this data first, maybe because we need to filter on some other conditions?

```js
output = new Set();
original.forEach((item) => {
  output.add(item);
});

// Set(4) { 'Pizza', 'Chicken', 'Fish', 'Quinoa' }
```

As you can see in this example, we don't have to check if the value exists since the JavaScript set only accepts unique values.

However, instead of an array, we now get a Set object returned.
This is not always useful.

We can convert this Set object to an array using the JavaScript spread operator.

```js
output = [...output];
```

This takes the Set object and converts that into a flat array!

## Set unique values one-liner

If you don't need to do any other filter conditions in a for loop (or array method), we can also use a one-liner to convert an array into a unique valued array.

```js
original = ['Pizza', 'Chicken', 'Pizza', 'Fish', 'Quinoa'];
output = [...new Set(original)];

// [ 'Pizza', 'Chicken', 'Fish', 'Quinoa' ]
```

I've also created this Codepen, where you can view the console logs to see what happens.

{% codepen https://codepen.io/rebelchris/pen/gOgYMPy %}

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Beginner Github
Tags: git, zuri
Published: 2021-08-17 07:01:02

## My Zuri internship article
## _The first post, Ever_


- My first article on dev.to
- ✨Magic ✨

## Features

- Everything i have learned so far and i have practised.

## Tech
My Experience :

- [AngularJS] - HTML enhanced for web apps!
- [Ace Editor] - awesome web-based text editor
- [markdown-it] - Markdown parser done right. Fast and easy to extend.
- [Twitter Bootstrap] - great UI boilerplate for modern web apps
- [node.js] - evented I/O for the backend
- [Express] - fast node.js network app framework [@tjholowaychuk]
- [Gulp] - the streaming build system
- [Breakdance](https://breakdance.github.io/breakdance/) - HTML
to Markdown converter
- [jQuery] - duh

And of course Dillinger itself is open source with a [public repository][dill]
 on GitHub

## Installation

### What is github?

Its’ a Version Control System (VCS) which helps developers to collaborate and work simultaneously while tracking and maintaining a complete history of the changes of their project files.
There are two types of version control systems namely;
Centralized Version Control System
Distributed/Decentralized Version Control System.
Git falls under the Distributed Version Control System.
Distributed Version Control System (DVCS)

This system enables clients to check out the latest changes in the remote repository for example on GitHub or bit-bucket and allow them to clone the remote repository into their local working environment. This is very useful especially in cases when the server that has the remote repository goes down. In such an instance, the local repository on a client’s computer can then be push back to the server to restore it. Git does not entirely rely on the central server and therefore this is why you can perform operations offline locally such as committing, creating branches, and viewing commit logs. You only require the network connection when you need to push changes to the server (GitHub) or to pull the latest changes from the remote repository.
In this blog post, I will strive to bring you up to speed with the terminologies associated with git, git commands and operations that you will encounter most commonly while working on your projects and collaborating with a team.


### Prerequisites.
You must have installed git on your computer otherwise visit https://git-scm.com
You should have a GitHub account. To Create a GitHub Account and sign in visit .https://github.com/
You should have an IDE ( Code Editor ) preferably Visual Studio Code. https://code.visualstudio.com/
Note that we often use Git Bash in Windows to perform the git operations and the Terminal for Mac and Linux. You could also use the integrated terminal in Visual Studio Code.
Okay with that noted let’s get started………😜
Common git Concepts and Operations.
Cloning / Creating Repositories
Basic git workflow
Pulling latest changes in a remote repository
Creating and working with Branches.
Merging Branches.
Resolving Merge Conflicts
Re-basing Branches
Hosting on GitHub page

- Follow for more here..
https://zuri.team or https://internship.zuri.team or https://training.zuri.team
My goals at the end of a 8-week Zuri Internship program
Published: 2021-08-17 00:00:57

I'm Olwadamilare Ajele, currently an intern at Zuri https://zuri.team. I'm eager to learn new things always so I'll be writing on my goals at the end of a 8-week internship with Zuri team.

Here are the few points i have: 
1. To be a good frontend developer: At the end of the internship, I want to be able to beat my chest and tell people that I am a certified frontend developer.
2. Learning how to communicate with teammates, mentors and friends: My communication skills would be improved and much more better.
3. Time management: This internship will help me improve on my time management skills as deadlines are set for each project.
4. Building relationships with people who can serve as advisers or mentors: This would be a chance for me to build healthy relationships with people around me like advisers and mentors.
5. Expanding the network to include other like-minded students: The Zuri internship has given us the chance to meet and expand our networks to include other like-minded students.

I want to shoutout to following teams/people for their efforts in giving out helps and tutorial for students like me to develop ourselves:
- Zuri Internship Training (https://internship.zuri.team)
- Brad Traversy [ReactJs-https://www.youtube.com/watch?v=w7ejDZ8SWv8&t=5607s ]
- Mosh Hamedani [Git https://www.youtube.com/watch?v=8JJ101D3knE]
- Brad Traversy [Figma https://www.youtube.com/watch?v=4W4LvJnNegA]
Block vs. Inline vs. Inline-Block
Tags: css, beginners, html, webdev
Published: 2021-08-17 06:36:59

###Block 
elements with `display: block;`.
* It occupies the entire horizontal space of its parent element.
* Always start on a new line.
 
Most elements by default belongs to this category. For a complete list please refer to [MDN list of block elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements#elements)

###Inline
elements with `display: inline;`
* Does not start on a new line.
* Its width and height are determined by the content.
* Not affected by width, height, margin-top, margin-bottom properties.
* Affected by horizontal padding and margin.
* Affected by padding-top and padding-bottom, but only visually. Other elements will not respect the vertical paddings.

{% codepen https://codepen.io/a89529294/pen/zYwQPdQ %}

For a complete list of inline elements [MDN list of inline elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements#elements)

###Inline-block
elements with `display: inline-block`
* An inline element that respects margin, width and height.