teleren/devto huggingface dataset:
Is Medium still a good platform for new writers in 2021? Discussing the pros and cons
Tags: career, beginners, productivity, codenewbie
Published: 2021-04-07 10:02:20

In the past 4 years, I have published 13 articles on Medium and have got to [3k+ followers](https://medium.com/@nityeshagarwal).

Here are the key lessons and tips I've learnt:


### 1. Medium is great place for early writers to reach more people.

I was a nobody on the Internet. And Medium still boosted my articles, allowing me to reach hundreds of thousands of readers.


### 2. This is especially true if you publish with a popular Medium publication. 

A lot of pubs accept articles from new writers and share it with their followers. 

I started by publishing with 3 large programming-focused publications and they were a large part of my early success.


### 3. But it has a big con - you don't own your audience. You are at the whims of the Medium platform.

In the past 2 yrs, they've decided to clamp down the distribution of non-paywalled articles. 

This has made my 3k followers worth ~nothing for me. I have no way to reach them.


This is also the reason why some of Medium's biggest publications have exited the platform in the past couple of yrs:

• Signal v. Noise
• FreeCodeCamp
• HackerNoon

(Read: [Signal v. Noise exits Medium](https://medium.com/signal-v-noise/signal-v-noise-exits-medium-56c483d827fc))


### 4. You should also beware of publishing for a publication.

When one of the publications that I had published with, decided to leave the Medium platform, they took my most popular articles (and all their SEO value) to their new website - leaving me high and dry.


### 5. But there is a way to capture the upside (Medium's distribution) while securing yourself from the downside (Medium's whims):

1. Publish articles on your domain on your own website
2. Republish them on Medium by [setting a canonical URL](https://help.medium.com/hc/en-us/articles/360033930293-Set-a-canonical-link) to your version

Search engines use canonical links to determine and prioritize the ultimate source of content, removing confusion when there are multiple copies of the same document in different locations. Sites that publish an overabundance of duplicate content without indicating a canonical link may be penalized in search engine rankings.

---

I now publish articles on my own website under my domain - [nityesh.com](https://www.nityesh.com/).

But then, I also also republish them on Medium by adding a canonical URL pointing to my website's version of the article.
Removing sensitive data from your Git history with BFG
Tags: git
Published: 2021-04-07 09:55:20

Here's how to remove sensitive data, like certificate files or passwords in your files, from your git repo and history with [BFG Repo-Cleaner](https://rtyley.github.io/bfg-repo-cleaner/).

## 1. Remove the sensitive files and secrets from your code and commit changes
Note that, by default, BFG doesn't modify the contents of your latest commit. So, remove the sensitive files and secrets from your code, commit the changes and ensure that your latest commit is clean with none of the undesired data in it before proceeding. 

## 2. Install BFG
You can download a JAR from the [site](https://rtyley.github.io/bfg-repo-cleaner/). If you're on Mac, `brew install bfg` should suffice.

## 3. Clone a fresh copy of your repo, using the --mirror flag:
```bash
# Example
$ git clone --mirror git://example.com/my-repo.git
```

## 4. Clean sensitive files
Use `--delete-files` to nuke files in your repo history.
```bash
# Examples
$ bfg --delete-files certificate.p12 my-repo.git
$ bfg --delete-files keystore.jks my-repo.git
$ bfg --delete-files id_{dsa,rsa} my-repo.git
$ bfg --delete-files *.{txt,log} my-repo.git
```
Note that the specified name matches on file name, not on path within repo. So `$ bfg --delete-files path/to/certificate.p12 my-repo.git` won't work.

## 5. Clean sensitive strings
Use `--replace-text` to clean strings from your repo history. Each string will be rewritten as "\*\*\*REMOVED\*\*\*" by default. This is a two-step process.

### 5.1. Create a file with a new line for each string you want to remove
Create a simple text file however you'd like.
```bash
# Example
echo "password123" >> passwords.txt
echo "123password" >> passwords.txt
```

### 5.2. Run the command
Run `bfg --replace-text` referencing the file you just created.
```bash
# Example
$ bfg --replace-text passwords.txt my-repo.git
```

## 6. Take a look at your new history
Enter the folder of the git repo and make sure your history has been updated.
```bash
# Example
$ cd my-repo.git

# Use git commands to examine the history
$ git log
$ git show HEAD
$ git show HEAD~1
$ git show d89bb58
```
(You won't see the physical files of your working tree if you list files in this directory, since we did a bare/mirror clone, in case you were wondering.)

## 7. Strip out the unwanted dirty data
Once satisfied with the state of the history, clean up those sensitive files, which git now considers unnecessary.
```bash
$ git reflog expire --expire=now --all && git gc --prune=now --aggressive
```

## 8. Push
Finally, once you're happy with the updated state of your repo, push it back up and you're done!
```bash
$ git push
```
 
If you're with a team have everyone ditch their old copies of the repo and do fresh clones.

Thanks for following along. Cheers!
2021-04-06 | Password manager housecleaning
Tags: learninpublic, beginners, webdev, privacy
Published: 2021-04-07 08:54:24

---
title: "2021-04-06 | Password manager housecleaning"
description: "Summary of my day"
published: true
tags: ["LearnInPublic", "Beginners", "Webdev", "Privacy"]
series: "miku86 Diary"
canonical_url: "https://miku86.com/blog/2021-04-06"
---

Sorry for the delay, I mostly forget to crosspost, you can find all diary entries on my [blog](https://miku86.com/blog/).

---

Last year, I migrated all my passwords from Firefox to [KeePassXC](https://en.wikipedia.org/wiki/KeePassXC) to have my passwords just saved locally, not in the hands of a third party.

Yesterday, I had a look into the database - 115 entries.

So looking at this data, I saw a lot of unused stuff, e.g. Zoom, some email accounts, some old tools and so on.

So I decided to do some housecleaning by deleting some of these accounts.

Before deleting the account, I set the account email address to something like `zoom-2021-04-06@mydomain.com` to have an unique address for each account.

Why? Because I hope to see, which company sells/leaks my email and/or doesn't delete it at all. This company will go to my personal "black list" of not trustworthy companies.

Some companies are already very sneaky:

- clicking on the deletion button doesn't work, even in different browsers
- the captcha isn't solvable, even after trying it for 10 minutes (no joke!)
- trying to [nudge me](https://en.wikipedia.org/wiki/Nudge_theory) with a blue, bold button to cancel the deletion and a just slightly-visible button to accept the deletion

Whatever, I managed to delete 13 accounts.
Line items
Published: 2021-04-07 09:44:51



Hi, I'm junior PHP developer with no previous experience. I'm task to create the following.
-----One----

    Log into the system
    On the list page click on the course that is now completed
    Click on the “delegate admin” button
    Capture the delegate fields a. Delegate count (number) b. Municipality / Org (select from the list) c. A switch for “is billable” d. Amount billed e. Click the plus button to include another line item then start at A for the new line item. Rinse repeat till done
    Click save

I'm using twig on the front-end. How to do the above functionality with twig and send it to PHP to save to the database?

I nee something like on the attached screen. I created this one using java-script.

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


----Two----
How to a tags on the system to allow users to search/filter by tags?
Why we need to override equals method in Java
Tags: java, webdev, springboot, spring
Published: 2021-04-07 09:44:12

By default, when we compare two instances of the same class in Java, it is checked whether both refer to the same object or not.

Therefore, two instances may be completely different regardless of the similarity of the information contained. Take for Example:

```
public class PersonDetails {

    private Integer age;
    private String firstName;
    private String lastName;
    private String nationality;

    public PersonDetails(Integer age, String firstName, String lastName, String nationality) {
        this.age = age;
        this.firstName = firstName;
        this.lastName = lastName;
        this.nationality = nationality;
    }
    
}
```

If we run the main class as follows,
```
public class Main {
    public static void main(String[] args){
        PersonDetails first = new PersonDetails(18,"John","Doe","American");
        PersonDetails second = new PersonDetails(18,"John","Doe","American");

        if(first.equals(second)){
            System.out.println("Equal");
        }
        else {
            System.out.println("Not equal");
        }
    }
}
```

The output will be: **Not equal**

And for us to check for equality of values inside the objects, we will need to override the equals method in our class.

```
public class PersonDetails {

        private Integer age;
        private String firstName;
        private String lastName;
        private String nationality;

        public PersonDetails(Integer age, String firstName, String lastName, String nationality) {
            this.age = age;
            this.firstName = firstName;
            this.lastName = lastName;
            this.nationality = nationality;
        }

        //Overriding equals() to compare PersonDetails objects
        @Override
        public boolean equals(Object o){
                //If object is compared to itself then return
                if(o == this){
                    return true;
                }

                //Check if o is an instance of PersonDetails or not
                if(!(o instanceof  PersonDetails)){
                    return false;
                }

                // typecast o to PersonDetails so that we can compare data
                PersonDetails personDetails = (PersonDetails) o;

                // Compare the values inside the objects and return accordingly
                return Integer.compare(age,personDetails.age) == 0
                        && firstName.compareTo(personDetails.firstName) == 0
                        && lastName.compareTo(personDetails.lastName) ==0
                        && nationality.compareTo(personDetails.nationality) == 0;

        }
}

```
If we run the main class again, 
The output will be: **Equal**

> Get source code used in this article from GitHub
[Link](https://github.com/SauveJeanLuc/TestEqualsAndHashcode)
NGI Teletalk com bd NTRCA Application Form
Published: 2021-04-07 09:23:02

NTRCA Knowns As Non-Government Teachers’ Registration & Certification Authority out Recruitment Cycle 3 Notice for filling Teaching posts. Candidate can Apply online from the official website I. e [ngi teletalk com bd] (https://newsalert99.com/world/bangladesh/ngi-teletalk-com-bd-recruitment-cycle-3-ntrca-vacant-posts-application-form/1587/). NTRCA NGI Teletalk Online Registration and Vacant posts Institute wise list mentioned Below..

Posts Name: Teacher (School, College, Madrasha, Technical & Business)
Total Vacant Posts: 54304 Vacancies
Last date to Apply: 30-April-2021
Online Link: Available
Admit Card: Available Soon
Result: Available Soon
Exam Date: Update soon

[NTRCA Recruitment Cycle 3 Application Form| NTRCA 17th  Vacant Posts| Admit Card Link] (https://newsalert99.com/world/bangladesh/ntrca-ngi-teletalk-17th-exam-online-e-application-form-login-application-status-detail/1788/)
Painful CDK - 1
Tags: cdk, aws, cognito, restapi
Published: 2021-04-07 09:18:29

AWS CDK is a great tool. Although it sometimes works not as expected. In this post, I'd like to share some CDK pain.

Let's take a look on the simple piece of code below. My goal is to create a new Cognito user pool authorizer and use it to protect a newly created endpoint with a lambda integration.

```javascript
// create cognito authorizer:
const authorizer = new apigateway.CfnAuthorizer(this.ctx, "restApiMyResourceAuthorizer", {
      restApiId: this.restApi.restApiId,
      type: "COGNITO_USER_POOLS",
      identitySource: "method.request.header.Authorization",
      name: "restApiMyResourceAuthorizer",
      providerArns: [".."],
 });
// create a resource
const myResource: apigateway.Resource = this.restApi.root.addResource("myResource");
// add an endpoint to the Rest API resource with authorizer
myResource.addMethod(lambdaDeploymentOptions.httpMethod, new apigateway.LambdaIntegration(lambda),{
      authorizationType: apigateway.AuthorizationType.COGNITO,
      authorizer: {
        authorizerId: authorizer.node.id,
        authorizationType: apigateway.AuthorizationType.COGNITO,
      }
});
```
This gives:
> Invalid authorizer ID specified. Setting the authorization type to CUSTOM or COGNITO_USER_POOLS requires a valid authorizer.

There are some opened questions in the internet on this topic.
Solution I've found is a bit hacky:

```javascript
const method = myResource.addMethod(lambdaDeploymentOptions.httpMethod, new apigateway.LambdaIntegration(lambda),{
    authorizationType: apigateway.AuthorizationType.COGNITO,
    authorizer: {
    authorizerId: lambdaDeploymentOptions.authorizer.node.id,
    authorizationType: apigateway.AuthorizationType.COGNITO,
  }
});

const child = method.node.findChild('Resource') as apigateway.CfnMethod;
child.addPropertyOverride('AuthorizationType', 'COGNITO_USER_POOLS');
child.addPropertyOverride('AuthorizerId', { Ref: lambdaDeploymentOptions.authorizer.logicalId });
```

In case of questions: "why `CfnAuthorizer`, not `CognitoUserPoolsAuthorizer`. The reason is simple - `CognitoUserPoolsAuthorizer` does not allow to set Token Validation regular expression (`identityValidationExpression`).

P.S.
There is a general guide how to solve issues with CDK. "Escape hatches": https://docs.aws.amazon.com/cdk/latest/guide/cfn_layer.html
Show off your Workspace 👩🏻‍💻💯
Tags: watercooler, discuss, productivity
Published: 2021-04-07 08:57:16

---
title: Show off your Workspace 👩🏻‍💻💯
published: true
description: Monthly Workspace Setup Show off
tags: watercooler, discuss, productivity 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/py5bsyazzccfm3nbebva.jpg
---
After launching a beta version of my new side hustle, ***[Prototion](https://prototion.com/)***, a marketplace for Template makers to sell their Notion Templates, I decided to leave my office and go remote for few weeks.  

So I selected my favourite place on earth, Himalayas, to work from the hills 🏔. Found a decent hostel in Mcleodganj, Himachal and cafe with high-speed internet, where one can sit and work. Here is a glance at my workspace for time being.
{% twitter 1379715348547522560 %}

making new friends as well 😅

{% twitter 1379716100414304256 %}
 

Enough of my stuff. I'm excited to see your workspaces. What changes have you made?

![](https://media.giphy.com/media/qAkvnjpXqpIUvkxpG0/giphy.gif)
Quod AI #2: Automatically discover code impact + easy tutorials
Tags: ai
Published: 2021-04-07 08:56:24

# Automatically discover the impact of code

3 years ago, I hired a new backend developer. He was bright and eager. I felt validated when he pushed his first ticket to production on his 2nd day... which crashed our platform for 3.5 hours when it was released. He had forgotten to update one of the property keys in a related file.
​
![https://downloads.intercomcdn.com/i/o/313578793/8b3607a3d3f8091f346b5557/cb-context-filter-sm.gif](https://downloads.intercomcdn.com/i/o/313578793/8b3607a3d3f8091f346b5557/cb-context-filter-sm.gif)
​
Our newest feature Code browser would saved my team from unhappy customer emails and disappointed looks from the sales team. Code browser features code in full context with file tree, impactful commits and code owner automatically. But our fan favorite feature is the ability to show related code in one click.

<center>**​[Try code browser](https://beta.quod.ai/github/mayeaux/nodetube/search?initTerm=recover%2520password&rootRepo=github%252Fmayeaux%252Fnodetube&term=recover%2520password&product_tour_id=215726)​**</center>

# An easier way to share code tutorials, guidelines, and more!
​
Stripe's API documentation is the best in the world. We took inspiration from it to build our new UX for collections. Share your code tutorials, guidelines, and more with your team. They'll enjoy our shiny new table of content.

![https://downloads.intercomcdn.com/i/o/313578852/fb474555589635bc7032eeff/collections-view-auth.gif](https://downloads.intercomcdn.com/i/o/313578852/fb474555589635bc7032eeff/collections-view-auth.gif)

PS: I built this collection ☝ in 5 minutes!

<center>**​[​Try collections​](https://beta.quod.ai/github/GetStream/Winds/collections/GetStream%252Fauthentication)​**</center>

# Blog

We've been busy writing articles for the productive and smart engineer.

Check out our latest blog posts:
* [How to keep developer documentation up to date in a CI/CD world](https://www.quod.ai/post/how-to-keep-developer-documentation-up-to-date-in-a-ci-cd-world)
* [Integrating Push Notifications with Firebase Java API](https://www.quod.ai/post/integrating-push-notifications-with-firebase-java-api)

Our reading list
* [Four Ways of Writing Thoughtful Code to Think Less](https://keyholesoftware.com/2021/02/15/four-ways-to-put-developer-experience-first/?utm_source=programmingdigest&utm_medium=email&utm_campaign=410)
How we developed a cross-platform backpack 🎒
Tags: mobile, reactnative, ux, discuss
Published: 2021-04-07 08:54:23

How we developed a cross-platform backpack 🎒

EIT Backpack is an innovation for young audiences as a tech-savvy way of standing out, a smart cross-platform accessory, equipped by a LED-light panel.

We developed:
▫️  a functional MVP for mobile applications that is connected to the LED backpack.
▫️  enabled image and video transfer via a Bluetooth 4.0 LE protocol
▫️  an auto-save feature: whenever a user adds a new graphic document or animation, the backpack stores the information on the mobile client. A reset feature for each user action.

🧑‍💻 Tech stack:
React Native, Bluetooth 4.0

💙 Our role:
Mobile Development, UX, Support

https://rocketech.it/pix
Quick ElasticSearch Index Cleanup
Tags: blogging, bash, curl, elasticsearch
Published: 2021-05-07 08:13:25

---
title: Quick ElasticSearch Index Cleanup
published: true
date: 2021-04-07 08:50:38 UTC
tags: Blogging,bash,curl,elasticsearch
canonical_url: https://deeb.me/20210407/quick-elasticsearch-index-cleanup
---

There are many solutions using `curator` and other libraries. I’ll try to add links here later (if I remember)

However, most of the time, all that’s needed is a quick `curl` call

```
curl -X DELETE "https://${ES-Endpoint}/${INDEX_NAME}"
```

Get the ES endpoint from the domain overview

List the index names using

```
curl "https://${ES-Endpoint}/_cat/indices"
```

So for a quick cleanup session for everything that matches a grep

```
curl "https://${ES-Endpoint}/_cat/indices" | grep 'something' | awk '{print$3}' \
while read INDEX_NAME; do
  echo "Deleting ${INDEX_NAME}"
  curl -X DELETE "https://${ES-Endpoint}/${INDEX_NAME}"
done
```
How to use a Google Sheet as a database for your web app
Tags: html, csv, livecoding, screencast
Published: 2021-04-07 08:49:28

Hey all! I made this screencast to show you how to use a Google Sheet as a quick and easy database for your single-page progressive web app. The technique doesn't require authentication, APIs, or complicated libraries. Everything is done directly in the browser without using the command line. Hope this is useful to you, thanks for watching!

{% youtube I-sf2ojxgQ0 %}
Python - How to Think Like a Programmer
Tags: python
Published: 2021-04-07 08:47:47

Before you can write programs for the computer, you have to learn how to think like a programmer. Learning to think like a programmer is valuable for any student. Here are steps to help anyone learn to code and see the value of computer science — even if they don’t plan to become a computer scientist.

As the title implies, [Python](https://python.org) is often used as a first language by people who want to learn programming. Python is clean and easy to read, but its design encourages programmers to write programs that are short, clear and easy to read.

Python is a programming language. But Python is more than just a programming language. It is a [philosophy](https://python-commandments.org/zen-of-python/), and a way of looking at software construction. It's also an enormous collection of highly reusable software components, know as modules and packages...

Sure there are other languages like [Go (golang)](golangr.com/) or [C++](https://www.cplusplus.com/doc/tutorial/), but I think Python is the best language to start with.

## Learn how computers work

The first step to learning to think like a computer scientist is to learn the basics of how computers work. They can’t simply be treated as magic boxes that do everything for us; we have to understand how they work at a fundamental level.

You probably don’t think about how computers work. Sure, you could sit around and ponder the mysteries of binary encoding and the memory hierarchy, or you could learn how computers work. 

Start by analyzing the goals of a computer system, and using them to motivate the building blocks of a computer: the clocking mechanism, memory, and the central processing unit. Next, learn the basic structure of a CPU, how it executes instructions, when it fetches instructions, and what it does with its results. 

## How to learn to code?

But how does one learn to code? It’s tough, and everyone learns differently. The key is that you have fun with it, because if you care about what you’re doing, you’ll want to keep going. The way you learn best is the way that will keep you motivated as you go through the process.

A good book+video course is the [Python Crash Course](https://gum.co/dcsp)

If you are new to Python, these websites can help: 
* [pythonbasics](https://pythonbasics.org/) python tutorial which goes over the basics
* [pythonprogramminglanguage](https://pythonprogramminglanguage.com/) general tutorial on python
* [pythonspot](https://pythonspot.com/) another good resource which goes over a variety of topics