teleren/devto huggingface dataset:
Three Ways to Prepare Your Pull Request for a Great Review
Tags: pullrequest, codereview, beginners, botanical
Published: 2020-04-28 03:20:53

---
title: Three Ways to Prepare Your Pull Request for a Great Review
published: true
description: Preparing your Pull Request
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/1hm0ll32u43whsn57t9z.jpg
tags: pull request, code review, beginners, botanical
---

# Three Ways to Prepare Your Pull Request for a Great Review

Some software engineering teams use [pull requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) to perform code reviews. In a pull request (sometimes referred to as **PR**), you have the chance to get feedback or approval on your code and make any additional changes before merging your code.

The review process can be dependent on the personalities of reviewers, but I will describe the **three** ways I try and prepare my pull requests so that I can ensure that it is of the best quality before submitting it.

### 1. Review your own PR first
Try to take on the perspective of whoever might review your code. Do you have a mental checklist for what you think they might be looking for during the code review? For example, you can check for typos, formatting, or failing tests.

### 2. Add a description of what you prioritize in the review
When I am reviewing code, I find it helpful when the person who requested a review points out specific parts of the code they want me to look at more closely. Making note of a particular section you might want greater feedback on will help speed up the time it takes to receive a review. For example, if you are unsure of the way you mocked certain objects in your test, you can point that out!

### 3. Explain the changes made
Explaining why code changes were made along with _what_ changes were made will help provide context to your reviewer. I find it better to provide some context than none at all. For example, if you are working in an open source repository and you submit a pull request, you can link the corresponding issue that was opened for the project.

You can improve your pull requests **right now** by:
1. Reviewing your own PR first
2. Adding a description of what you want reviewed first
3. Explaining why you made the changes you did

Let me know if you use any of these methods or share some other practices you follow before submitting your pull request! 🙂
Search Git Commit History
Tags: git, beginners, tutorial, productivity
Published: 2020-05-29 15:02:54

---
title: Search Git Commit History
published: true
date: 2020-04-28 02:45:06 UTC
tags: #git,#beginners,#tutorial,#productivity
canonical_url: https://remotedevdaily.com/search-git-commit-history/
---

Here’s a quick guide on how to search for commits in a repository’s git commit history.

Git logs, particularly for large teams of developers, can get get massive. In such situations, scrolling through logs looking for a specific commit doesn’t really work. Here are a few ways to easily search through a repository’s git history.

### Search By User  

```
git log -i --author="<user>"
```

This command will get all the commits for users that match a specific pattern. **-i** will do a case insensitive search, which usually is the behavior that I want. If you are doing a search where case is important, then simply omit **-i**.

For example:

```
git log --author="Alan"
```

```
commit z14tz0ez2324251gsff5769gg67a42d543255333 (HEAD -> master, origin/master)  
 Author: Alan-S <myemail@something.com>  
 Date:   Tue Mar 31 00:44:29 2020 -0400  
   
     Update README  
   
 commit 44ea613zzdde8b132423cczzz76abcaz9aa444gg  
 Author: Alan-S <myemail@something.com>  
 Date:   Tue Mar 31 00:43:59 2020 -0400  
   
     Fix issue that prevents data from loading on first page load.  
   
 :
```

### Search By String  

```
git log --grep="<string>"
```

This command will search the commit logs for this a specific pattern and return all of the matching commits. For example, this could be useful if you want to search for a commit messages that mention a specific term or phrase.

For example:

```
git log --grep="fetch" -i
```

```
commit z32a231zef218R5af46ffadf253c11f40zpl7383 (HEAD -> master)  
 Author: Alan-Solitar <myemail@something.com>  
 Date:   Mon Apr 27 22:34:53 2020 -0400  
   
     Fetch data on page load
```

This will grab all the logs that include the word **fetch**.

And that’s all. Now you should be able to more easily search through your git history. If you are interested in reading more about Git, consider checking out my article about [quickly deleting all local git branches](https://remotedevdaily.com/delete-all-local-git-branches-quickly/) that I wrote.

Have a great day.

The post [Search Git Commit History](https://remotedevdaily.com/search-git-commit-history/) appeared first on [Remote Dev Daily](https://remotedevdaily.com).
Web Surgery - Ep.5 - Updating the look of the Animal Crossing Item Wishlist Website
Tags: webdev, jekyll, github, jamstack
Published: 2020-04-28 02:35:00

---
title: Web Surgery - Ep.5 - Updating the look of the Animal Crossing Item Wishlist Website
published: true
description: Continue with the last episode, we make more changes to the look of the website: fix the pictures of the items and icons of the social media. We have more or less got a website that we want - we may add more functionality in the future, tell me what you suggest at my Twitch. We will be ready to add the Netlify CMS to our website next time.
tags: webdev, Jekyll, github, JAMstack
---
Continue with the last episode, we make more changes to the look of the website: fix the pictures of the items and icons of the social media. We have more or less got a website that we want - we may add more functionality in the future, tell me what you suggest at my [Twitch](https://www.twitch.tv/cheukting_ho). We will be ready to add the Netlify CMS to our website next time.

I used the [Turnip Exchange](https://turnip.exchange/) to play with strangers online. Also, [Nookazon](https://nookazon.com/) is "Amazon" for Animal Crossing, we may also use it to find the items that we want.

The code is work in progress but if you want to check it out, it will be uploaded and updated in [this repo](https://github.com/Cheukting/animal-crossing-wishlist)
Implement `tee` CLI in C - C Lang
Tags: c, linux
Published: 2020-04-28 02:21:16

The `tee` CLI read from stdin, then write date to stdout and the file name specified.

```c
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

int main(int argc, char* argv[]) {
    if (argc != 2) {
        fprintf(stderr, "%s\n", "Output file name required");
        return 1;
    }
    char buffer[1024] = {0};
    int outfd = open(argv[1], O_CREAT | O_WRONLY | O_TRUNC, 0644);
    if (outfd == -1) {
        fprintf(stderr, "%s\n", "Failed to create output file");
        return 2;
    }
    ssize_t nread = 0;
    while((nread = read(STDIN_FILENO, buffer, 1024)) != 0) {
        if (write(STDOUT_FILENO, buffer, nread) != nread) {
            fprintf(stderr, "%s\n", "Failed to write to stdout");
            return 3;
        }
        if (write(outfd, buffer, nread) != nread) {
            fprintf(stderr, "%s\n", "Failed to write to file");
            return 4;
        }
    };
    return 0;
}
```

Use `gcc` to compile and run:
```bash
$ gcc main.c -o mytee
```

Test:
```bash
$ date | ./mytee log.txt
Mon 27 Apr 2020 10:20:55 PM EDT
$ cat log.txt 
Mon 27 Apr 2020 10:20:55 PM EDT
```
ruby translated-controls.rb error
Published: 2020-04-28 02:02:41

ruby Chef InSpec error, 
translated-controls.rb:line number:systax error, unexpected end-of-input, expecting end

control "xccdf_org.cisecurity.benchmarks_rule_6.2.19_Ensure_no_duplicate_group_names_exist" do
  impact 1.0
  title "Ensure no duplicate group names exist"
  desc  "Although the groupadd program will not let you create a duplicate group name, it is possible foran administrator to manually edit the /etc/group file and change the group name."
    #Rationale: If a group is assigned a duplicate group name, it will create and have access to files with the first GID forthat group in /etc/group . Effectively, the GID is shared, which is a security problem."
    describe etc_group() do
      it('groups') { should_not contain_duplicates }
  end
end
Capture photos from camera using image stream with Flutter
Tags: flutter, dart, android, ios
Published: 2020-04-28 01:10:54

Hey everyone! I just published my first article/tutorial on "Capture photos from camera using image stream with Flutter". I'd appreciate if you could check it out and give some feedback. I know it has a lot of flaws, but I wanna improve them so any critique is appreciated. If it ends up helping out any of you even better.

The article can be found in the following link: https://medium.com/@hugand/capture-photos-from-camera-using-image-stream-with-flutter-e9af94bc2bee

I hope you enjoy it :)
Deciphering The API Conundrum
Tags: beginners, codenewbie, webdev
Published: 2020-04-28 01:05:16

Another mystery to unravel, APIs

An acronym for Application Programming Interface, APIs are best described as a medium or intermediary that allows two applications to communicate.

Nowadays, they are heavily used by developers to make software development super easy by providing most of the building blocks needed in a function. As a result of that, we tend to use them a whole lot, indirectly.

You might wonder why I termed it **super easy**.

Take for example, as a web developer, you intend building a web app that helps YouTube content creators to easily gain access to analytics based on the views they gained.

I know you might be pumped up to flex your skills in logic, but hold on 🖐

As a developer, to be precise, a smart one, it isn&#39;t really necessary for you to know how YouTube parses those data.

You can easily make development faster by implementing YouTube&#39;s Analytics API. It would help you integrate YouTube&#39;s functionality in the best way possible, into your desired web app.

Follow through, and congratulations, you have a successful project, working optimally with fewer flaws.

From the above illustration, you can tell that APIs allow developers to save time by helping them move on to other important aspects of their projects without doing the underground work and trying to re-invent the wheel

Alright, away from the developer&#39;s angle, let&#39;s see the last, and most probably, the simplest illustration of an API&#39;s function:

Now, if you&#39;ve ever visited a site that required you to create an account, you might notice an easier way of doing so by clicking on the **Sign in with …. Network** instead of the classic Email approach

I&#39;m so sure using that approach made your registration easy-peasy. Glad to tell you that you indirectly interacted with an API, the Web Authentication API to be exact.

Role

The main role an API plays is to simplify programming by reducing certain implementations and characteristics to expose only essential actions that a developer needs. In software engineering, this process is known as [**abstraction**](https://en.wikipedia.org/wiki/Abstraction_(computer_science)).

# **APIs vs Libraries and Frameworks**

APIs are related to software libraries. The major difference is;

An API describes and prescribes a set of rules to be implemented.

A library, on the other hand, is the utilisation of this set of rules

# **Examples of APIs and their Uses**

a. **Spotify**

It&#39;s mostly used to retrieve information from their catalogue about artists, tracks, and playlists

b. **YouTube**

We can grasp an idea from the illustration we earlier looked at. YouTube&#39;s API allows developers to access video statistics and YouTube channels

c. **Twitter**

The bird app&#39;s API allows you to search tweets, build custom direct messaging experiences, and create/manage ad campaigns
Understanding GraphQL and its Design Principles
Tags: graphql, designprinciples, javascript, database
Published: 2020-04-28 00:03:58

Welcome to this article!
Now that you know what GraphQL is, its history and how it works, it's time to understand it better.
If you fell randomly in this article, I am pleased to inform you that this is the second article in a series that covers GraphQL and will guide you through the creation of your first GraphQL API using JavaScript.
If you haven't read the [first article](https://dev.to/callebdev/so-what-is-graphql-3l9) in the series, you can take a look at it afterwards because it has a very important content in case you want to understand better about the emergence of GraphQL and its operation.
I hope you have a wonderful reading.

# What language to use to create my API?
![Programming languages](https://www.pngitem.com/pimgs/m/602-6026198_detail-page-image-thumbnail-programming-languages-icon-png.png)
As mentioned in the previous article, GraphQL is a declarative query language, this means that it allows you to query exactly and exclusively the data needed without worrying about how get for them. (It probably may not be very clear now, but I will discuss this point later :)).
GraphQL Server libraries exist for several programming languages ​​including JavaScript, C #, Java, Groovy, .NET, PHP, Scala, Python, Ruby, Erlang, Clojure, Elixir and Go.
The techniques that will be used in this series to build GraphQL services can be applied in any programming language, but this series is focused in the use of JavaScript create them.

**GraphQL is actually a specification!**
A specification refers to the description of characteristics of a language. The advantage of a specification is that it offers a common vocabulary and good practices for using the language.
GraphQL is a language specification for client-server communication.

# GraphQL design principles
![](https://image.slidesharecdn.com/graphql-oop-180219201201/95/graphql-the-new-lingua-franca-for-apidevelopment-33-638.jpg?cb=1519072211)
It is not because GraphQL allows you to build your API in any way and language you want, that it does not offer you principles for building your service.

**Hierarchical**
A GraphQL query is hierarchical. Fields are nested within other fields and the query is shaped like the data that it returns.

**Product centric**
GraphQL is driven by the data needs of the client and the language and runtime that support the client.

**Strong typing**
A GraphQL server is backed by the GraphQL type system. In the schema, each data point has a specific type against which it will be validated.

**Client-specified queries**
A GraphQL server provides the capabilities that the clients are allowed to consume.

**Introspective**
The GraphQL language is able to query the GraphQL server’s type system.

In the next article, you'll see GraphQL in practice, the famous queries and how to do them. For this I will use a public API where we will make our queries.
If you have any questions, suggestions or comments regarding the content covered in this article, leave it in the comments!
If you liked the article don't forget to leave your LIKE ❤!
Aaron Patterson Joins Shopify
Tags: rails, ruby, opensource, news
Published: 2020-04-28 00:02:27

Aaron is on the Ruby and Rails core teams and had been at GitHub for a long time. Shopify has been major stewards for Rails for quite some time and it seems like a pretty great landing place for Aaron.

{% tweet 1254891862906638339 %}

{% tweet 1254892103684943874 %}
What is Virtual Coffee?
Tags: beginners, community
Published: 2020-04-28 20:04:12

---
title: What is Virtual Coffee?
published: true
date: 2020-04-28 00:00:00 UTC
tags: beginners, community
canonical_url: 
---

I’ve been doing virtual coffee for about a month now, and I couldn’t have predicted how much I would look forward to the days that I get to talk to other devs. Here’s the thing, I’m a shy introvert, but I can flip to extrovert in the right situation. I’ve always loved conferencing, but there have been enough experiences where I’ve felt defeated because I was overwhelmed by the conference experience and my inability to initiate conversation and didn’t meet anyone new. But for whatever reason, with virtual experiences, I don’t feel the pressure and the emotional burnout that I do when conferences are more challenging for my personality.

### So what exactly is virtual coffee?

Well, first of all it’s open to anyone in tech, thinking about getting into tech, tech adjacent. Once a week–though I’m thinking of moving it to twice a week–I post a message on twitter asking who’s up for it at the day and time chosen that week. Then sometime that week, I send a zoom link.

### So what happens at virtual coffee?

Well, a whole lot and not that much. What I mean by that is we talk to each other and we meet new people, but there isn’t a focused talk or a workshop. It’s more like “hallway sessions” at conferences. Hallway sessions are time spent in between talks that give the attendees time to talk to each other. In the same way, when we have virtual coffee, we introduce ourselves, we have time for asking questions or talking about what we’re working on. It’s not formal, and you can jump in or out at your own convenience.

Kids are welcome. My 3.5yo usually sits on my chair and styles my hair with whatever oil or conditioner or substance she can find to brush through it. If your dog barks in the background or your cat sits on your head or a lizard climbs in your window, that’s cool too.

So far I haven’t themed the conversations. Honestly, I think it’s better if the conversation develops organically. I usually have something in my back pocket in case the conversation starts to die down.

I would say that my biggest challenge up to this point has been how to handle scheduling virtual coffee. When I did the first one, I didn’t really plan on doing this every week. But I’ve really enjoyed it and people have asked about the next and the next and the next one. But, I’d love to be able to make it easier for people to find the virtual coffee, RSVP, and to join the zoom session. I’d use calendly, but I have to pay for more than 1:1 meetings. I’m open to scheduling suggestions here!

### So what’s the point of virtual coffee?

The point is to form community. To meet new devs. To learn from each other. To offer advice. The point is to not feel alone.

_If you’re interested, DM me on [Twitter](https://twitter.com/BekahHW) and I can send you a link. This week I’m doing double duty with a 9:00am and 12:00pm EST. I’m considering shifting to a 9:00am Tuesday and 12:00pm Thursday, so if you’re interested and can’t make it this week, I’d love your input!_
Automate Email Bankruptcy using Apps Script
Tags: gmail, appscript
Published: 2022-06-14 22:41:31

---
title: Automate Email Bankruptcy using Apps Script
published: true
date: 2020-04-28 00:00:00 UTC
tags: gmail, appscript
canonical_url: https://justin.poehnelt.com/posts/automate-email-bankruptcy-using-apps-script/
---

It seems my inbox has exploded recently and this morning I wanted to declare email bankruptcy. Being a developer, I of course want to automate all things and Apps Script made this incredibly trivial to accomplish. Below are the steps I took and the total time including writing this blog post was less than an hour!

## Create a script

Go to [https://script.google.com/create](https://script.google.com/create). See this short guide on accessing Gmail from App Script.

```
function archiveOldEmail() {
  GmailApp.moveThreadsToArchive(
    GmailApp.search("in:inbox older_than:30d").slice(0, 100)
  );
}
```

You can customize this search as you see fit. I will probably modify this to also ignore specific labels or starred emails. For example, `in:inbox older_than:30 -in:starred` would not archive those emails I have starred. I recommend trying this out in Gmail first.

## Permissions

[![Permissions](https://justin.poehnelt.com/images/permissions-F3bVSX81Zw-200.jpeg)](https://justin.poehnelt.com/images/permissions-F3bVSX81Zw-600.jpeg)

Permissions

At this point, you need to grant permissions for your script to access your Gmail. Lucky for you, you wrote the code, so there shouldn’t be much to worry about. Famous last words! 😀

You may need to go through a verification process to get this working or can click the proceed unsafe option. See [https://support.google.com/cloud/answer/7454865](https://support.google.com/cloud/answer/7454865)

[![Oauth prompt](https://justin.poehnelt.com/images/oauth-ASDb1_Ecoz-200.jpeg)](https://justin.poehnelt.com/images/oauth-ASDb1_Ecoz-600.jpeg)

Oauth prompt

The sliced array of threads is because the GmailApp `moveThreadsToArchive` has a limit of 100 threads. But that doesn’t matter because I’m never going to run this manually.

## Trigger

Currently I have a cron that triggers this script every hour.

[![Triggering apps script every hour](https://justin.poehnelt.com/images/trigger--_lEZHJpWn-200.jpeg)](https://justin.poehnelt.com/images/trigger--_lEZHJpWn-600.jpeg)

Triggering apps script every hour

## Relax

At this point I should be able to relax as any email that was actually important will probably get a followup. Let’s see how it works!

Oh, and I REALLY hope I never need to adjust the trigger frequency to handle getting more than 100 emails per hour!

* * *

See all that you can do with Gmail at [https://developers.google.com/apps-script/reference/gmail/gmail-app](https://developers.google.com/apps-script/reference/gmail/gmail-app).
How to host your website for free - Part 1
Tags: aws, linux, webdev
Published: 2020-04-27 23:44:42

## This is a three part series.

In this article, I'll walk you through one way that you can take your site and host it on your own server.

Step 1: Linux server or a VM.
=============================

You'll need shell access to your server/VM. I would recommend micro instance in Google Cloud and if you are new you can almost get $300 in Google Cloud Credits. Also check out their [free tier](https://cloud.google.com/free). You can also use a t2.micro instance in AWS, they offer [free tier](https://aws.amazon.com/free/) too. In this guid I will show how you can get a free linux instance:

You will get $300 credit to play around with for a year! It is more than enough to learn and play with everything Google Cloud offers.
(⚠ You will need to provide a credit card even if registering for free tier)

## Step 1: Create new project:

After creating your account, create new projext where you will launch your resources, in our case, its a VM instance.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a8p4f015rn54vr2rwq0u.png)



## Step 2: Create a VM instance:
After the project is created, click on the little hamburger on top left side, and go down to Compute Engine and select VM intances
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/s8nac8zsmjjiniy3c7p8.png)

Click on create instance.
After that, please choose the following settings for your VM:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/f452b53zkxbs5ouotxyq.png)

If you scroll down, you will see the Firewall settings for your intance, check on both:
- Allow HTTP
- Allow HTTPS
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8qpj9iqgesblrkniva0n.png)

Then click create!

## Step 3: Connect to the VM instance:

Wait for the instance to launch.
Once the instance has launched click on the SSH button and it should open a new tab with shell access to your Linux instance.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1e8u7lum1muyrp6wcxtl.png)

You will also notice there is a public IP address assigned to your instance, take note of it, as this is where we will point our domain for our website.

******

Other cloud providers:
- [Azure](https://azure.microsoft.com/en-ca/free/)
- [Vultr](https://www.vultr.com/products/cloud-compute/#pricing)
- [Digital Ocean](https://www.digitalocean.com/)
- [Linode](https://www.linode.com/)

******

Please hit the 🖤 if it was helpful!