teleren/devto huggingface dataset:
Web scraping Reddit using Node JS and Puppeteer  
Published: 2021-02-12 13:18:58

In this article, we will learn how to quickly scrape Reddit posts using Puppeteer.

Puppeteer uses the Chromium browser behind the scenes to actually render HTML and Javascript and so is very useful if getting the content that is loaded by javascript/AJAX functions.

For this, you will need to install Puppeteer inside a directory where you will write the scripts to scrape the data. For example, make a directory like this...
That will take a moment to install puppeteer and Chromium.

Once done, let's start with a script like this...
Even though it looks like a lot, It just loads up the puppeteer browser, creates a new page, and loads the URL we want and waits for the full of the HTML to be loaded.

The evaluate function now gets into the page's content and allows you to query it with puppeteer's query functions and CSS selectors.

The second line where the launch happens instructs puppeteer to load in the headless mode so you dont see the browser but it's there behind the scenes. The —user-agent string imitates a Chrome browser on a Mac so you dont get blocked.

Save this file as get_reddit.js and if you run it, it should not return any errors.
Now let's see if we can scrape some data...

Open Chrome and navigate to the node subreddit
We are going to scrape all the posts. Let's open the inspect tool to see what we are up against.

You can see with some tinkering around that each post is encapsulated in a tag with a class name Post amongst a lot of other gibberish.
Since everything is inside this one class, we are going to use a forEach loop to get the data inside them and get all the individual pieces separately.

So the code will look like this...
You can see how the tag always has the title so we fetch that.

The query...
Gets us the first tag after the element with the id starting with upvote-button.

Something similar is happening here as well...
If you want to use this in production and want to scale to thousands of links then you will find that you will get IP blocked easily by Reddit. In this scenario using a rotating proxy service to rotate IPs is almost a must.
Otherwise, you tend to get IP blocked a lot by automatic location, usage, and bot detection algorithms.
Our rotating proxy server Proxies API provides a simple API that can solve all IP Blocking problems instantly.
With millions of high speed rotating proxies located all over the world,
With our automatic IP rotation
With our automatic User-Agent-String rotation (which simulates requests from different, valid web browsers and web browser versions)
With our automatic CAPTCHA solving technology,
Hundreds of our customers have successfully solved the headache of IP blocks with a simple API.
The whole thing can be accessed by a simple API like below in any programming language.
In fact, you dont even have to take the pain of loading Puppeteer as we render Javascript behind the scenes and you can just get the data and parse it any language like Node, Puppeteer or PHP or using any framework like Scrapy or Nutch. In all these cases you can just call the URL with render support like so...
Daily Developer Jokes - Friday, Feb 12, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-02-12 13:00:18

---
title: "Daily Developer Jokes - Friday, Feb 12, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Friday%2C%20Feb%2012%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259620ca4d.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Where does the pirate stash all of their digital treasures?

___A:___ RAR
 -->
Sharpen your Cloud Admin Skills with Microsoft Learn – LIVE – Feb 15-26, 2021
Tags: azure, cloud, beginners, tutorial
Published: 2021-02-12 12:58:57

#### Sharpen your Cloud Admin Skills with Microsoft Learn and Carnegie Mellon University

Live on [LearnTV](https://aka.ms/CMUCloudDevLearntv?WT.mc_id=learnlive-video-learn)
Date: February 15-26, 2021
Time: 3.30 PM ET | 12.30 PM PT | 8.30 PM GMT
Location: Global
Format: Livestream
Topic: Cloud Development

Discover the best practices of implementing Cloud Skills into your courses and learning resource with Microsoft and Carnegie Mellon University. Join Microsoft Cloud Advocates and Microsoft Student Ambassadors as we walk through Microsoft Learn Modules that will help level up your skills as a Cloud Developer.

[Register Now](https://developer.microsoft.com/en-us/reactor/eventseries/sharpencloudskills?WT.mc_id=learnlive-video-learn)

**Session 1**: Sharpen your Cloud Skills with Carnegie Mellon University and Microsoft Learn
February 15 | 3.30 PM ET | 12.30 PM PT | 8.30 PM GMT

**Session 2**: Use Elasticity to Scale Cloud Resources with Carnegie Mellon University and Microsoft Learn
February 19 | 3.30 PM ET | 12.30 PM PT | 8.30 PM GMT

**Session 3**: Automate your Cloud with Carnegie Mellon University and Microsoft Learn
February 22 | 3.30 PM ET | 12.30 PM PT | 8.30 PM GMT

**Session 4**: Monitor cloud resources with Carnegie Mellon University and Microsoft Learn
February 23 | 3.30 PM ET | 12.30 PM PT | 8.30 PM GMT

**Session 5**: Cloud Security with Carnegie Mellon University and Microsoft Learn
February 26 | 3.30 PM ET | 12.30 PM PT | 8.30 PM GMT


#### Self-Paced Learning from MS Learn
* [Scale your cloud resources with elasticity]( https://docs.microsoft.com/en-us/learn/modules/cmu-cloud-elasticity/?WT.mc_id=reactor-1reg-reactor)
* [Automate cloud resource management]( https://docs.microsoft.com/en-us/learn/modules/cmu-orchestration/?WT.mc_id=reactor-1reg-reactor)
* [Monitor cloud resources]( https://docs.microsoft.com/en-us/learn/modules/cmu-monitor-cloud-resources/?WT.mc_id=reactor-1reg-reactor)
* [Cloud Security](https://docs.microsoft.com/en-us/learn/modules/cmu-cloud-security/?WT.mc_id=reactor-1reg-reactor)
MVC Framework for NodeJS
Tags: npm, node, mvc, es6
Published: 2021-02-12 12:54:41

Hi NodeJS lovers. 

Let's focus in business logic and avoid issues with bad practices driving you to the callback hell!

`plugdo-mvc` is a module that implements mvc web software architecture on top of express module. It help you focus in the implementation of the business logic, instead of writing express routing each time you need a new section. 

It also avoid the callback hell because you are forced to implement your request methods like get, post, put and delete using class and async functions ES6. 

You don't even have access to the res and next functions provided by express module, ... maybe yes... but you must create your own middleware.

##Start with:
```
npm install plugdo-mvc --save
```

And follow the documentation:
https://www.npmjs.com/package/plugdo-mvc

I would like to hear some honest feedbacks from the community. It will help me to improve the module.
An easy to use monitoring solution for Redis
Tags: redis, grafana, monitoring, database
Published: 2021-02-12 12:22:46

Recently, I discovered a nice way of plugging in monitoring for Redis using [Grafana](https://grafana.com/), thanks to this great [Data Source plugin](https://github.com/RedisGrafana/grafana-redis-datasource) that works with any Redis database, including [Azure Cache for Redis](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-overview?WT.mc_id=data-16116-abhishgu)!

### It's really easy to setup and try

Setup an [Azure Cache for Redis instance](https://docs.microsoft.com/azure/azure-cache-for-redis/quickstart-create-redis?WT.mc_id=data-16116-abhishgu)


Start Grafana in Docker:

```bash
docker run -d -p 3000:3000 --name=grafana -e "GF_INSTALL_PLUGINS=redis-datasource" grafana/grafana
```

Access Grafana dashboard - browse to `http://localhost:3000/`

> Enter `admin` as the username and password

Add the Data Source

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qhrwhsh844j3d3fr6dx3.png)

Choose **Redis**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/o315rs7rg8bej6xzbwyy.png)

Enter the host and access key for the Azure Cache for Redis instance. 

> Make sure you enable **TLS**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lrhax7ishowx1667jvpw.png)

All set! You can now run queries from the **Explore** section.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lmh7xmv7zj6tlutsuyao.png)

This is just an example of the [INFO command](https://redis.io/commands/info) to retrieve basic Server info.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/61lz6wfrlwq9qtowip4l.png)

### That's not all

There is a nice dashboard which comes with the Data Source - https://grafana.com/grafana/dashboards/12776. 

To import it, just go to the **Dashboards** section of the Data Source.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hojfut28xf5hecv8sqxf.png)

To see it in action, first navigate to **Dashboards** and choose Redis

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e4z8k8lderz4zadykpbr.png)

.. and here it is. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ajpdhv76gtilezs9t1hd.png)

### This is just the beginning...

I am not a Grafana expert, but pretty sure there is lots more to explore. I will try playing around with custom dashboards and other supported Redis Data structures such as Streams etc.
Pet Pharmacy Website Development: What You Need to Know
Tags: webdev, ecommerce, petpharmacy, onlinepharmacy
Published: 2021-02-12 11:59:24

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jm1gzqp9ixvcv1xvvy1g.png)
Pet pharmacy is a very popular field among pet lovers who consider their pets family members. 

However, as every narrow niche, pet pharmacy has its own peculiarities, so you may face some challenges when planning to launch your own online pet pharmacy.

What should you focus on before starting an online pet pharmacy business? Let’s figure it out!

Here is a short guide on basic steps to follow:

* **Create a detailed business plan**. It is an essential part of every start-up, no matter what scales it has.

* **Get all the necessary certificates and licences**. Pet pharmacy is still a healthcare-related industry, so it could be better if you hire a lawyer who will help you with paperwork.

* **Find a professional team of developers**, if you want your project to become really successful. High quality website will definitely contribute to your future conversions rate, so don’t skip this opportunity. 


### What Defines Best Online Pet Pharmacy?

It’s definitely not an easy task to become the best online retailer in the pet pharmacy industry, if you don’t possess enough experience in the eCommerce sector. Here are the main points you should consider when creating an extremely profitable online pet pharmacy business:

* **Qualified employees**. Quality customer service is critical, so you should ascertain your staff members’ competence. As it was mentioned earlier, pet pharmacy is a health-related niche. There is no room for error. Even the slightest mistake can negatively affect your business reputation. 

* **Pricing policy**. Being at the beginning of your entrepreneurial journey, you should remember about an adequate pricing policy. Many merchants intend to increase prices to recoup investments, but such a method is incorrect. This tactic will only have your potential buyers scared off, and it won’t benefit your business. Put fair prices on your products and services, and, in time, you will certainly be rewarded.

What else should you know about pet pharmacy website development? [This article](https://dinarys.com/blog/how-to-start-your-online-pet-pharmacy) has the clue. Besides, here you may also find the approximate cost to develop your own pet pharmacy website.
A Twitter bot to explore the Awesome Java list
Tags: twitter, java, reading, bot
Published: 2021-02-12 11:32:43

I love making lists. I use them to organize my day, remember important things, and keep track of tools and libraries I want to explore. Lists like [Awesome Java](https://github.com/akullpp/awesome-java) are a treat for people like me. Curated content on a technology I like and use everyday? Sign me in!

But the truth is: I am too lazy to actually read the list and select an entry I want to explore. Like many list makers, I end up with piles of lists (and even lists of lists!) that are just collecting dust. I believe these lists are missing one key ingredient to be really useful. I don't want to look at them, I want their content to be pushed directly in front of me.

So I created a [Twitter bot](https://twitter.com/daily_awsm_java) that does exactly that. It uses the curated content from the *Awesome Java* list and posts a daily tweet with a random entry, directly into your feed. 

If you are interested you can follow [@daily_awsm_java](https://twitter.com/daily_awsm_java). The list contains more than 500 entries (kudos to [@akullpp](https://twitter.com/akullpp) for the hard work 🙏), so there will be fresh content for quite some time 😉

You can also take a look at the [original post on the Xatkit blog](https://xatkit.com/a-twitter-bot-to-help-you-explore-your-reading-list/) if you want to learn more about the technology behind the bot.

And let me know if you'd like to see more Awesome List bots on Twitter! The [Awesome list of lists](https://github.com/sindresorhus/awesome#readme) is full of interesting topics to explore!
AWS-SAA-C02
Tags: aws, cloud, firstpost
Published: 2021-02-12 11:26:58

𝗣𝗼𝘀𝘁 #𝟭

So today I gave the AWS Solutions Architect Associate.
They literally made up fake AWS services to make us fall for them😬
After 130 mins of answering 65 questions, I finally passed the exam🤩

The 5 Pillars of the AWS Well-Architected Framework were the main testing areas:
1. Operational Excellence
2. Security
3. Reliability
4. Performance Efficiency
5. Cost Optimization

Time invested in the certification: ON/OFF 3 months💀

𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀:

•  Ultimate AWS Certified Solutions Architect Associate 2021🙌

Stephane Mareek is the 𝗚𝗢𝗗 of AWS universe
Link: https://www.udemy.com/course/aws-certified-solutions-architect-associate-saa-c02/


•  AWS FAQs👋

Link: https://aws.amazon.com/faqs/


•  Tutorialsdojo Cheat Sheets👍

Link: https://tutorialsdojo.com/links-to-all-aws-cheat-sheets/


•  Play Store apps on AWS-SAA which had surprisingly well curated questions!✌️


Ping me @LinkedIn if you want my notes for SAA!
https://www.linkedin.com/in/hritesh-sonawane-1161891a0/

What next?🤔
Probably CCNA or Developer Associate👾
Chart.js Chart displays but no data
Tags: react
Published: 2021-02-12 11:21:38

I'm using React with react-chartjs-2 I'm passing the data to the data. But I am getting a Graph without data.  ATT: inside the data I'm mapping a product object

```javascript 
const [chartData, setChartData] = useState({})
    const products= [
        {name: "PC", solds: 34},
        {name: "Mouce", solds: 55},
        {name: "keyboard", solds: 6},
        {name: "Process", solds: 2},
    ]
    const chart = () => {
        setChartData({
            labels: ['PC', 'Mouse', 'Keyboard', 'Process' ],
            datasets: [{
                label: 'Level of Thiccness',
                data: [Object.entries(products).map(names => names.solds)],
                backgroundColor: [
                    'rgba(75, 192, 192, 0.6)'
                ],
                borderWidth: 4
            }]
        })
    }

    useEffect(() => {
        chart();
    }, [])
    return (
        <div>
            <Line 
            data={chartData}
            />
        </div>
    )
}
```
NumPy random seed (Generate Predictable random Numbers)
Tags: python, beginners, programming
Published: 2021-02-12 11:14:15

---
title: NumPy random seed (Generate Predictable random Numbers)
published: true
description: 
tags: #python #beginners #programming
//cover_image: https://direct_url_to_image.jpg
---
What is NumPy Random Seed?
What is the Pseudo-Random Number?
Random Seed Importance
NumPy.random has no Seed Number
NumPy.random.seed(0)
NumPy.random.seed(101)
random seed scope
Seed to the Time
Random Seed Multiprocessing
Seed the same across computers
Random seed after 1000 time
Random seed 2d array
How to change random seed?
NumPy random seed shuffle
NumPy random seed vs Python random seed
Conclusion

https://likegeeks.com/numpy-random-seed/
Drop-shadow on clipped element - CSS Only
Tags: codepen, css, programming
Published: 2021-02-12 11:09:59

Drop-shadow is one of CSS Filter and by using this We can create a drop shadow for every clipped element by applying a drop-shadow filter to the element's parent. Pretty cool!

![Drop-shadow is one of CSS Filter and by using this We can create a drop shadow for every clipped element by applying a drop-shadow filter to the element's parent](https://dev-to-uploads.s3.amazonaws.com/i/eyw3y86x0ic1vfd0f7hy.png)

![Drop-shadow is one of CSS Filter and by using this We can create a drop shadow for every clipped element by applying a drop-shadow filter to the element's parent](https://dev-to-uploads.s3.amazonaws.com/i/1yb3bfv6zcepxpk5weac.JPG)

In the attached image you can see clearly that every element has a drop shadow and I just applied drop shadow only once to their parent.  


Code + Demo 👇

{% codepen https://codepen.io/atif-riaz/pen/mdOOoXp %}

Note: CSS filters (including drop-shadow) are supported in all modern browsers.
Top Tips to Meet Deadlines and Get Timely Results
Tags: productivity
Published: 2021-02-12 10:57:53

Let’s start with an alarming fact. As per the PwC study, only 2.5% of companies were able to accomplish all the projects successfully. If your company relates to that, it also faces prominent issues like establishing schedules and struggling to meet project deadlines like many other companies worldwide.

It can be understood like this- there will be no sense of urgency and motivation to accomplish the project if you have not fixed a deadline for the project. Therefore, scheduling due dates for tasks is imperative in project management. But then, delays, missed deadlines, and failures are responsible for project failure. It results in wastage of time, money, and effort.

For these reasons, it’s of the utmost importance to ensure that you have robust tools and systems in place to keep all projects on track. Here, a task management tool comes into the picture. Let’s go through five major ways that will help you set realistic deadlines and accomplish tasks on time.

<b>Original Source: <a href="https://www.taskopad.com/blog/how-to-meet-project-deadline-to-accomplish-tasks/">Task Management Software </a> </b>
DCUHack4Change 2021 - Call to Action
Tags: dcu, hackathon, calltoaction, dcuhack4change
Published: 2021-02-12 10:55:13

![Screenshot_2021-02-12 #DCUHack4Change Industry Guests](https://dev-to-uploads.s3.amazonaws.com/i/b6qw0tckekov7vjd32mb.png)
 
{% youtube jQc-zvo17BY %}

📢 My friend, Rosin Lyons from [Dublin City University](https://www.dcu.ie/), has an open call for mentors, speakers, judges and sponsors for their student hackathon - please support! ❤️

🗓 If you have any availability from March 12-19th and would like to support this initiative, you can let them know via https://docs.google.com/forms/d/e/1FAIpQLSfISss2s9vbSiWCQBRHwifd30GxjFUPipzcbUKFwS8wbOlGrA/viewform

Not sure what a hackathon entails? No problem - all info & support will be provided.

There's 3 themes this year:

* Mental health
* Climate
* Equality

---

Please help spread the word to your networks, much appreciated. Thanks! 🥰 - Vicky
# Create Card Components using css grids

Tags: css, grid
Published: 2021-02-12 10:24:13

Hi! with CSS grid we can easily create a card component in  few lines of code and its responsive to let's check it out


# HTML structure
![main container](https://imgur.com/GFkWFI3.png)

This is our main container. inside our main container, we have a card container
![card](https://imgur.com/HemdAqt.png) our HTML is ready now we copy and paste this card container for two more times.

## Here is the Fun part (CSS)
Give basic and default stylings(i used SCSS here).after that 
in our main container, we give `display: grid;`to our main container and specifiying column witdh and count `grid-template-columns: repeat(auto-fit,300px);` with row and column gap of`gap:1rem`
![stylings](https://imgur.com/576Fzy1.png)

## grid-template-columns
gtc determines the column width for each child of the grid parent. the repeat function repeats the size for each number of columns. I know what you're thinking what is auto-fit? I will explain this later. now we style our cards

## Cards styling
![card styles](https://imgur.com/uOoFHOV.png)I applied few styles to our cards. now we will look our result 


## RESULT![result](https://imgur.com/aYN1vHF.png)

Magic... Our card components are ready no more coding. ok now we will learn about autofit



## Auto fit
Auto-fit takes up the as much as the width that available in the grid.  I will explain this with an example. for this now we change auto-fit to 3 columns and add a background for visualization
  ![three columns](https://imgur.com/niuuUud.png)


## Three columns result

![view](https://imgur.com/0BDg4GJ.png)
when we mention the number of columns it takes up the width according to the grid container size. now we change the viewport size.
![resize](https://imgur.com/PmXIxGv.gif)so it is a fixed width. you can change the number columns according to the viewport in media queries

## Now using auto-fit
If you want a responsive card component then use auto-fit.
![magic](https://imgur.com/u5UwDFB.gif)  Magic.. and additional there's an auto-fill too here difference between auto-fill and fit. [auto-fit vs auto-fill](https://youtu.be/uBFEryQY1fU)


##  Controlling height using grid-auto-rows

Normally grid set a row height based on the content but sometimes content for each card may differ so we can control the height using grid-auto-rows. [For clear explaination about auto-rows](https://youtu.be/MDQG6LSS8l8)
![gtr](https://imgur.com/knt3gFD.gif)
[codepen](https://codepen.io/yadzero/pen/dyOOaEG)
Go interview task example -  REST API
Tags: go, recruiting
Published: 2021-02-12 10:16:34

Here is a sample application specification I use as a base for Go interviews. It's pretty simple to write and I use it as a foundation for further conversations with a candidate.

# Task specification

- create simple Go application exposing REST API
- no specific web framework is required to be used
- when `/api/weather` endpoint is called, fetch weather alerts data for the state of New York using [this API](https://api.weather.gov/alerts/active?area=NY)
- read weather alerts headlines from the `api.weather.gov` API response (JsonPath `$.features[*].headline`)
- return alerts headlines in a similar response:

```
{"alerts": ["Wind Chill Advisory issued February 12 at 4:02AM EST until February 12 at 10:00AM EST by NWS Binghamton NY"]}
```

# Extra points

It is up to you how simple or complex the application will be. However you can treat this application as an occasion to brag about the things you know. For example:

- Do you like unit testing? Go for it and show us your favorite testing libraries in action!
- Docker fan? Dockerize the application then and include your Dockerfile!
- Any other cool libraries you know and wanna show us? Let us learn from you!