teleren/devto huggingface dataset:
Give more Attention to your README file
Tags: webdev, beginners, tutorial, productivity
Published: 2021-12-03 10:28:57

Starting out as a Web Developer can be quite overwhelming. You are bombarded with so many different technologies to choose from. But one thing that can make you stand out from all the other people starting out is the discipline you put into your projects. And one of the best ways to add it in your projects is to write proper documentation of your process.

#README.md
Readme is a text file that is used by developers to explain and introduce their projects to the external users. It contains the information that is needed to get acquainted with the corresponding project. It's used as a way to answer all the frequent questions that other developers might have regarding the project such as identifying the technology stack or installing it for personal use.

#Why should I write Readme
Readme is usually ignored while adding projects to your repositories. As a newbie it seems unnecessary to write long lines that probably no one is going to read. But you might come back to your code after a while and that readme file is going to help you a lot in identifying what was what. A good readme file should be as good as the project itself. 

#Readme is very important in growth
Adding a readme file might seem as a small step as it is often ignored but this one small step can go a long way in your development career. Your projects on GitHub are basically your portfolio. It’s very rare that you start landing big clients after starting out so until you make a name for yourself, adding your projects in a presentable way to your repositories is the best way to showcase your talents to your possible clients. If you’re in a learning phase and trying to code on different test projects, then it's best to add them to your repositories with a good description. The best part about these descriptions is that even a non-technical person (maybe a recruiter) can get an idea of your talents from these files.

#Tips on writing a good Description
##Essentials:
###Title:
Make sure to add specific and to the point titles that describe what the project is about
###The project's aim:
Mention what you want to achieve by making this project. It's good to start developing with deliverables in mind.	
###Tech Stack:
Add what framework or library you’re using and it’d be super awesome if you add why you used it in the first place.
###Installation
If your project is a software or an app, make sure that you add proper instructions on how to install it on whatever platform you’re providing support for.

##Really Stand Out:
If you’re feeling a wee bit fancy and really want to make a good impression by going the extra mile, consider adding these sections as well.
- Table of contents
- GIFs of project in action
- Scope of functionalities 
- Project status 
- Sources
- Other information

Let me know what you guys think about Readme files.

Happy Developing!
Taking our Password generator a step forward
Tags: python, tutorial, beginners, programming
Published: 2021-12-03 10:27:10

#Intro
##First of all, Sorry for creating the post so late.
As you all might know that in my [first post](https://dev.to/spandyboss/python-script-to-make-a-password-generator-37g3) we created a password generator in **Python**

#What are we going to do
In this post we will add a new feature to save password that is generated in a file named password.txt if user wants to store it.

#Let's Code
##The basic code we have written already
```python
#importing the required module
import random 
import string 

#defining variables
lower = string.ascii_lowercase
upper = string.ascii_uppercase 
number = string.digits
symbol =string.punctuation

# making a variable a mix of all other vars 
all = lower + upper + number + symbol

#asking the user for entering the password length he/she wants 
length = int(input("Enter the length of the password \n"))

#generating the password 
pwd = "".join(random.sample(all, length))

#now the password is generated and now we have to print it for the user
print("Your password is: ",pwd)
```
Now, for storing the password we have to first create a file named **password.txt** in the same directory.
Then we will ask user if he/she wants to store the password or not ?
```python
choice = input("Do you want to store password in txt file ? y/n ")
```
Now we will use if else statement to do the steps according to the input if user says yes then python will open that file and write the password and save it else it will just end the program
```python
if choice == "y" : 
 f = open("pwd.txt","a")
 f.write("\n"+pwd)#We are using \n so that if we store multiple passwords then we must be able to identify the different passwords
 print("Your password is successfully stored in the file pwd.txt")
 f.close()
else :
  pass
```
###And with this we are done adding our new feature to the password generator.
I hoped you all liked it and feel free to ask anything in the comments section ! 
#Happy Coding
#Be safe and do take very good care of yourselves :)
Shortcuts in windows that nobody knows😏😏
Tags: programming, productivity, tooling
Published: 2021-12-03 10:22:18

1. If your windows key doesn't work your can try pressing ctrl+esc.
2. If somehow you cannot copy or paste using the normal 
   shortcut(ctrl+v/c), you can instead press ctrl+alt+insert to copy 
   and shift+insert to paste. very cool isn't it ??😎😎
3. Press ctrl+shift+esc to open the task manager
4. If your code editor doesn't provide dark mode, try pressing 
   ctrl+win+c to activate toggle color filters(contrast mode).
5. In chrome press shift+enter when searching, to open search in a 
   new chrome window.
6. Press win+v to show clipboard.
Article Badge Counter (ABC) Workflow
Tags: actionshackathon21, github, opensource, writing
Published: 2021-12-03 10:01:38

**Submission Category**: Wacky Wildcards

---

### Link to Code

Main repository

{% github https://github.com/lyqht/article-badge-counter-workflow %}

Also tried out doing a pre-release on the GitHub Action Marketplace [here](https://github.com/marketplace/actions/article-count-workflow)

---

### About the workflow

This workflow is a composite action:

- The number of articles is retrieved using the [blog-post-workflow](https://github.com/gautamkrishnar/blog-post-workflow) action.
- The badge is generated with [Shields.io](https://github.com/badges/shields), which is not clickable by default.
- This action has a script to take in your inputs to create a customized clickable badge.
- The commit and push github actions to your repo are performed by the [git-auto-commit workflow](https://github.com/stefanzweifel/git-auto-commit-action)

---

### Using the GitHub Action

An example for the action yaml, instructions for those who are unfamiliar with GitHub Actions, and the input options available to be used to customize the badge are included in the repository's README.md. 

Users can display their generated badge on their GitHub profile README.md in any way they like. This is a layout example from my [profile](https://github.com/lyqht).

![GitHub Profile with generated article badge counter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/coqv6atgbq8qt8lug3q2.png)
 
### Additional Resources / Info

Special thanks to [Gautam Krishnar](https://dev.to/gautamkrishnar) for helping to fix [the bug that I discovered](https://github.com/gautamkrishnar/blog-post-workflow/issues/110) while working on this action 🧡 He also submitted the `blog-post-workflow` action for the hackathon, and the article can be found [here](https://dev.to/gautamkrishnar/blog-post-workflow-github-action-1821).

---

### Room for improvements

There were a lot of troubleshooting along the way, but it was fun to learn about composite action concepts and create this action 😄 Ideally, I would also want to include some form of E2E test on the README as part of the composite action to make sure that the badge does render correctly before the action pushes the commit.
Day 54 of 100 Days of Code & Scrum: Ghost on Heroku and Next.js on Vercel
Tags: 100daysofcode, beginners, javascript, productivity
Published: 2021-12-03 09:58:56

Greetings, everyone!

Today, I started working on my Ghost blog setup. After consulting various resources online, I will most likely use a combination of Next.js frontend deployed on Vercel and Ghost headless CMS deployed on Heroku for my blog. It's a free solution that can scale even with significant traffic increase (I can just use CDN in the future). I'm pretty excited for it!

Anyway, let's move on to my daily report!

## Yesterday

I finally deployed my [business website](https://www.rammina.com/). I think it's satisfactory for now despite being simple.

## Today

Here are the things I learned and worked on today:

### Company Website

- updated the contact form validation to require proper email format.
- added an input field that is visible to bots only, to help prevent spam.

### Ghost

- read a lot of the documentations for getting started.
- learned how to deploy an initial setup for a Ghost blog locally and on Heroku.
- learned about Jamstack for Next.js + Ghost blog setup.

### Scrum

- I did some practice flashcards for Scrum.
- reviewed some of the things I've learned before.

Thank you for reading and continuing to support me!

![Rammina Thank You Banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9ayfxxxaz2g2hfcqbsk.png)

### Resources/Recommended Readings

- [Deployment | Next.js](https://nextjs.org/docs/deployment)
- [Scrum Master learning pathway | Scrum.org](https://www.scrum.org/pathway/scrum-master)
- [The 2020 Scrum Guide](https://scrumguides.org/scrum-guide.html)
- [Mikhail Lapshin's Scrum Quizzes](https://mlapshin.com/index.php/scrum-quizzes/)

### DISCLAIMER

**This is not a guide**, it is just me sharing my experiences and learnings. This post only expresses my thoughts and opinions (based on my limited knowledge) and is in no way a substitute for actual references. If I ever make a mistake or if you disagree, I would appreciate corrections in the comments!

<hr />

### Other Media

Feel free to reach out to me in other media!

<span><a target="_blank" href="https://www.rammina.com/"><img src="https://res.cloudinary.com/rammina/image/upload/v1638444046/rammina-button-128_x9ginu.png" alt="Rammina Logo" width="128" height="50"/></a></span>

<span><a target="_blank" href="https://twitter.com/RamminaR"><img src="https://res.cloudinary.com/rammina/image/upload/v1636792959/twitter-logo_laoyfu_pdbagm.png" alt="Twitter logo" width="128" height="50"/></a></span>

<span><a target="_blank" href="https://github.com/Rammina"><img src="https://res.cloudinary.com/rammina/image/upload/v1636795051/GitHub-Emblem2_epcp8r.png" alt="Github logo" width="128" height="50"/></a></span>
Advent of Code 2021 - Day 3
Published: 2021-12-03 09:47:38

---
title: Advent of Code 2021 - Day 3
published: true
description: In this video series, I try to challenge myself with the Advent of Code trials. Each solution will be published to Github, and I hope you will learn something from my coding mistakes and perhaps send some code my way on how you have done these challenges. I know by reading code, so this is such an exciting thing for me.
tags:
cover_image: https://i.ytimg.com/vi/diCm2W53u_0/maxresdefault.jpg
---

{% youtube diCm2W53u_0 %}

In this video series, I try to challenge myself with the Advent of Code trials. Each solution will be published to Github, and I hope you will learn something from my coding mistakes and perhaps send some code my way on how you have done these challenges. I know by reading code, so this is such an exciting thing for me.
How mobile sales apps are helping to optimize a business
Tags: mobile, applications, ios, android
Published: 2021-12-03 09:27:47

**Mobile sales apps are a huge success worth celebrating**

In today’s cutthroat selling environment, a lot of enterprise sales companies, whether small, medium or large are equipping their sales teams with an enterprise mobile application, which can greatly help in curtailing the sales cycle, improving sales force management and driving closure of more deals.

**Let’s talk about 5 ways a mobile sales application can accelerate your business performance**
* Digital product catalog for handling information on the go
* Simplifies data entry work & increases focus on daily sales activities
* Helps in producing predictable revenue
* Effective order processing
* Improves Business Marketing and Branding

**Listen our full podcast over here** - https://www.softwebsolutions.com/resources/mobile-sales-apps-for-businesses.html
Thank you, Apple, for hijacking port 5000 😣
Tags: webdev, watercooler
Published: 2021-12-03 09:23:50

You might have already upgraded to Mac OS Monterey. If not, there might be an unpleasant surprise awaiting you.

For me, it was running the following command.

```bash
npm run dev
```

And getting a message stating port 5000 is already in use...

It took me a good couple of minutes to find out no other application was using this port, and I was baffled at this point.

Surely all I did was upgrade to Monterey...

## Re-opening port 5000 on Mac OS Monterey 

After doing some research, I did a portscan and noticed "AirPlay Receiver" was using this port.

That didn't sound like anything I made.
Did some more research to find out that the AirPlay receiver is on by default.

To re-enable port 5000, you can simply turn off this checkbox.

![AirPlay Receiver in macOS Monterey listening on port 5000](https://cdn.hashnode.com/res/hashnode/image/upload/v1637558048297/YHaewxiZ2.png)

You can find this checkbox in `Settings` > `Sharing` > `AirPlay Receiver`.

This is not a new thing though, Apple has been using port 5000 for AirPlay since 2004.
The only new part is the introduction to having a Mac listening to AirPlay, which, as mentioned, uses port 5000.

If you wish to use AirPlay on your Mac, I'd suggest switching your development to a different port.

### 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)
Collection of Open Source Events and Hackathons you need to know
Tags: opensource, github, git, gsoc
Published: 2021-12-03 08:50:19

Here in this post of Terminal Stack, I have collected **the Open Source events and Hackathons held every month**. I have observed that students always forget the dates of the Open Source event and recall after the date is over to fill out the form. So,  you can now add reminders for this.
You can read the whole blog here👇
[Open Source Programs](https://terminalstack.com/collection-of-open-source-events-and-hackathons-you-need-to-know/)
How to use Margin in CSS?
Tags: webdev, beginners, css, html
Published: 2021-12-03 08:41:21

According to box model in CSS margin is the outer most edge of any element, it can be set on all the four sides of the element. It can be written in shorthand or assigning different values to individual margin properties for example, margin-top:10px, margin-right:20px, margin-left:2px, margin-bottom:8px.

## **<u>Writing margin in shorthand</u>**
For writing margin in shorthand there are some things to learn first, let me tell what those are.

In shorthand you can specify only **one value** or **two values** or **three values** or **four values**.

## One Value
 example-> margin: 2rem;
 It applies same measurement(2rem here) to all the four sides.

## Two Values
 example-> margin: 2rem 4rem
 First value gets applied to top and bottom and second value gets 
 applied to left and right of element.

## Three Values
 example-> margin: 2rem 4rem 1rem;
 First value applies to top, second value applies to right and 
 left and third value applies to bottom.

## Four Values
 example-> margin: 2rem 4rem 3rem 1rem;
 First value gets assigned to top, second values is assigned to 
 right, third values gets assigned to bottom and fourth value gets 
 assigned to left.
Snow (Pure CSS)
Tags: codepen
Published: 2021-12-03 08:29:12

<p>Inspired by: <a href="https://codepen.io/YusukeNakaya/pen/NWPqvWW" target="_blank">https://codepen.io/YusukeNakaya/pen/NWPqvWW</a></p>

<p>This is a pure CSS version :d</p>

{% codepen https://codepen.io/alphardex/pen/dyPorwJ %}
Object Pool Pattern
Tags: computerscience, algorithms, beginners, java
Published: 2021-12-03 08:26:38

> Object Pool (resource pools) provide container to reuse objects that are expensive to create.

## Motivation 

Consider a scenario in which instantiating a new object is resource extensive. The Object Pool pattern solves this problem by providing a mechanism for creating object only when there no cached instance.

## Applicability

The Object Pool pattern can be used in cases where:

- Application contains objects which are expensive to create, resource and performance wise.
- Clients require same resource but at different time period.
- When created objects are reusable.
- When we are working on a job that allocates and re-allocates many objects.


## Structure

![Object Pool Pattern class diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1djnja8rnr45o3eis908.png)

### Participants

-  **Client:** the client uses pooled object type (reusable objects).
- **Reusable Pool:** they manage reusable objects for the client.
- **Object Pool:** they manage and maintain available objects and collect objects that are requested.

### Collaborations

- Clients configure object pool objects

## Advantages
- It increases performance.
- Since it uses pools it is easier to manage and reuse, share objects.
- It reduces time since objects are in pools one can reuse them which decreases significant amount of time.

## Disadvantages

- When reusing objects from the pool unless previous state is changed(reset) it has different output than expected.
- Once an object is used unless it is sent back (released) to the pool it can’t be used (dependent on the client).

## Implementation

The object pool creates objects to be used again (reusable) so when an object is needed it is fetched from the pool or if an object is already waiting it is then returned. Pools are where reusable objects are stored once the object is released it is sent back to the pool.

The implementation of an object pool must also consider a multi-threaded environment. If different threads access the pool concurrently a consistency error will occur. For this reason access to the object pool must be synchronized.

## Demo

> Let’s suppose in the cafe explained in the introduction of the series, the menus are printed out for every new customer, and are thrown out when the customer leaves. The owners have now realized this is very cost inefficient. They now want to reuse the menus and only print new ones when necessary.

To solve this problem, we first create a generic object pool
class with an abstract create method. Then we use this class to make a concrete `EnglishMenuPool`. Now we can use checkout and check-in methods to reuse menu object and create new ones when all objects are in use.

{% replit @eyuelberga/Object-Pool-Pattern %}
NEON LOVE
Tags: codepen
Published: 2021-12-03 08:25:57

<p>Fragment shader for quadratic Bezier curve SDFs with glow. Using distance function from <a href="https://www.shadertoy.com/view/MlKcDD" target="_blank">https://www.shadertoy.com/view/MlKcDD</a></p>

{% codepen https://codepen.io/al-ro/pen/BaaBage %}
Choosing Storage Boxes
Tags: storageboxes
Published: 2021-12-03 08:20:14


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

When you store items in a storage unit, choosing quality boxes is important to avoid damage. Remember to stack your boxes properly to distribute the weight evenly. When placing items on top of each other, make sure you label the boxes carefully to avoid shifting. Use additional packing material to fill gaps between stacked boxes. You can use towels and linens to keep your belongings safe. These can be placed in a box that's too heavy to lift.

Before you purchase **[storage boxes](https://expedition134.com/)**, you'll want to decide what type of materials are best for your items. These boxes come in all shapes, sizes, and colors, so choosing the right one is very important. Additionally, you'll want to consider the contents of the boxes you plan to store. Whether the items are fragile, odor-absorbing, or valuable, these things need proper protection. A good storage box will make the process easier and reduce the chance of accidents.

If you plan to store a lot of items, you'll likely need larger storage boxes. Tote-style boxes are best for storing larger objects, as they can be stacked. Most storage options have lids so that dust won't settle in the interior. You can choose small decorative bins or large under-bed storage bins. Fabric bins are easy to clean and are attractive. Some of the smallest bins even come in see-through style so that you can see what's inside without opening it.
How to install New Relic infrastructure agent to AWS Elastic Beanstalk with Amazon Linux 2
Tags: aws, beanstalk, newrelic, al2
Published: 2021-12-03 08:10:05

---
title: How to install New Relic infrastructure agent to AWS Elastic Beanstalk with Amazon Linux 2
published: true
description: The solution to install agent to EB with Amazon Linux 2
tags: AWS, Beanstalk, newrelic, al2
//cover_image: https://direct_url_to_image.jpg
---

## Problem

I want to install New Relic infrastructure agent to Elastic Beanstalk with Amazon Linux2.

The guide is following.

https://docs.newrelic.com/jp/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk/

But this guide is not correct about Amazon Linux2.

## Why is the document wrong?

[The aws official document](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html) says,

> On Amazon Linux 2 platforms, instead of providing files and commands in .ebextensions configuration files, we highly recommend that you use Buildfile. Procfile, and platform hooks whenever possible to configure and run custom code on your environment instances during instance provisioning. For details about these mechanisms, see Extending Elastic Beanstalk Linux platforms.

In Amazon Linux2, it seems that customizing with `.ebextensions` doesn't work anymore.

We should use https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html instead of `.ebextensions`


## How to install

The solution is following.

1. `eb setenv NEW_RELIC_LICENSE_KEY=<YOUR_NR_LICENSE_KEY>`

2. Put the following content at `.platform/hooks/prebuild/00_install_nr_agent.sh`

```shell
#!/bin/bash
set -e

# NEW_RELIC_LICENSE_KEY has set as one of Elastic Beanstalk Environment properties
NR_LICENSE_KEY=`/opt/elasticbeanstalk/bin/get-config environment -k NEW_RELIC_LICENSE_KEY`
DISPLAY_NAME=<YOUR_APPLICATION_NAME>

sudo cat > /etc/newrelic-infra.yml <<EOL
license_key: ${NR_LICENSE_KEY}
display_name: ${DISPLAY_NAME}
EOL

sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/7/x86_64/newrelic-infra.repo
sudo yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
sudo yum install newrelic-infra -y

# Restart the process because the update of config isn't reload automatically
sudo systemctl restart newrelic-infra
```

3. `chmod 755 ./.platform/hooks/prebuild/00_install_nr_agent.sh`

4. `eb deploy`

## Conclusion

I found Elastic Beanstalk is based on EC2.

I hope the article helps someone to install newrelic agent with EB.

Thanks!

## References

- https://gist.github.com/hyeoksuhan/c287bc191e5f1757818b9ea0aeeb1b94
- https://docs.newrelic.com/jp/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk/
- https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/install-infrastructure-monitoring-agent-linux/