teleren/devto huggingface dataset:
How I met Open Source ?
Tags: hacktoberfest, opensource, github
Published: 2020-10-17 07:02:23

Hacktoberfest is the best thing that can ever happen to anyone. It introduced me to Open Source. 

The Hacktoberfest is a yearly fest done to introduce the new commerce with the open source platform. Similarly it happened with me this year. You needn't any expertise in any one domain to get started and contribute to other repositories. It's just finding your interest , have a basic idea of that interest and you are good to go. If you encounter anything which is new to you, learn it at that time only. And the best part is , with just 4 pull requests, you get those amazing swags. Everyone must try it once.
My first Open-Source Experience
Tags: hacktoberfest
Published: 2020-10-17 07:01:08

## What I Learned From Hacktoberfest

This was my first Open Source experience, and it was great! Learned a lot of cool stuff, of how things are done and work in this area.

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->
HacktoberFest Story
Tags: hacktoberfest
Published: 2020-10-17 06:55:58

## What I Learned From Hacktoberfest

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->

Starting of October as a newbie I don't have any knowledge on Opensource , then I got know there is some fest called HacktoberFEST which is purely for open source contribution....


So I just googled and got too know what open source is
Open-source software is a type of computer software in which source code is released under a license in which the copyright holder grants users the rights to use, study, change, and distribute the software to anyone and for any purpose.

hacktoberfest main goal is to contribute more to open source, although I saw so many repositories that doesn't comes under  hacktoberfest policies. But I saw few repositories they are open for ideas and issues they were really facing.

The 4 pull requests which I have made 
1. Fixing Their whole Project file(Documentation)
2. Adding few major sorting algorithms with their explanations
3. File Upload problem in JavaScript
4. Helped them to solve some Graph Problems

Although, there is much to learn for me but I am not stopping 
by pulling 4 requests. 

I am very happy that I am part of a major success stories...

This was my story.
Hacktoberfest 2020
Tags: hacktoberfest
Published: 2020-10-17 06:55:27

## What I Learned From Hacktoberfest

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->

Hacktoberfest is about helping each over by fixing problems or improving their code and programs. This is so important as it can speed up projects and help the creators if they are stuck and add the new functionality that they hoped for.
How to contribute Opensource ? 
Tags: hacktoberfest
Published: 2020-10-17 06:53:10

## What I Learned From Hacktoberfest

I had this moment where I asked myself "How would I contribute to Opensource ?". I hope many of us had the same doubt or question in our mind. Honestly I got my answer by taking part in Hacktoberfest. Yes ! my first contribution to Opensource started from Hacktoberfest and I am still contributing :yaay:
There are plenty of projects in Github where you can contribute start here https://github.com/topics/good-first-issue
Hacktoberfest 2020
Tags: hacktoberfest
Published: 2020-10-17 06:50:17

I effectively finished Hacktoberfest 2020 and it was truly fun. Open-Source contribution really helped me a lot to grow my skills and learned a lot from it.
I am truly appreciative of DigitalOcean to organize this amazing fest.💖🤩

This year, I contributed to repositories containing web-based projects, data structures, algorithms, and added some learning resources.

## What I Learned From Hacktoberfest
1. Open source contributions help to improve both our technical and soft skills.
2. I also learned about how Git and Github works.
3. Importance of open-source contribution.
4. I learned more about the quality contributions on Github.
Hacktoberfest 2020 Wrapped
Tags: hacktoberfest
Published: 2020-10-17 06:48:32

## What I Learned From Hacktoberfest
* Hacktoberfest has taught a lot of things this year, from changing the rules to incrementing the review period duration, this year's event instilled a lot of patience and excitement in the participants! 
* I was even a maintainer this year, which was an amazing experience as well. With over 80 PRs on my repo, I'd call it a successful wrap up!

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->
Done and Dusted with Hacktober Fest 2020 Challenge
Tags: hacktoberfest, digitalocean, opensource, github
Published: 2020-10-17 06:45:11

## What I Learned From Hacktoberfest

The most important thing I learned is how to contribute to open-source projects.Hacktober Fest 2020 helped me to dive into various different repositories and projects from Github and assist me to contribute to the Open source community. It also helps me to hone up my skills and gave me an amazing experience.

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

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

Thank You so much @DigitalOcean and @Hacktoberfest for providing such an amazing platform for newbies like me.
Completed HacktoberFest Challenge2020
Tags: hacktoberfest
Published: 2020-10-17 06:33:05


Finally I have completed the #Hacktoberfest2020 challenge. This was my first HacktoberFest and i learned a lot by contributing as a beginner. It really feels so good and i enjoyed a lot by contributing. I would like to thank DigitalOcean ,Github and DEV Community for organizing this open source event which gives beginners a great platform to showcase their skills.
Using Headless Chrome to Automate Image Generation on Heroku
Published: 2020-10-17 06:32:09

---
title: Using Headless Chrome to Automate Image Generation on Heroku
published: true
description: 
tags: 
//cover_image: https://direct_url_to_image.jpg
---

I automate some posting some daily shop rotations in popular games on my site [xstats.gg](https://xstats.gg) to twitter - see [an example](https://twitter.com/xstatsgg/status/1316532268257742854/photo/1)

Building the image as a webpage first allows me to iterate quickly and keep the styles in parity with the rest of the site. 

I use Chrome to load up the page and take a screenshot, and a seperate process tweets the image and posts to other social media.

## Buildpacks
```
1. heroku/ruby
2. https://github.com/heroku/heroku-buildpack-chromedriver
3. https://github.com/heroku/heroku-buildpack-google-chrome
```

## Code
```ruby
class Screenshot
  def capture
    setup
    take_photo
  end

  def setup
    chrome_shim = ENV.fetch("GOOGLE_CHROME_SHIM", nil)
    chrome_bin = ENV.fetch("GOOGLE_CHROME_BIN", nil)

    Selenium::WebDriver::Chrome.path = chrome_bin if chrome_bin
    options = Selenium::WebDriver::Chrome::Options.new
    options.add_argument('--headless')
    options.add_argument('--hide-scrollbars')
    options.add_argument('--no-sandbox')
    options.add_argument('--disable-gpu')
    options.add_argument('--disable-dev-shm-usage')
    options.binary = chrome_shim if chrome_shim
    @driver = Selenium::WebDriver.for :chrome, options: options
  end

  def tmp_file_path
    Rails.root.join("tmp", "screenshot-#{name}.png")
  end

  def take_photo
    driver.navigate.to("https://xstats.gg#{url}")
    max_height = driver.execute_script("return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight);")
    driver.manage.window.resize_to(1000, max_height)
    driver.save_screenshot tmp_file_path
    driver.close
  end
end
```
Livewire OnScroll [Load More] laravel example - phpcodingstuff.com
Tags: laravel
Published: 2020-10-17 06:31:22

page scroll laravel livewire. In this tutorial we will learn how to implement load more data on page scroll in laravel 8 using livewire.

Sometimes, you want need load data on page scroll or infinity page scroll in laravel 8 using livewire.

In this tutorial, you will learn very easy step by step how to implement load more data on infinity scroll in laravel 8 with livewire package.

**[Livewire OnScroll [Load More] laravel example - phpcodingstuff.com](https://www.phpcodingstuff.com/blog/livewire-load-more-onscroll-tutorial-laravel-8.html)**


```
<?php
   
namespace App\Http\Livewire;
   
use Livewire\Component;
use App\Models\User;
   
class LoadMoreUserList extends Component
{
    public $perPage = 15;
    protected $listeners = [
        'load-more' => 'loadMore'
    ];
   
    /**
     * Write code on Method
     *
     * @return response()
     */
    public function loadMore()
    {
        $this->perPage = $this->perPage + 5;
    }
   
    /**
     * Write code on Method
     *
     * @return response()
     */
    public function render()
    {
        $users = User::latest()->paginate($this->perPage);
        $this->emit('userStore');
   
        return view('livewire.load-more-user-list', ['users' => $users]);
    }
}
```
#Hactoberfest @DigitalOcean
Tags: hacktoberfest
Published: 2020-10-17 06:25:14

It is a wonderful experience in participating in the Hactoberfest , from September #preptember to submitting PRs with new rules and guidelines , it helped me to learn more about the pull requests and conditions . in later time I am looking forward to attend much more such type of events to boost up my knowledge in the world of open sources @DigitalOcean #Hactoberfest .
Hey Everyone
Tags: python, javascript, machinelearning, hacktoberfest
Published: 2020-10-17 06:21:57

Hey everyone, really amazed to see there are a lot more people in the world like me. It's a happy moment to join the awesome community. I'm a self-learning guy with a knowledge of C/C++, Python, Machine Learning, AI, and some part of JavaScript. I can work with MERN Stack and MEAN Stack too and currently learning about Vue Js. Also working on my own self creating a blog(Not to disclose now). I also have an intern in ML and my best track/field to work in ML.
I love to contribute to the project so if anybody wants me to help please feel free to ask me. I definitely say yes(depends on my knowledge and topic of the project).
HacktoberFest 2020
Tags: hacktoberfest
Published: 2020-10-17 06:21:53

## What I Learned From Hacktoberfest

It was much like the spirit of Christmas for me. I was the maintainer for a few repositories and I knew only some parts of how to make what the repository aimed to do. This is when people from all over the world helped fill those voids with their knowledgeable contributions.
What I learnt from this HacktoberFest was that all softwares have some kind of issues of varying difficulty so people who are new to Open Source should not get disheartened when they have limited knowledge on a particular subject, they just need to find the issues which suit their expertise :+1: .
Hacktoberfest Journey
Tags: hacktoberfest
Published: 2020-10-17 06:19:15

Finally .. a push to explore the world of open source. It would be just a place to push and pull my code, never been encouraged to contribute and submit PRs. I have truly enjoyed this journey.

Few PRs I've made:
* Help improve the code of Python Pygame games.
* PR for improving the JS logic of a simple converter.

Thank you Hacktoberfest & @DigitalOcean!
Answer to Last Week's Web Scraping Challenge

Published: 2020-10-17 04:57:29

We at TeraCrawler.io do a lot of web crawling and web scraping. We write a lot about it too here as well as on our blog. Every day is a new challenge. When a new developer joins our team, we throw a few challenges at them to test their ability to think through a quagmire that is web scraping.

So last week we posted a web scraping coding challenge to see if some of you wanted to test yourself against a real-world web scraping problem. Here is our answer to that problem in a step by step manner:

So in the challenge we had to scrape Flipkart data using Python and BeautifulSoup is a simple and elegant manner.

So the first thing we need is to make sure we have Python 3 installed. If not, you can just get Python 3 and get it installed before you proceed.

Then you can install beautiful soup with:

We will also need the libraries requests, lxml, and soupsieve to fetch data, break it down to XML, and to use CSS selectors. Install them using...

Once installed open an editor and type in:

Now let's go to the Flipkart listing page and inspect the data we can get.

This is how it looks:

Back to our code now. Let's try and get this data by pretending we are a browser like this:

Save this as scrapeFlipkart.py.

If you run it:

You will see the whole HTML page.

Now, let's use CSS selectors to get to the data we want. To do that let's go back to Chrome and open the inspect tool.

We notice that all the individual product data are contained in a with the attribute data-id. You also notice that the attribute value is some gibberish and it's always changing. We cant use this. But the clue is the presence of the data-id attribute itself. That's all we need. So let's extract that.

This prints all the content in each of the containers that hold the product data.

The second line above gives us the URL to the listing.

The product rating has a meaningful id productRating followed by some gibberish. But we can use the *= operator to select anything which has the word productRating. 

Scraping the price is even more challenging because it has no discernable class name or ID as a clue to get to it. But it always has the currency denominator ₹ in it. So we use regex to find it.

We do the same to get the discount percentage. It always has the word off in it.

Putting it all together.

If you run it it will print out all the details.

Bingo!! We got them all. That was challenging and satisfying.

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 Flipkart. In this scenario using a rotating proxy service to rotate IPs is almost a must. You can use a service like Proxies API to route your calls through a pool of millions of residential proxies.

If you want to scale the crawling speed and dont want to set up your own infrastructure, you can use our Cloud base crawler teracrawler.io to easily crawl thousands of URLs at high speed from our network of crawlers.
My first contribution to open-source 
Tags: hacktoberfest, opensource, javascript, webdev
Published: 2020-10-17 06:11:55

## It was a great experience!

<!-- It was a wonderful opportunity, many thanks to Hacktoberfest. I'm a self-teaching developer and fairly new to this world. I was very dubious & a bit anxious about my contributions but this guide [https://www.digitalocean.com/community/tutorial_series/an-introduction-to-open-source] helped me enormously. And with this new found confidence and skills I successfully accomplished my goal. I'm now exalted & jumping with happiness for having made my mark this year. I'm looking forward to more such feats in the near future. 

Best advice to beginners who are hesitant to contribute, it's a great opportunity to test oneself of their abilities and skills so stop overthinking and believe in yourself. You can do it! See y'all on the other side, believe me its a great feeling. Cheers -->
Objects
Published: 2020-10-17 06:11:06

## Please help me to identify a bug

<!-- Please read the problem and also the solution created by me. I am unable to get a bug in this. It seems good to me.

Given below is an array of objects stored in variable library. Your work is to create a function with one object as argument
You have to create a new object with 2 properties. 1st property named prop1 has value i.e., an array containing objects
with readingStatus value true and 2nd property named prop2 has value i.e., an array containing objects with readingStatus value false.
Return the resulting object in an output variable

Given below is the format of the object which will be passed as the argument.
var library = [
    {
        title: ,
        author: ,
        readingStatus:
    },
    {
        title: ,
        author: ,
        readingStatus:
    },
    ]; -->
How to validate POST and non-POST data in Codeigniter 4
Tags: ci4, codeigniter
Published: 2020-10-17 06:02:37

This is just a snippet of code so that I can refer back in the future if required.

How do you validate non-POST dan POST data in Codeigniter 4 without resorting to creating your own validation rules?

Let say we have a very simple form with one input:

```
<input type="text" name="item">
```
And we also have a data set acquired from somewhere else:
```
$data['price']= "5"
```
The key is to have our validation runs with a variable:
```
$validation->run($post)
```

First we set $post to combine both our POST and non-POST data:
```
$post = array_merge($request->getPost(), $data);
```
Then we run our validation script as required:
```
\\ set our validation rules
$validation->setRules([
    'item' => 'required',
    'price' => 'greater_than[0]'
]);

if(! $this->validation->run($post)) {
// error
} else {
// success
}
```
Hope this helps.
Hacktoberfest experience
Tags: hacktoberfest
Published: 2020-10-17 05:57:35

## What I Learned From Hacktoberfest

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->
I am very happy to complete my 4 pull request in hacktoberfest .I learn many new things about git ,github,and open source . Thank you hacktoberfest organizers .
#hacktoberfest is awesome .
Thanks @digitalocean
Hacktoberfest 2020
Tags: hacktoberfest
Published: 2020-10-17 05:57:29

## What I Learned From Hacktoberfest

Well, I was new to the concept of __Open-Source Contributions__. So, as to be more proficient in this field, I decided to work on some projects which would clear up my doubts and be adept in open-source. As a result, I enrolled in Hacktoberfest 2020. This month-long open-source challenge really helped me to grow my roots in Open-Source Contributions. I am really thankful to DigitalOcean to organize this event for beginners like us
Do you prefer subdomains or subdirectories?
Tags: webdev, discuss, domain, url
Published: 2020-10-17 05:48:40

---
title: Do you prefer subdomains or subdirectories?
published: true
description: 
tags: webdev, discuss, domain, url
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y2qze7gadqghoyajok01.png
---
A subdomain is a URL that allows you to essentially create several websites on a single domain. It’s the blog.yourcompany.com kind of URL.

Subdirectories, on the other hand, are URLs that host subsets of content in separate “folders.” It’s the yourcompany.com/blog kind of URL.

What are your preferred approach to organize website content and rank higher in search results?
My First Hacktoberfest
Tags: hacktoberfest, github, opensource
Published: 2020-10-17 05:41:04

## What I Learned From Hacktoberfest

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->
One of my Goals for 2020 was to contribute to open-source projects, and Hacktoberfest seemed like a perfect opportunity to achieve it.

As the Hacktoberfest began, I started searching for open-source projects to which I could contribute.
I finally found my first project on a repository on Data structures and Algorithms in C++ and Python, where I contributed by adding recursive programs in C++.
This motivated me to contribute more to the open-source community, and I contributed to another project on Python web-scripts by making a web-scraper.

Through Hacktoberfest, I had an experience with the open-source community and how to contribute to them. I look forward to making several such contributions in the future.
Asynchronous Javascript
Published: 2020-10-17 05:30:34

# What is Asynchronous Javascript? 

- Javascript is a single-threaded programming language. This means that processes run one at a time. Asynchronous Javascript allows us to schedule processes that don't block the main thread. 

# Our options writing asynchronous code

## Callbacks

- In order to use callbacks to do asynchronous work, we simply provide a callback to the function that is doing the asynchronous work. When the work resolves, we will call the passed in callback function with the result of asynchronous work. 

## Promises

- A promise is an object that can produce a value sometime in the future. Instead of providing a call back to our function that does asynchronous work. We can instead return a new Promise. Promises are initialized with a callback function that takes two arguments, "resolve" and "reject". Inside this callback function is where we kickoff our asynchronous work. When we want to return the result we simply call resolve and pass it the results. Otherwise we call reject and pass it the error. When a function returns a promise we are able to consume a promise by attaching then() statements to the result. This allows us to either see the resolve or rejection returned by the promise.

## Async / Await

- The only difference between the last method and using async and await is how we consume our promises. Instead chaining then callbacks we can wrap our consumption in a function decorated with the "async" keyword. Inside this function we can use a try and catch block. and inside the try we can await the results from out async functions. If at any point they fail the error will be handled in the catch block, otherwise we are free to work with the data in our try block.
How many email addresses do you use?
Tags: discuss, productivity, email
Published: 2020-10-17 05:29:28

---
title: How many email addresses do you use?
published: true
description: 
tags: discuss, productivity, email
cover_image: https://www.cloudhorizon.com.au/wc160913/wp-content/uploads/2017/05/email.png
---
Currently, I actively use four.
One for development projects related stuff (based on personal domain), one for an office job I work (provided by employer), a personal Gmail, and another one for all the informal stuff (local email provider). There is also my university email, which I use pretty rarely since I graduated.

How many email addresses do you actively use?
My 1st Open Source.
Tags: hacktoberfest
Published: 2020-10-17 05:24:05

## What I Learned From Hacktoberfest

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->

I really enjoying this open source fest. I correct 4 people repo. codes.Some people in github submit their codes but not specified why they use this code this is very bad thing & not remove extra code.I correct their codes & update their readme.😇😇😇😇😇😇

Thank You!
HacktoberFest2020
Explain like I'm five documentation 
Tags: explainlikeimfive, help
Published: 2020-10-17 05:22:36

Hey guys, I hope all of you are trying to be part of #hacktoberfest.
This months my company (web developers for companies) has started to get a lot of projects, and as I was taking a look at the planning I decided to take a break and read some Dev.

well I found this repo
{% github facebook/docusaurus %}

and I started to think... should this projects have documentations? :thinking:
So I think I need to be explained like I'm five documentation...
When should you use it?
Why should you use it?
Thank you Hacktoberfest!
Tags: hacktoberfest, opensource
Published: 2020-10-17 05:16:45

So, this was the first time that I was introduced to the world of open source.
I cannot describe the emotion that I felt when my first PR got merged and later when my further PRs were merged with a sweet Thankyou note from the author. Not only was I successful in helping them but I got to learn a lot myself!

Thankyou DigitalOcean for organizing this amazing fest!