teleren/devto huggingface dataset:
Dependabot needs a workflow too
Tags: github, dependabot
Published: 2021-11-06 13:18:11

Modern JavaScript projects tend to have a lot of external dependencies. It's important to keep those dependencies up to date. [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically) is a great help in this. However, using Dependabot comes with new challenges:

- If your project has a lot of dependencies, Dependabot is creating new PR's on a daily basis. Who's responsible for dealing with them?
- Can we automatically merge PR's created by Dependabot or should we test them (locally)?

Our team came to the conclusion that Dependabot indeed helps us keeping the dependencies up to date, but that's not enough: Dependabot needs a workflow too. This is how we do it:

- A developer who is creating a new PR, should at the same time have a look at the existing open PR's, including the PR's opened by dependabot.
- We [automatically merge](https://github.com/marketplace/actions/dependabot-auto-merge) patch PR's.
- Patch update, but failing tests? Checkout locally, check why tests are failing, fix, push and merge.
- Minor update and dev-dependency (and tests are green)? Just merge.
- All other type of PR's: checkout locally and test.

Notes:

- If there are 5 open dependabot PR's, it's not your responsibility to tackle them all. Just review 1 or 2, and leave the rest to the next developer.
- If Dependabot keeps on creating the maximum number of PR's several days in a row, we sometimes just run [`npm-check update`](https://www.npmjs.com/package/npm-check) to test and update a bunch of packages at the same time. (This is basically the workflow of projects without dependabot and the problem with that approach was that actually nobody was updating the dependencies at all.)

Keep your dependencies up to date, but share the burden across your team.

Happy updating!
zsh: command not found: pod 
Tags: reactnative, javascript
Published: 2021-11-06 12:53:10

In my react-native project, I had already cocoapods installed but there was version conflict to my project. So I start searching for a way to install cocoapods specific version ( 1.10.1 ) at the time of writing cocoapods is at version 1.11.2.

I didn't find any way to install specific version with Homebrew but I found very good command.
`sudo gem install cocoapods -v 1.10.1`

But problem with this command is, whenever I ran `pod install` I got `zsh:command not found: pod`.

##Work around
Run command `gem install cocoapods -v 1.10.1` 

If you get the error "ERROR: While executing gem ... (Errno::EPERM); Operation not permitted - /usr/bin/fuzzy_match" then try: `$ sudo gem install -n /usr/local/bin cocoapods`

and now you are good to go...

Enjoying coding in React Native.
Showcase your project at Git Commit Show
Tags: webdev, programming, opensource, github
Published: 2021-11-06 12:41:27

**Git Commit Show #season03 on 27th & 28th November, 2021.** 
[Git Commit Show](https://gitcommit.show/) is inviting you guys to showcase your breakthrough project ideas on web, robotics, automation, ml, etc. 
Giving a platform for those crazy ideas, that can impact a wider audience. Last two seasons we had some amazing projects home cleaner robot, 3D mouse etc.
So this is the [link to fill the form](http://push.gitcommit.show/), the whole team at Git Commit Show would like to help you with your idea! Let's have you there! 

[Join our Discord](https://discord.gg/JFWP8c2gPG) to know more and participate in Giveaways!
React setState which way is right
Tags: react
Published: 2021-11-06 12:31:29

This is very fundamental but need deep analysis, wic one is better approach. 

In this code we are setting setState in onCheckChange, without useCallback.

```
const App = () => {
  const [checked, setChecked] = useState(false)

  // Without UseCallback
  const onCheckChange = () => {
    setChecked(!checked);
  };
  return (
    <div className="App">
      <input type="checkbox" onChange={onCheckChange} checked={checked} />
    </div>
  );
}

```

In this code state will be updated through useCallback to avoid re-creation of onCheckChange

```
const App = () => {
  const [checked, setChecked] = useState(false)

  // Callback to update Sate
  const onCheckChange = useCallback(() => {
    setChecked(checked => !checked);
  }, [setChecked]);

  return (
    <div className="App">
      <input type="checkbox" onChange={onCheckChange} checked={checked} />
    </div>
  );
}
```
code abandonment
Tags: devjournal, devcomics, dev, comics
Published: 2021-11-06 12:08:58

pov: a stale repo.

![code abandonment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q22xenkvhcd0od993kbg.jpg)

there are many things i life that scares me —

(1) the thought of monday morning on sunday evening
(2) the day a 2-week shape with lots of db migrations and session manipulations gets released on prod
(3) any impromptu 1 on 1s

among others. for most devs, included here are repos with last recently commit 1 year ago.

---

further reading: centimentalcomics.com
Axios with React CRASH COURSE with CRUD Operations and More for Beginners
Tags: react, javascript, beginners
Published: 2021-11-06 12:08:23

Axios with React CRASH COURSE with CRUD Operations and More for Beginners

Timeline :

 ----------------------------------------------------- 

00:00 What is Video 

00:23 What is Axios ? 

00:50 Setup Axios with React 

CRUD Operations

 ----------------------------------------------------- 

01:55 Make a GET Request - Read Users 

04:44 Make a POST Request- Create User 

08:22 Make a DELETE Request - Delete User 

10:05 Make a PUT Request - Update User 

----------------------------------------------------- 

13:49 Error Handling with Axios 

15:19 Show Custom Message 

17:00 Create an Instance of Axios 

19:43 Async & Await with Axios 

https://youtu.be/MacIEf7vh3A
{%youtube MacIEf7vh3A%}
asking for help.
Published: 2021-11-06 12:01:53

Hello everyone, I am a beginner in web development, and I am currently working on a project that consists of retrieving data from a sensor linked to an esp32 microcontroller, I need to access this data in real time using a search engine and this in any internet connection. I want to do this by using javascript
I hope someone can help me by detailing what I need to achieve my project. 
and thanks in advance.
code every day with me
Tags: javascript, programming, 100daysofcode, algorithms
Published: 2021-11-06 12:01:28

##--DAY 15--
Hi, I am going to make #100DaysOfCode Challenge. Everyday I will try solve 1 problem from leetcode or hackerrank. Hope you can go with me until end.
**Now let's solve problem today:**
- Problem: Drawing Book
- Detail: [here](https://www.hackerrank.com/challenges/drawing-book/problem)
- My solution (javascript):
```
function pageCount(n, p) {
    if(p==1||p==n||(p==n-1 && n%2!=0)) return 0;
    let move1=Math.floor(p/2);
    let move2=Math.floor(n/2)-move1;
    return Math.min(move1,move2);
}
```
-->*If you have better solution or any question, please comment below. I will appreciate.*
My experience with Scrimba's JS beginners course
Published: 2021-11-06 11:33:02

#What I liked about the course

**Small lessons**
* Each module was around 2-5 minutes usually
* Each topic was broken down over a series of modules (e.g. he would slowly introduce the concept of objects to ease me into it)

**The Teacher**
* He did an excellent job of teaching with a beginner's perspective (me) in mind.

 He explained the different concepts in a way that made sense, 
 giving real-world use case examples including websites that 
 turned abstract into reality.


* I'd feel like my understanding of certain topics was shaky, like I hadn't quite grasped it.

And he knew this. He'd often confirm for me that it's normal if I'm on thin ice with these concepts.

This reassurance was refreshing, confidence-building and made JavaScript incredibly less daunting for me.

So I started thinking to myself: "Hey, I'm new to this topic (e.g. objects, functions etc). I don't need to fully understand it all. I'm not supposed to. It's unwise to try and learn 100% of a topic and read into the detail the first time I come across it. Instead do as I'm being taught: learn in layers".

Whether that's understanding documentation online or writing code better: do it in layers. Perfection/excellence the first time around is impossible. Even professional developers refactor their code (improve it e.g. readability, efficiency etc).

>"First make it work, then make it better" ~ Per Harald Borgen (my teacher)

--
#How did I learn?



The format of the course was that he would explain a topic, give examples then give me a mini-challenge. I'd have to write the code myself. Then, after, he would show the solution to the challenge.

So each small topic he'd introduce, we'd move away from the main project we were working on, do some practice challenges to gain a better understanding; build "muscle memory"; build confidence, then return to the main project we were working on and implement what I had learnt.



**Some tips that helped me understand and build confidence:**

* I often repeated what he said in my own words - this helped test if what I had learnt made logical sense to me.


* I said aloud the logic of my code - this helped test if I was understanding why I was writing each part of my code instead of just "copying and pasting" word for word the format (e.g. a for loop).


* I Didn't take notes
I didn't fuss over writing down every definition. I think I only wrote down 3 sentences and they were some advice like the quote I mentioned earlier in this post.


* I went through the modules almost every day (some weeks there was a few days gaps mainly because I was busy with other responsibilities). This consistency helped with my confidence. I wasn't leaving an entire week gap and then feeling that what I'm returning to is alien again.
I made Django Blog App Tutorial
Tags: django, tutorial, webdev, python
Published: 2021-11-06 11:03:28

## What is Django?
Django is an open-source web framework, written in Python, that follows the model-view-template architectural pattern. Consequently, a web framework is just a set of components that help you to develop websites faster and easier. Basically, it is pre-made snippets of code, that have already been tested and debugged, that can be used alongside your own code. This allows for quick and easy setup of complex and intricate code without having to worry about developing the base or framework.

When building a website, one always needs a similar set of components: a way to handle user authentication (signing up, signing in, signing out), a management panel for your website, forms, a way to upload files, etc. Luckily, other people long ago noticed that web developers face similar problems when building a new site, so they teamed up and created frameworks (Django being one of them) that offer ready-made components to use.

Frameworks exist to save developers from having to reinvent the wheel and to help alleviate some of the overhead when building a new site using Django.

----------------------------------------------------------
In this tutorial, we’ll build a Blog application with Django that allows users to create, edit, and delete posts. The homepage will list all blog posts, and there will be a dedicated detail page for each individual post. Also, visitors can comment on the post and we make a threaded comment system. Django is capable of making more advanced stuff but making a blog is an excellent first step to get a good grasp of the framework.

Also Tutorial covers,

- Installation and setup
- Designing blog Shema
- Post list, single post, pagination
- Integrating CKEditor in Django Admin
- Featured Image
- Threaded Comments
- Tagging
- Retrieving Posts by Similarity
- Search functionality
- Sitemap

Link:  [Django Blog tutorial CodeSnail](https://www.codesnail.com/django-blog-tutorial/)
I leant something new trying to build a Github profile analytics tool
Tags: github, proxy, tracking
Published: 2021-11-06 10:33:10

---
title: I leant something new trying to build a Github profile analytics tool
published: true
description: How Github ensures that you don't get tracked 
tags: github, proxy, tracking
//cover_image: https://direct_url_to_image.jpg
---

 So last night an interesting idea popped into my head, a simple solution to help you track who visited your Github profile. I began thinking of an approach and finally settled on **[pixel tracking](https://codingterms.com/term/pixel-tracking)**.

which means I will give you an image tag to embed in your GitHub profile **README.md** ie: `<img src="https://4d0a552c1c8e02.lhr.domains/" width="0" height="0"/>`.

With this when someone lands on your page and their browser tries to get the image from my server I will collect all their browser info and use it to provide you analytics, so their IP helps me know their location,  **[user agent](https://codingterms.com/term/user-agent)** to get their device details, language, (Ethics aside for now :)) etc.

Also since the width and height of the image is set to 0 they won't even see that it's there, very straightforward.

 This morning I decided to test this out on my [own profile](https://github.com/EDDYMENS/EDDYMENS/commit/0849a8f109fc76c5445b38d0491e245f1a187882) and I learned something interesting I never thought of.

![server-log](https://user-images.githubusercontent.com/8077713/140604485-6058c4cf-0db5-488c-b3b8-9f8d2116a9ad.png)

The above is what I got back, `github-camo` is what was sent back as the **[user agent](https://codingterms.com/term/user-agent)**. so I googled it.  It turns out to be a **[proxy server](https://codingterms.com/term/proxy-server)** setup by Github, https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls.

So basically the URL I used is masked by GitHub so I can't get info from the visitor's browser. So even the IP I get back is the one from GitHub's server and not the visitor.

I knew Gmail has this kind of implementation to prevent pixel tracking but I always thought Github, Twitter, etc masked URLs using domains like **githubusercontent.com** just for CDN purposes, I never thought it was more than just that.

I am keeping this in mind for future work I will be doing that involves allowing people to embed or share URLs. 

But on the real, though Github should give us profile analytics just like they do with repos. :)
Ask your burning accessibility questions today!
Tags: a11y, beginners, webdev
Published: 2021-11-06 10:54:42

I invited myself (yes I am **that** person!) to speak at a Twitter space tomorrow. 

The space will be about Accessibility, in particular:-
1. How to pitch accessibility to your team at work.
2. Money! Investment and return on tools, training and accessibility.
3. A brief introduction to Screen reader behaviour with HTML tags (as screen reader behaviour is similar to CSS coverage, not always 100%)

**Note that the Agenda is not limited to only these 3 items if you have questions about anything else accessibility related just let us know!**

## Come along and say hi!

{% twitter 1456868618973503496 %}

Most of the work will be done by:

### Neha Sharma (Host)
Neha (who is running the space) is an excellent accessibility advocate, so her advice will be invaluable. 

She writes here on DEV so you should check out her stuff:

{% user hellonehha %}

She also founded [**JS Lovers**](https://twitter.com/jslovers_Del) - A Meetup/Workshop community by Developers for Developers in and around Delhi,Mumbai and Pune.

You can also find her on Twitter [@hellonehha](https://twitter.com/hellonehha), so go check out her stuff on there too! 

### Tanisha Sabherwal (Co Host)
Tanisha (who is co-hosting) works at JPMorgan as a front-end engineer. You can find some stuff Tanisha has written at [tanishasabherwal.me](https://www.tanishasabherwal.me/) and find her on twitter at [@tanishaaa03](https://twitter.com/tanishaaa03)!

It is my first time chatting with Tanisha but from the stuff of hers I have read I look forward to it!

### Graham from InHu (me! - the tag-along self inviter!)
Those of you who follow me know I am outspoken and quite blunt about accessibility. 

I prefer facts over fluffiness and actionable steps over general "you should do it because it is the right thing to do" advice that doesn't get results. 

So you can expect a little bit of that thrown in there!

## Wait, you invited yourself?
Yup, Neha and I have "spoken" (written to each other in comments!) on several occasions and I always like what she has to say. 

The second I saw her space was on accessibility (my passion) I had to reach out and see if she would like me to join in.

Luckily she said yes, so you get me there too (whether that is a good or a bad thing is a different question! 😋)

---

<br>
<br>
<center>I Look forward to seeing <mark>you</mark> there!</center>
<center>[Link to Original Tweet so you can set a reminder](https://twitter.com/hellonehha/status/1456868618973503496)</center>

---
About Me
Tags: about
Published: 2021-11-06 10:47:35


## About Me

Hey, I’m **Fazlul Kabir**. Currently working as “Full-Stack Developer” at “[Aiva Labs Inc.](https://aivalabs.com)”.

I’ve been working in the software engineering field for over 2 years. I’ve got excellent knowledge of web technologies like **PHP, Laravel, Javascript, Node.js, Express, React, Vue.js, Inertia.js, JQuery, MYSQL, MongoDB, HTML, CSS, Sass**. I have experience in developing custom and dynamic web applications. I have strong knowledge about OOP, MVC framework, SOLID & DRY principles & also on RESTful API development.

I love building things. While hard engineering problems are often intrinsically fun to tackle, I’m most attracted to solving real customer problems with a business justification.

## Work Experience

* Full-Stack Developer at [Aiva Labs Inc.](https://aivalabs.com) (03/2021-Present)

* Jr. Laravel Web Apps Developer at [ITCLAN BD](https://itclanbd.com/) (03/2020–03/2021)

* Jr. Software Engineer at [NEXTGEN IT LTD](https://www.nextgenitltd.com) (09/2019–02/2020)

## Technologies I consider as my skill

* PHP

* Laravel

* Javascript

* Node.js

* React

* Vue.js

* jQuery

* Inertia.js

* MySql

* MongoDB

* HTML

* CSS

* Sass

* VCS(Git)

* REST API

* GraphQL

* Shopify(App Development)

## Field of Interest

* System design & architect

* Server load balancing

* Database Optimization

* CI/CD

* AI(ML)

## Education

* BSc. Engineering in [Computer Science and Telecommunication Engineering](https://nstu.edu.bd/department/cste), [Noakhali Science and Technology University, Noakhali, Bangladesh](https://nstu.edu.bd)

* HSC in Science, [Comilla Victoria Govt. College, Comilla, Bangladesh](https://www.cvgc.edu.bd)

* SSC in Science, [Comilla Zilla School, Comilla, Bangladesh](http://www.czs.edu.bd)

## Other Activities

* Competitive Programming (Stopstalk profile: [fazlul_kabir](https://www.stopstalk.com/user/profile/fazlul_kabir))

* Former General Secretary, CSTE Club (2018–2019), NSTU

## Find Me Here

* [LinkedIn](http://www.linkedin.com/in/fazlulkabir34)

* [Twitter](https://twitter.com/fazlul_34)

* [Medium](http://fazlulkabir34.medium.com)

* [Dev.to](https://dev.to/zisan34)
Started learning React
Tags: react, javascript, frontend
Published: 2021-11-06 10:39:21

Hello guys, I am gonna start learning React. I welcome any beginner friendly guideline. Hope you guys will help me.

'm a Computer Science student, wanna end my frustrating 3 years long competitive programming journey with C/C++ and wanna start development journey. 

I've chosen JavaScript framework React for frontend. I have a good knowledge in html, CSS & Bootstrap and can convert any figma/psd to html page. So, is it high time to start converting those html code to React? Any suggestion i'll appreciate. Thanks.

1st post by the way.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3z9fnggdtdshz01845c8.jpg)
Git basics: Ignore files from being committed
Tags: github, git, beginners
Published: 2021-11-06 10:27:38

There are some files you don't want to commit to Git, simply because they would be too big and don't have any use.

Some examples of these files:

- `node_modules`: Super big and changes every install
- `.env` often contains secrets and keys. Make sure to ignore this file
- Operating system files like: `Thumbs.db`, `.DS_Store`
- `.log` files
- Any cache directory

Luckily there is a simple way always to ignore these from your git repo.

## Introducing the `.gitignore` file

As the name suggests, the `.gitignore` file will ignore specific files you marked inside it.

To use one, create a file called `.gitignore` at the root of your project.

Let's already add our operating files like so:

```text
# Ignore platform files
Thumbs.db
.DS_Store
```

But let's put it to the actual test and initialize npm in our testing repo.

```bash
npm init -y
```

Now let's add a random package. I choose `fastify` for testing purposes.

```bash
npm i fastify
```

If we then look at our Git-changed files, we'll see a massive list of files.

![Git open changes for node_modules](https://cdn.hashnode.com/res/hashnode/image/upload/v1635225546510/SX_6U1_w7s.png)

That's not really what we want as this contains all the node_modules files.

Let's modify our `.gitignore` file to ignore these like so:

```text
# Ignore platform files
Thumbs.db
.DS_Store

# Packages
node_modules
```

If we take another look, we'll see there are only three files ready to be committed.

![Git commit with gitignore in place](https://cdn.hashnode.com/res/hashnode/image/upload/v1635225678012/UITIKWa2s.png)

Way better!

And there you go, you can add any files you want to this `.gitignore` file but be aware of what you'll don't want to be committed.

I've pushed this to [GitHub](https://github.com/rebelchris/git-test) in case you want to have a look.

### 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)
Get Current month records in Laravel
Tags: php, laravel, programming, beginners
Published: 2021-11-06 10:03:09

Let's get started quickly. We have a schedule of articles and we want to get the articles for the month and year we are in :-
```php
$articles = Article::whereMonth('created_at',\Carbon\Carbon::now()->month)
                   ->whereYear('created_at', \Carbon\Carbon::now()->year)
                   ->get();
dd($articles);
```
We will also use SQL MONTH function with PHP date() function :-
```php
$articles = \DB::table('articles')
               ->whereRaw('MONTH(created_at) = ?',[date('m')])
               ->whereRaw('YEAR(created_at) = ?',[date('Y')])
               ->get();
dd($articles);
```
I wish you a happy code.